Anda di halaman 1dari 58

Medical Shop Management System

`1. INTRODUCTION

Medical shop management requires user entry of container and product


dimensions, together with information on weight and orientation constraints

It implements the storage and retrieval system of day-to-day activities which


involves daily transaction report, monthly wise report on goods delivered, enquires which
enables us to provide efficient and accurate methods of organizing and accessing different
types of information.

In-built database facilities for up to 50 containers and 4000 products are


provided so that input into these screens can be carried out with minimal effort. If
information for a particular product code is already held in the 4000 product database then
this is automatically entered into the appropriate fields.

The first option will attempt to pack as much of the medicines using any of the
packing methods available to medical shop management. This may be a loading from the
floor or from the end of the container. The second and third options are self explanatory and
the one most appropriate to the practical circumstances should be selected.

Page 1 of 57
Medical Shop Management System

2. SYSTEM ANALYSIS

Analysis may be defined as a process of dividing the problems into parts,


identifying each part and establishing relationship in the parts. Analysis is a detailed study of
the various operations performed by a system and the relationships within and outside of the
system.

Analysis is a continuing activity at all stages of the project. It is the process of


studying problems. To find the best solution to the problem, by which the existing system is
learnt, existing problems are understood .Objectives and requirements are defined and the
solutions are evaluated. Once analysis is completed, the analyst has a firm understanding of
what is to be done.

Analysis consists of two sub phases: Planning and Requirements Definition.


They include understanding the customer’s problem, performing a feasibility study and
developing a recommended solution strategy, determining the acceptance criteria, and
planning the development product.

The products of planning a System Definition and Project Plan. The system
definition is typically expressed in English or some other natural language, and may
incorporate charts, figures, graphs, tables and equations of various kinds. The exact notation
is used in the system definition are highly dependent on the problem area. Obviously, one
uses different terminology to describe an accounting system than to describe a process
control system. Analysis is defined as the procedure by which we break down at intellectual
or substantial whole into parts or components.

Page 2 of 57
Medical Shop Management System

2.1 Existing System


Existing system is very complicated to keep the track of all registers
and handle them manually. As well as this work is time consuming & also expensive
in this system report work may be not accurate and not fastest. To avoid all these
limitations and make the working more accurately the system needs to be computerized

Drawbacks of the existing system

 Time consuming

 More expensive

 Searching problem

 Maintains problem of all registers

 Less accuracy

 Display multiple reports

2.2 Proposed System

In proposed system, the management needs not to keep any type of


registers, which they use to keep in old one. They have work only with one computer.
All the details are stored in computer files. The dual entries are done very quickly as
entry in one file only , affects the other file where it has to record. In the way there
is no need to record the computer operator.

Page 3 of 57
Medical Shop Management System

The working through registers system is not only very laborious and
time consuming , but there are number of errors found. In comparison to old system
the proposed system of computer processes many advantages.

2.3 Objectives of the Proposed System

 Accuracy

 Security

 Time Saving

 Perform Repetitive Task Very Well

 Low Cost

 Easy Maintenance

 Easy Modification

 Attractive and Status

2.4 Feasibility Study


An important objective of conducting the System Analysis is the determination
of the feasibility. Feasibility study is carried out to select the best system that meets the
performance requirements. Feasibility study is necessary to evaluate the feasibility of a
project at the earliest possible time. It is used to investigate the project and examines whether
the designed system will be useful to the organization. Feasibility and risk analysis are
related in many ways. If project risk is great, the feasibility of producing quality software is
reduced. The different type of feasibility are:

Page 4 of 57
Medical Shop Management System

 Technical Feasibility

 Operational Feasibility

 Economical Feasibility

Technical Feasibility

Technical Feasibility is used to find out whether the necessary technology, the
proposed equipment have the capacity to hold the data, which is used in the project. It is a
study of function, performance and constraints that may affect the ability to achieve an
acceptance system.

The technical Feasibility issues usually raised during the feasibility stage of
investigation includes these:

 The software which is running on windows XP operating system can be easily


installed.

 The hardware required is Pentium based server.

Operational Feasibility

This feasibility test asks if the system will works when it is developed is
installed.

Operational feasibility in this project are:

 The proposed system offers greater level of user-friendly lines.

 The proposed system produces best results and gives high performance.

 It can be implemented easily. So the project is operational feasible.

Page 5 of 57
Medical Shop Management System

Economical Feasibility

Economical feasibility deals about the economical impact faced by the


organization to implement a new system. Financial benefits must be equal on exceed the cost
of the existing system. The cost for implementing the proposed system, including hardware
and software cost should be evaluated.

Economical feasibility in this project are:

 There is no additional man power requirement.

 There is no additional cost involved maintaining the proposed system.

3. SYSTEM SPECIFICATION

Page 6 of 57
Medical Shop Management System

3.1 Hardware Specification

Processor : Pentium processor

Processor speed : 2.4GHZ

RAM : 5 GB

Hard Disk Drive : 30 GB

Floppy Disk Drive : 2GB

Keyboard : HCL

Monitor : LG

Base Memory : 32MB

3.2 Software Specification

Operating System : Windows XP

Front end tool : Visual Basic 6.0

Back end tool : Oracle

3.3 Language Specification

Page 7 of 57
Medical Shop Management System

Visual Basic 6.0

Visual Basic is quickest and earliest they to create powerful application for
Microsoft operating system. The Visual Basic programming system allows to create robust
and useful application that fully use of the Graphical User Interface (GUI).

The front-end tools make the user interface with the system easier and also
provide a user-friendly environment to the system. This rich language enables us to develop
many different types of application. We can create programs that intersect with the hardware.

Visual Basic is an event driven programming language. The advantage of


such an approach what that there were fewer bugs and lesser sup rises enterprises. Building
prototypes becomes very easy.

Active X Data Objects (ADO)

The bridge between the data provider and data consumers is through data
sources created using MS active X data object (ADO) which is the primary method in visual
basic to access data in any data source, both relational and non relational for backward
compatibility and project maintenances , Remote Data Objects (RDO) and Data Access
Objects (DAO) are still supported.

Data Sources and Data Control

On the client-side, several new data sources are available, including the data
environment, a graphical designer that allows to quickly creating ADO connections and
comments to access the data.

The data environment designer provides a dynamic programmatic interface to


the data access object. The data environment provides advance data shaping services .The

Page 8 of 57
Medical Shop Management System

ability to create hierarchies of related data, aggregate and automatic grouping all without
code.

The new ADO data control is similar to the intrinsic the data control and
remote data control, except that uses ADO to access sources either as user controls are
proprietary data structures.

Features

 Data access features allows to create data base and front-end create data base format,
including Microsoft SQL

 Server, oracle, Microsoft access and other enterprise level data base.

 It includes a GUI environment for making window based applications.

 Internet capabilities make it easy to provide access to documents and


applications across the internet from within your application.

 It provides a vital link to graphical environment and allows developing application


based on standard windows features: dialog boxes, command button, drop-down
menus, scroll bar, selection list, etc. It also allows creating robust application that
fully makes use of the graphical user interface.

 Visual basic allows adapting more of parallel approach, with independent section of
code for each option that the user may select. This is known as Environment
Programming Language.

Page 9 of 57
Medical Shop Management System

It can be extended easily through the use of window API call, hundreds of third party control
and DLLs, and integration with other windows applications through COM and DCOM
allows for a rapid application development and excellent for business application.

Oracle

Oracle database is capable of supporting over 10000 simultaneous users and a


database size of up to 100 terabytes. It is preferred to the other pc based RDBMS packages
because its client/server database qualities, failure handling, recovery management,
administrative tools to manage users and the database, object-oriented capabilities, graphical
user interface (GUI) tools, and web interface capabilities. It is widely used by corporation of
all size to develop mission-critical application. It is also used as a teaching tool by
educational institutions to teach object-oriented relational database technology, structured
query language (SQL), PL/SQL (oracle’s procedural language extension to SQL), and
interfacing web and oracle database. Oracle has an educational initiative program to form
partnerships with educational institutional to obtain oracle database software at a nominal
membership.

Oracle software is installed to work in three different environments in a stand-


alone environment, such as a laptop or desktop that is not an a network, oracle enterprise
database software SQL*plus client software are installed on same machine in a client/server
environment, a two-tier architecture with a server, oracle enterprise database software resides
on the server side, and SQL*plus client software resides on the client machine. In three-tier
architecture, the client communicates with oracle database server through a middle-tier
iSQL*plus, an interface through a web browser.

Client/Server Database

Page 10 of 57
Medical Shop Management System

Client/server database, such as oracle, run as a process on the server and run
a client database application on each client.

Demand on Client and Network

The client computer does not run the entire DBMS, only the client
application that requests data from the server the client request data from the server, and only
the requested data or sent back via network, which results in less network traffic.

Client Failure

The client failure, the client/server database is not affected. The other clients
are not affected either .Only the failed client’s transactions in progress are lost.

Transaction Processing

If a grouped a transaction or batch transaction fails in the middle, all


transactions are rolled back

Features

 Oracle is a popular client/server database management system that is based on the


relational model.

 The oracle environment provides utilities to work with database tables, developing
forms, reports, and graphs, managing users and database, and interfacing the web and
database.

 SQL*plus is oracle’s proprietary environment to enter SQL queries

 SQL is a language with data retrieval, DML, DDL, DCL, and transaction control
query statements.

Page 11 of 57
Medical Shop Management System

 SQL* plus is an environment that provides user with editing, file, formatting,
execution, interaction commands.

4. SYSTEM DESIGN

Page 12 of 57
Medical Shop Management System

System design is the process or art of defining the architecture, components,


modules, interface, data for a system to satisfy specified requirements. One could see it as the
application of systems theory to product development.

There is some overlap and synergy with the discipline of system analysis,
system architecture and system engineering. System design is therefore the process of
defining and developing a system to satisfy specified requirement of the market or a
customer.

The system design document describes how to transform the requirements


and the functional design into more technical system design specification. This design
involves conceiving and planning out in the mind and making a drawing, pattern, or sketch
of. It includes three types of activities: External Design, Architectural Design, and Detailed
Design. The architectural design and detailed design are collectively referred to as internal
design

The external design involves specifying the externally observable


characteristics of a software product and the internal design involves

Specifying the internal structure and processing details of the system. The
fundamental concepts of the system design includes abstraction, structure, information
hiding, modularity, concurrency, verification, and design aesthetics

4.1 Architectural Design

Page 13 of 57
Medical Shop Management System

Architectural design involves identifying the software components,


decoupling, and decomposing them into processing modules and conceptual data structure,
and specifying the interconnection among components.

System architecture is the design or set of relations between the parts of a


system. There is no strict definition of which an aspect constitutes system architecture, and
various organizations defined it in different ways.

System architecture is primarily concerned with the internal interfaces among


the system components or sub systems, and the interface between the system and its external
environment, especially the user.

The internal structure of the software product and tests that attempt to
break the system are opened during the implementation. The architectural design is also
called as internal design. The goal of this design is to specify the internal structure and
processing details, to record design decisions.

4.2 Normalization
Redundant data can pose a huge problem in database.

 Someone has to enter the same data repeatedly.

 If a change made in one piece of the data, the change has to be made in many places.

Redundancy may also let to anomalies. Decomposing is the process of splitting relations into
multiple relations to eliminate anomalies and maintain anomalies and maintain data integrity

Insertion anomaly

Page 14 of 57
Medical Shop Management System

Insertion anomaly occurs when then information about an entity cannot be


inserted unless the information about another entity is known.

Deletion anomaly

Deletion anomaly results when the deletion of information about one entity
leads to the deletion of information about another entity.

Update anomaly.

Update anomaly can occurs if the item price changes to a new price.

First Normal Form (1NF)

 The primary key is defined. This includes a composite key if a single column cannot
be used as a primary key

 All non key columns show functional dependency on the primary key components.

 The table contains no multi valued columns

Second Normal Form (2 NF)

 All 1NF requirements are fulfilled.

 There is no partial dependency.

Third Normal Form (3NF)

 All 2NF requirements are fulfilled.

 There is no transitive dependency

All the three normal forms are used to design the database.

4.3 Data Flow Diagram

Page 15 of 57
Medical Shop Management System

Data flow oriented techniques advocate that the major data items
handled by a system must be first identified and then the processing required on
these data items to produce the desired outputs should be determined. The DFD (also
called as bubble chart) is a simple graphical formalism that can be used to represent
a system in terms of input data to the system, various processing carried out on these
data, and the output generated by the system. It was introduced by De Macro (1978),
Gane and Sarson (1979).The primitive symbols used for constructing DFD’s are:

Symbols used in DFD

A circle represents a process.

A rectangle represents external entity

A square defines a source or destination of the system data.

An arrow identifies dataflow.

Double line with one end closed indicate data store.

Page 16 of 57
Medical Shop Management System

5. SYSTEM DEVELOPMENT

Page 17 of 57
Medical Shop Management System

5.1 Module Description


5.1.1 Purchase Item

The medicines been purchased by the medical shop, the details are recorded in
the Purchase Item. Some of the details been recorded by the Medical shop agent is the
agency from which the medicines are bought, item details such as item type, item name,
quantity, manufacturing date, expiry date etc.
The operations that are been performed here:
To add new records into the database, to modify an already existing record in
the database , to search a record and delete a record from the database.

5.1.2 Sales Item

The medicines been sold out by the medical shop, the details are recorded in
the Sales Item. Some of the details been recorded by the Medical shop agent is the agency or
the customer and their respective address to whom the medicines are sold, item details such
as item type, item name, quantity, manufacturing date, expiry date etc.
The operations that are been performed here :
To search a record in the database and delete a record from the database.

5.1.3 Item Details

The medicine details such as name of the medicine, bill number, manufacturing
date, expiry date, price and the quantity of the medicines etc are been recorded in the Item
Details.

5.1.4 Agency Billing

The bill for the medicines been purchased, is issued to the Customer by the
medical shop. The Customer bill contains the bill number, purchase date, agent or agency

Page 18 of 57
Medical Shop Management System

name, details of the item such as medicine type, name, price, quantity, manufacturing date,
expiry date etc
The operations that are been performed here:
To print the record , to modify an already existing record in the database , to
search a record and delete a record from the database.

5.1.5 Customer Billing

The bill for the medicines been purchased, is issued to the Customer by the
medical shop. The Customer bill contains the bill number, purchase date, details of the item
such as medicine type, name, price, quantity, manufacturing date, expiry date etc.
The operations that are been performed here:
To print the record ,to modify an already existing record in the database ,to
search a record and delete a record from the database.

5.1.6 Stock Details

The Stock details deals with the details of the agency as well as the stock item such as
the item type, item name, price and quantity.
The operations that are been performed here:
To display the sales details of the stock as recorded in the database ,to search a record
in the database.

6. SYSTEM TESTING AND IMPLEMENTATION

Testing is an activity to verify that a correct system is being build and if


perform with the intention of results once gathered and evaluated provide a qualitative
indication of software quality and reliability and serve as a basis for design modification. A
project is said to be incomplete without proper testing.

Page 19 of 57
Medical Shop Management System

6.1 System Testing

Testing Strategies

System testing is the stage of implementation that is aimed at ensuring that the
system works accurately and efficiently before live operation commences. Testing is vital for
the success of the system. System testing makes a logical assumption that if all parts of the
system are correct, the goal will be successfully achieved.

A series of tests are performed for the proposed system is ready for User
Acceptance Testing. The testing steps are

 Unit Testing

 Integration Testing

 Validation Testing

 Output Testing

 User Acceptance Testing

Unit Testing

Unit testing focuses verification efforts on the smallest unit of software design,
the machine module. This is also known as “MODULE TESTING”. The modules are tested
separately is carried out during programming stage itself. In this step, each module is found
to be working satisfactory. So the expected output from the module is arrived.

Integration Testing

Data can be lost across and interface, one module can have an adverse effect
on others, and sub-functions when combined may not produce the desired major functions.

Page 20 of 57
Medical Shop Management System

Integration Testing is a Systematic Structure, while at the same time conducting to uncover
errors associated within the interfaces. The objective is to take unit-tested modules and to
combine them and test it as a whole. Here correction is difficult because the vast expenses of
the entire program complicate the isolation of causes. This is the integration testing step. All
the errors encountered will be carried over to the next testing step.

Validation Testing

Validation testing is performed in order to find whether there is any flow and
deficiency in requirements of the system. Each and every module is tested independently.
The input and output process are validated effectively. The input of the user for each field is
validated to check if value entered is null (or) valid. After field level validation, the module
level is made such that they are integrated and a validation is performed for the whole
system.

Output Testing

After performing the validation, the next is output testing of the proposed
system. Since no system could be useful. If it does not produce the required output in the
special format asking the user about the requirement, test the output generated (or) displayed
by the system. Hence the output format is considered in two ways. On is on of the screen and
other is printed format.

User-Acceptance Testing

User-Acceptance of a system is the key factors for the success of any system.
The system under consideration is tested for user acceptance by constantly keeping in touch
with the perspective system users at the time of developing and makes changes whenever
required. This is done with the regard of the following points.

 Input Screen design

 Output Screen

Page 21 of 57
Medical Shop Management System

 Menu driven system

 Format of crystal reports and other output.

6.2 System Implementation

System implementation is the stage of the project that the theoretical design is
turned into a working system. If the implementation stage is not properly plane and control, it
can be considered to be the most crucial stage in achieving a successful new system and in
giving the user confidence that the new system will work and be effective.

Normally this stage involves setting up a coordinating committee, which will


act as a sounding board for ideas; complaints and problem. The first task is implementation
planning; i.e., deciding on the methods and time scale to be adopted. Apart from planning
two major task of preparing for implementation are, education taken place much earlier in the
project at the implementation stage the emphasis must be on training in new skills to gives
staff confidence that they can use the system. Once staff has been trained the system can be
tested.

After implementation phase, the user staff is adjusted to the changes created
by the candidate system, evaluation and maintenance to bring the new system to standard.
There is an there types

 Implementation Planning
 Education Planning
 System Planning

Page 22 of 57
Medical Shop Management System

7. SCOPE FOR FUTURE ENHANCEMENT

This Application is designed to be generic as we develop our site we should


take advantage of several areas in which you can improve and customize business .Automatic
notification of newly placed orders to the company’s shipping or processing department.
Different kinds of products will be introduced in future in order to satisfy the customer needs.
Many more facilities can be introduced.

Page 23 of 57
Medical Shop Management System

8. CONCLUSION
The software “Medical Shop Management System” has been developed in
windows 98 environment using visual basic as front end and oracle as back end. Time
consumptions reduced to a great extent and user as less complexity in handling this database.

The project is fully fledged and user friendly, End users will be lightened in
using this software because it is easy to have bills and reports and mostly all contents to be
entered are to selected from combo box. This reduces the calculating efforts to be carried out
by the users.

Page 24 of 57
Medical Shop Management System

BIBLIOGRAPHY

Referenced Book

1. ‘Visual Basic’ , Charles Hampfed (2000) ,University of Toronto

2. ‘Visual Basic 6.0’, Herbert Schildt (2000) , Tata McGraw Hill

3. ‘Visual Basic 6.0’, John Zukowski (2000) , BPB Publications

Page 25 of 57
Medical Shop Management System

4. ‘Data base systems using oracle’, Nilesh shah ,Phi publications

5. ‘Software Engineering’, Richard Fairley

6. ‘Software Analysis and Design’, Elnasri

Referenced Website

 www.vbtutor.net
 www.vbtutor.net/vb2010/index.html
 www.w3schools.com/vbscript/default.asp

Database : db_medical

Table Name : tb_loginform

Primary Key : null

Field Name Data Type Size Description

Username Varchar2 25 Username

Page 26 of 57
Medical Shop Management System

Password Varchar2 25 Password

Table Name : tb_PurchaseItem

Primary Key : Recordno

Field name Data type Size Description

Recordno Number 5 Record number

Agencynm Varchar2 30 Agency name

Itemtype Varchar2 20 Item type

Page 27 of 57
Medical Shop Management System

Itemnm Varchar2 30 Item name

Entrydt Varchar2 10 Entry date

Mfgdt Date Manufacture date

Expdt Date Expiry date

Ppr Number (8,2) Price per rate

Qty Number 5 Quantity

Total Number (8,2) Total

Table Name : tb_SalesItem

Primary Key : Itemtype

Page 28 of 57
Medical Shop Management System

Field name Data type Size Description

Recordno Number 5 Record number

Doctor Varchar2 30 Doctor

Custnm Varchar2 30 Customer name

Addr Varchar2 55 Address

City Varchar2 25 City

Agencynm Varchar2 30 Agency name

Itemtype Varchar2 30 Item type

Itemnm Varchar2 30 Item name

Entrydt Date Entry date

Mfgdt date Manufacture date

Expdt date Expiry date

Ppr Number (8,2) Price per rate

Qty Number 5 Quantity

Total Number (8,2) Total

Table Name : tb_Item detail

Primary Key : Itemname

Field name Data type Size Description

Recordno Number 5 Record number

Agencynm Varchar2 30 Agency name

Itemname Varchar2 30 Item name

Page 29 of 57
Medical Shop Management System

Batch no Varchar2 10 Batch number

Mfgdt date Manufacture date

Expdt date Expiry date

Table Name : tb_Agency bill

Primary Key : null

Field name Data type Size Description

Recordno Number(5) 5 Record number

Billno Number(5) 5 Bill number

Itemnm Varchar2(30) 30 Item name

Mfgdt Date Manufacture date

Page 30 of 57
Medical Shop Management System

Expdt Date Expiry date

Qty Number(5) 5 Quantity

Ppr Number(8,2) (8,2) Price pe rrate

Total Number(8,2) (8,2) Total

Table Name : tb_Cutomer bill

Primary Key : Billno

Field name Data type(size) Size Decription

Recordno Number 5 Record number

Billno Number 5 Bill number

Agencynm Varchar2 30 Agency name

Doctornm Varchar2 30 Doctor name

Itemnm Varchar2 30 Item name

Mfgdt Date Manufacture date

Page 31 of 57
Medical Shop Management System

Expdt Date Expiry date

Qty Number 5 Quantity

Ppr Number (8,2) Price per rate

Total Number (8,2) Total

Table Name : tb_Stock

Primary Key : Agencynm

Field name Data type(size) Size Description

Agencynm Varchar2(30) 30 Agency name

Itemtype Varchar2(20) 20 Item type

Itemnm Varchar2(30) 30 Item name

Mfgdt Date Manufacture date

Page 32 of 57
Medical Shop Management System

Expdt Date Expiry date

Ppr Number(8,2) (8,2) Price pe rrate

Qty Number(5) 5 Quantity

Page 33 of 57
Medical Shop Management System

Page 34 of 57
Medical Shop Management System

LoginForm

Screen Attributes

This screen shows login information.

Page 35 of 57
Medical Shop Management System

MDIForm

Screen Attributes
This screen shows MDI form.

Page 36 of 57
Medical Shop Management System

PurchaseItem

Screen Attributes
This screen shows purchaseitem details.

Page 37 of 57
Medical Shop Management System

SaleItem

Screen Attributes
This screen shows saleitem details.

Page 38 of 57
Medical Shop Management System

ItemDetail

Page 39 of 57
Medical Shop Management System

Screen Attributes
This screen shows item details.

Page 40 of 57
Medical Shop Management System

AgencyBill

Screen Attributes
This screen shows agency bill details.

Page 41 of 57
Medical Shop Management System

Customer Bill

Screen Attributes
This screen shows Customer bill details.

Page 42 of 57
Medical Shop Management System

Stock

Screen Attribute
This screen shows stock details.

Page 43 of 57
Medical Shop Management System

Page 44 of 57
Medical Shop Management System

Page 45 of 57
Medical Shop Management System

Page 46 of 57
Medical Shop Management System

Dim cn As ADODB.Connection

Dim rs As ADODB.Recordset

Dim rs1 As ADODB.Recordset

Dim cn1 As ADODB.Connection

Private Sub cmd_add_Click()

agency_nm = Me.cmb_agenm.Text

item_nm = Me.cmb_inm.Text

If cmd_add.Caption = "Ok" Then

cn.Execute "insert into sale_item values(" & Val(txt_rno.Text) & ",'" & Trim(Me.txt_dr.Text)
& "','" & Trim(txt_cnm.Text) & "','" & Trim(txt_add.Text) & "','" & Trim(txt_city.Text) &
"','" & Trim(cmb_agenm.Text) & "','" & Trim(cmb_inm.Text) & "','" &
Trim(Me.txt_itemnm.Text) & "','" & Format(dtp_endt.Value, "dd-mmm-yy") & "','" &
Format(Me.txt_mfgdt.Text, "dd-mmm-yy") & "','" & Format(Me.txt_expdt.Text, "dd-mmm-
yy") & "'," & Val(txt_ppr.Text) & "," & Val(txt_qty.Text) & "," & Val(txt_total.Text) & ")"

cn.Execute "commit"

rs.Requery

rs1.Requery

qty = Val(Me.txt_qty.Text)

While Not rs1.EOF = True

If agency_nm = rs1.Fields(0).Value Then

If item_nm = rs1.Fields(1).Value Then

Page 47 of 57
Medical Shop Management System

qty = Val(Me.txt_qty.Text)

qty1 = rs1.Fields(6).Value

qty1 = qty1 - qty

cn.Execute "update stock_detail set agencynm='" & cmb_agenm.Text & "',itemtype='" &
cmb_inm.Text & "',itemnm=' " & Me.txt_itemnm.Text & " ',mfgdt='" &
Format(Me.txt_mfgdt.Text, "dd-mmm-yy") & "',expdt='" & Format(Me.txt_expdt.Text, "dd-
mmm-yy") & "',ppr=" & Val(txt_ppr.Text) & ",qty=" & qty1 & " where itemtype='" &
cmb_inm.Text & "' "

cn.Execute "commit"

MsgBox "record updated"

Dim ans As String

rs.Requery

rs1.Requery

DataReport4.Show

ans = MsgBox("Do U Want To Print Out?....", vbYesNo, "deletion Process...")

If ans = vbYes Then

cm_print.ShowPrinter

Else

txt_rno.Text = " "

txt_dr.Text = " "

txt_cnm.Text = " "

txt_add.Text = " "

cmb_agenm.Text = " "

Page 48 of 57
Medical Shop Management System

txt_itemnm.Text = " "

cmb_inm.Text = " "

txt_city.Text = " "

txt_mfgdt.Text = " "

txt_expdt.Text = " "

txt_ppr.Text = " "

txt_qty.Text = " "

txt_total.Text = " "

txt_rno.SetFocus

End If

rs.MoveNext

If rs.EOF = True Then

rs.MoveLast

End If

Exit Sub

End If

End If

rs1.MoveNext

Wend

cmd_add.Caption = "print"

Else

cmd_add.Caption = "Ok"

Page 49 of 57
Medical Shop Management System

MsgBox "ok"

End If

rs.Requery

rs1.Requery

End Sub

Private Sub cmd_delete_Click()

Dim ans As String

no1 = InputBox("enter no to delete")

ans = MsgBox("Do U Want To Delete?....", vbYesNo, "deletion Process...")

If ans = vbYes Then

cn.Execute "delete from sale_item where recordno=" & Val(txt_rno.Text) & ""

MsgBox "record deleted"

Call data

cn.Execute "commit"

End If

rs.MoveNext

If rs.EOF = True Then

rs.MoveLast

End If

rs.Requery

rs1.Requery

Page 50 of 57
Medical Shop Management System

End Sub

Private Sub cmd_edit_Click()

Dim no As Integer

If cmd_edit.Caption = "Edit" Then

txt_rno.SetFocus

cmd_edit.Caption = "Edit Save"

Else

cn.Execute "update sale_item set recordno=" & Val(txt_rno.Text) & ",doctor='" & txt_dr.Text
& "',custnm ='" & txt_cnm.Text & "',addr='" & txt_add.Text & "',city='" & txt_city.Text &
"',agencynm='" & cmb_agenm.Text & "',itemnm='" & cmb_inm.Text & "',itemtype='" &
txt_itemnm.Text & "',entrydt='" & Format(dtp_endt.Value, "dd-mmm-yy") & "',mfgdt='" &
Format(txt_mfgdt.Text, "dd-mmm-yy") & "',expdt='" & Format(txt_expdt.Text, "dd-mmm-
yy") & "',ppr=" & Val(txt_ppr.Text) & ",qty=" & Val(txt_qty.Text) & ",total=" &
Val(txt_total.Text) & " where recordno='" & Val(txt_rno.Text) & "' "

cn.Execute "commit"

MsgBox "record update"

cmd_edit.Caption = "Edit"

End If

rs.Requery

rs1.Requery

End Sub

Private Sub cmd_first_Click()

If (rs.BOF = True) And (rs.EOF = True) Then

MsgBox "plece enter record", vbOKOnly

Page 51 of 57
Medical Shop Management System

Else

rs.MoveFirst

Call data

End If

End Sub

Private Sub cmd_last_Click()

If (rs.BOF = True) And (rs.EOF = True) Then

MsgBox "plece enter record", vbOKOnly

Else

rs.MoveLast

Call data

End If

End Sub

Private Sub cmd_next_Click()

rs.MoveNext

If rs.EOF = True Then

MsgBox "you are in last recod"

rs.MoveLast

End If

Call data

End Sub

Private Sub cmd_previous_Click()

Page 52 of 57
Medical Shop Management System

rs.MovePrevious

If rs.BOF = True Then

MsgBox "you are in first recod"

rs.MoveFirst

End If

Call data

End Sub

Private Sub cmd_exite_Click()

Unload Me

End Sub

Private Sub cmd_ref_Click()

Unload Me

Me.Show

End Sub

Private Sub cmd_search_Click()

Dim fnd As Integer

fnd = Val(InputBox("enter nofor searching", "find process", "1"))

While Not rs.EOF = True

If fnd = rs.Fields(0).Value Then

MsgBox "record found"

Call data

Page 53 of 57
Medical Shop Management System

rs.Requery

rs1.Requery

Exit Sub

End If

rs.MoveNext

Wend

If rs.EOF = True Then

MsgBox "record not found"

End If

rs.Requery

rs1.Requery

End Sub

Private Sub Form_Load()

Set cn = New ADODB.Connection

Set cn1 = New ADODB.Connection

Set rs = New ADODB.Recordset

Set rs1 = New ADODB.Recordset

cn.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Persist Security Info=True"

cn1.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Persist Security


Info=True"

On Error GoTo err

cn.Execute "create table sale_item(recordno number(5),doctor varchar2 (30),custnm


varchar2(30),addr varchar2(55),city varchar2(25),agencynm varchar2(30),itemtype

Page 54 of 57
Medical Shop Management System

varchar2(30),itemnm varchar2(30),entrydt date,mfgdt date,expdt date,ppr number(8,2),qty


number(5),total number(8,2))"

cn.Execute "commit"

err:

rs.Open "select *from sale_item", cn, adOpenStatic, adLockBatchOptimistic

rs1.Open "select *from stock_detail", cn, adOpenStatic, adLockBatchOptimistic

Me.cmb_agenm.Text = agency

Me.cmb_inm.Text = item

Me.txt_ppr.Text = price

Me.dtp_endt.Value = Format(Date, "dd-mmm-yy")

Me.txt_mfgdt.Text = Format(mfgdate, "dd-mmm-yy")

Me.txt_expdt = Format(expdate, "dd-mmm-yy")

Me.txt_itemnm.Text = itemnm

End Sub

Public Function data()

txt_rno.Text = rs.Fields(0).Value

txt_dr.Text = rs.Fields(1).Value

txt_cnm.Text = rs.Fields(2).Value

txt_add.Text = rs.Fields(3).Value

cmb_agenm.Text = rs.Fields(4).Value

cmb_inm.Text = rs.Fields(5).Value

txt_itemnm.Text = rs.Fields(6).Value

Page 55 of 57
Medical Shop Management System

dtp_endt.Value = rs.Fields(7).Value

txt_city.Text = rs.Fields(8).Value

txt_mfgdt.Text = rs.Fields(9).Value

txt_expdt.Text = rs.Fields(10).Value

txt_ppr.Text = rs.Fields(11).Value

txt_qty.Text = rs.Fields(12).Value

txt_total.Text = rs.Fields(13).Value

End Function

Private Sub txt_ppr_KeyPress(KeyAscii As Integer)

If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8) Then

KeyAscii = 0

MsgBox "plese enter numeric value"

txt_ppr.SetFocus

End If

End Sub

Private Sub txt_qty_KeyPress(KeyAscii As Integer)

If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8) Then

KeyAscii = 0

Page 56 of 57
Medical Shop Management System

MsgBox "plese enter numeric value"

txt_qry.SetFocus

End If

End Sub

Private Sub txt_rno_KeyPress(KeyAscii As Integer)

If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8) Then

KeyAscii = 0

MsgBox "plese enter numeric value"

txt_rno.SetFocus

End If

End Sub

Private Sub txt_qty_lostfocus()

txt_total.Text = txt_qty.Text * txt_ppr.Text

End Sub

Private Sub txt_pcode_KeyPress(KeyAscii As Integer)

If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8) Then

KeyAscii = 0

MsgBox "plese enter numeric value"

txt_pcode.SetFocus

End If

End Sub

Page 57 of 57
Medical Shop Management System

Private Sub txt_phno_KeyPress(KeyAscii As Integer)

If Not (KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8) Then

KeyAscii = 0

MsgBox "plese enter numeric value"

txt_phno.SetFocus

End If

End Sub

Page 58 of 57

Anda mungkin juga menyukai