Professional Documents
Culture Documents
Report Example
Report Example
XAVIERS COLLEGE OF
MANAGEMENT
AND TECHNOLOGY
PROJECT
REPORT
ON
PHARMACY MANAGEMENT
SYSTEM
SUBMITTED BY
COURSE
ENROLLMENT NO.
BATCH
GUIDED BY
AMRENDRA KUMAR
BCA
12303302062
2013-2016
:
PROJECT REPORT
ON
GENYSISX MULTIPAGE
RESPONSIVE WEBSITE
FOR
R.K CRYSTAL TECHNOLOGY
AT
BORING ROAD, PATNA, 800023
SUBMITTED BY:
(RAV GROUP)
RUPALI, 47
AMRENDRA, 12
VEENA KUMARI, 56
Fr.Dr.T.Nishant
S.J
(St.
Xaviers
College
of
Contents
Description
Page no.
1.
Introduction
8
2.
Objective.
9
3.
10-
Analysis
About Organization
Feasibility Study
Design
14-
13
4.
25
System Design
Module Hierarchy of System
7
5.
ER Diagram
Data Dictionary
Table Structure
Process Logic
Environment & Tools...
47-
50
6.
51
Introduction
Websites have changed quite a bit since their inception
and now include many different flavors and varieties. In
the 90s, when websites were becoming increasingly
popular, most of the websites were static html. Static html
implied that each page was planned out and hand coded
to match the plan. A static website contains Web pages
with fixed content. Each page is coded in HTML and
displays the same information to every visitor. Static sites
are the most basic type of website and are the easiest to
Server-Side Scripting
Web pages that change when a web page is loaded or visited use server-side
scripting. Server-side content is content that's generated when a web page is
loaded. For example, login pages, forums, submission forms, and shopping carts,
all use server-side scripting since those web pages change according to what is
submitted to it. Scripting languages such as PHP, JSP allow a web page to respond
to submission events.
Websites
organizations
are
proved
and
institutions
boon
etc.,
to
the
as
business
now
every
Objectives
The top most objective of this project is to provide a
webpage which is responsive and can be easily open
in each and every device.
10
information,
Team
member
information,
REQUIREMENT ANALYSIS
After analyzing the requirement of the company
11
1. HOME PAGE
2. ABOUT US PAGE
2.1 OUR COMPANY
2.2 OUR TEAM
2.3 MISSION AND VISION
2.4 OUR CLIENTS
2.5 TESTIMONIALS
2.6 PAYMENTS OPTIONS
2.7 LETTER FROM CEO DESK
3. SERVICES
3.1 WEB HOSTING
3.1.1 LINUX
3.1.2 WINDOWS
3.2 WEB DEVELOPMENT
3.2.1 WEB APPLICATION
3.2.2 WEBSITE
3.3 WINDOW APPLICATION
3.4 SPECIAL PRESENTATION
12
5.3 MUSIC
5.4 REAL STATE
5.5 DESIGN
5.6 RESTURANT AND FOOD
5.7 ACCOMODATION
5.8 EVENTS
5.9 PORTFLIO AND CV
5.10 HEALTH
5.11 FASHION AND BEUTY
5.12 EDUCATION
5.13 LANDING PAGE
6. FEEDBACK
7. CONTACT US
8. PAYMENT
14
About Organization
personnel,
together
with
good
Hospital
has
computerized
the
Registration,
15
Feasibility Study
One of the most important things to be done before the
initiation of the software development is the feasibility analysis
to test whether the software is feasible or not. The major tests
of feasibility will be operational feasibility, technical feasibility
and economical feasibility.
16
Technical Feasibility:
Design
Good design is the key to engineering. Design is a
creative process requiring insight and flair on the part of the
designer. It must be practiced and learnt by experience and
study of existing systems.
Any design problem has been tackled in two stages.
17
and
their
relationships
are
identified
and
documented.
Abstract
Specification:
For
each
sub-system,
an
PHARMACY
MANAGEMENT
SYSTEM
HIERARCHY DIAGRAM
18
Main store
Sales store
Admin
Purchase detail
Supplier Transfer detail
Store keeper
Inpatient
Sales detail
Department
19
Mainstore module
Salestore module
All the pharmacy management work involves only these two
main modules which further contains some submodules.
Admin module
Supplier
Transfer detail
Purchase detail
Storekeeper
Inpatient
Sale detail
Department
20
1.2 Transfer detail module:Transfer detail module contains the information regarding
transfer of all the medicine stock i.e. Receipt no, Transfer
quantity, product_id, date, username, from main store to
sales store.
1.3 Purchase detail module:Purchase detail module contains the information regarding
Purchase of all the medicines from the different supplier
i.e. Invoice no, purchased quantity, product_id, supplier_id,
date, username, Amount.
21
2. Storekeeper module:Storekeeper has right to access only sale store. The store
keeper
module
also
contains
the
information
about
2.2 Sale detail module:Sale detail module contains the information regarding
selling of all the medicines from salestore i.e. Bill_no,
sold_quantity,
product_id,
Patient_id,
date,
username,
Total_amount.
22
23
represent
functional
mechanism
detail.
for
increasing
Therefore,
functional
information
the
DFD
modeling
flow
and
provides
as
well
a
as
24
Supply
medicine
Status of
store
Supplier
Admin
Generat
e
invoice
Transfe
r stock
Order for
medicine
Collect
money
Maintain
main
stock
Check
status
Order to
supplier
Pharmacy Management
System
(Kurji Holy Family
Hospital)
Maintain
sales stock
Status
of
Prescriptio
n
Bill
genera
te
Prescription
Generat
e bill
Payment
Paymen
t
Check
store
status
Received
medicin
e
Issue
medicin
e
25
Patient
Store Keeper
Order
medicin
1.0
Order
Generat
e
Admin
Supplier
Supply
medicin
e
Purchas
e details
Transfer
Prurchase
Admin
Check
status
2.0
Main stock
Update
Transfer
details
Transfer &
update
26
Get updated
status of
stock
3.0
Sales store
Store keeper
Generate
bill
Updat
e
Issue details
Received
Payment
Payment
Prescriptio
Receive
d
medicin
4.0
Patient
Admin
Details
of
medicin
1.1
Order to supply
medicine
27
Medicine
detail
Storekeepe
r
Bill receipt
of order
1.2
Generate
invoice
Updat
e
Invoice
detail
Received
invoice
Confirmation
28
Admin
Check
medicine
id & batch
Storekeepe
Storekeepe
r
r
Storekeepe
r
Medicine
Get
received
medicine
stock details
Payment table
Payment
received
2.1
Check main
store status
1.4
Received
medicine
Updat
e
Updat
e
Transfer table of
main store
Purchase
detail table
Transfer
Add
Quantity of
medicine
2.2
Transfer to
main store
Transfer
table of
sales store
29
Check
medicine
Store
Admin
keeper
Check
stock
Get stock
details
Get
medicine
stock details
Admin
Store
keeper
Enter
Quantity of
medicine to
transfer
Enter medicine
asked by
patient
Updat
e
3.1
2.3
Sales store
Maintain stock
Give
prescripti
on
Updat
e
Patient
Main stock
table
Transfer
2.4
Transfer to sales
store
Updat
e
Available
3.2
Billing
Confirm
30
3.3
Payment
Patient
Bill
received
Updat
e
Payment
table
Do
payment
Issue
Store
keeper
Issue
medicin
3.4
Issue medicine
Updat
e
Cash salesl
table
31
Give
prescriptio
n
4.1
Storekeeper
Patient
Check store
status
Enter
medicine
details
4.2
Billing
Store
keeper
Confirmatio
n
32
Ptaient
Bill
received
4.3
Payment
Do
payment
Confirmation
4.4
Received
medicine
Patient
Medicine
ER Diagram
The ER-Diagram was originally proposed by
Peter Chen for the design of relational database systems
and has been extended by others. The ERD enables a
software engineer to fully specify the data objects that are
input and output from a system, the attributes that define
the properties of these objects, and their relationships.
33
attributes,
relationships,
and
various
type
34
E-R DIAGRAM
S_Add
S_id
P_id
P_name
Contact
P_type
S_name
S_email
MFG by
Power
Cst_no
P_name
P_class
M
Supply
Medicine
P_sub_
class
Supplier
M
P_id
Bill no
To
S_id
Date
U_name
Store
P_id
Receipt_no
Admin
35
Managed by
Password
Total_qty
1
Transfer Medicine
Sales
Store
1
Batch
1
M
P_id
P_id
Batch
Storekeepe
r
Batch
Mainstore
Tranfer
medicine
U_name
Receipt_no
Store
Total_qty
Password
Total_qty
Receipt_no
Date
Store
U_name
Password
36
Storekeeper
Dep id
Store
1
Opd no
Product qty
Issue Medicine to
Date
Opd no
Pat_name
Gender
Age
Fathres
name
Dep_id
Dep_name
Admits
Patient
Address
Phone no
M
Departmen
t
M
1
Zip no.
Pat_category
Doctor
Doc_id
Prescribed
medicine
Dep_id
Doc_name
Email id
Address
37
38
Data Dictionary
M
Works
Phone_no
Srno
Data Name
Data
Size
Data Type
Table Used
User_id
20
Varchar2
Cash_sale_master
Department_return_master
Sale Return_master
P_id
Varchar2
Purchase_detail, Product
Sales_stock, Main_stock
Inpatient_issue_detail
Cash_sale_detail
Department_return_detail
Sale_return_detail, transfer_detail
Transfer_to_mainstock
Total_qty
10,3
Varchar2
Main_stock, Sales_stock
Bill_no
20
Varchar2
Cash_sale_master
Cash_sale_detail
Receipt_no
20
Varchar2
Purchase_detail
Purchase_master
Main_stock, Sales_stock
Inpatient_issue_detail
39
Batch
10
Varchar2
Purchase_detail,main_stock Sale_stock
Inpatient_issue_detail
Cash_sale_detail
Department_return_detail
Transfer_to_main_stock
Transfer_detail
Srno
Data Name
Data
Size
Data Type
Table Used
Issued_qty
10
Varchar2
Inpatient_issue_detail
Cash_sale_detail
Remarks
50
Varchar2
Department_issu_master
Inpatient_isuue_master
Cash_sale_master
Ip_no
20
Varchar2
Admission_detail
Inpatient_issue_master
Cash_sale_master
10
Opd_no
20
Varchar2
Admission_detail,
Patient_detail,
Cash_sale_master
11
Doc_id
10
Varchar2
Admission_detail
Cash_sale_master
12
IP_issue_no
16
Varchar2
Impatient_issue_detail
Impatient_issue_master
40
13
Total_amount
(10,3)
number
14
Roundoff_amount
(10,3)
number
15
Net_amount
(10,3)
number
Srno
Data Name
Data
Size
Data Type
Table Used
16
Amount
10,3
Varchar2
Inpatient_issue_detail
Cash_sale_detail
Department_issue_detail
17
Total_Amount
(10,3)
Number
Purchase_detail
Department_return_detail
Sale_return_detail
18
Trans_no.
16
Varchar2
Transfer_to_main_stock
Transfer_detail
19
Transfer_date
Date
Transfer_to_main_stock
Transfer_detail
20
Trans_from
Varchar2
Transfer_to_main_stock
Transfer_detail
41
21
Trans_to
Varchar2
Transfer_to_main_stock
Transfer_detail
22
Trans_by
20
Varchar2
Transfer_to_main_stock
Transfer_detail
23
Trans_qty
10
Varchar2
Transfer_to_main_stock
Transfer_detail
24
Dep_id
16
Varchar2
Department
Department_return_master
25
Status
Varchar2
TABLE STRUCTURE
User (log_in)
Data
Data Type
Size
Description
Comment
Varchar2
20
Not Null
User/admin
Name
u_nm
name
Pass
Varchar2
10
Store
Varchar2
Not Null
Password
Store
42
PRODUCT
Data Name
Data
Size
Type
Descriptio
Comment
P_ID
Number
Primary Key
Product id
P_NM
Varchar2
20
Not Null
Product
name
P_TYPE
Varchar2
20
Not Null
Product type
POWER
Varchar2
20
Not Null
Medicine
power
P_CLASS
Varchar2
20
Not Null
Product class
P_S_CLASS
Varchar2
20
Not Null
Product
sub
class
MFGBY
Varchar2
20
Not Null
Manufactured
by
Supplier (supplier)
Data
Data
Size
Description
Comment
Name
Type
S_ID
Number
Primary Key
Supplier id
S_NAME
Varchar2
20
Not Null
Supplier
name
S_ADD
Varchar2
70
Not Null
Supplier
address
CONTACT
Number
20
Not Null
Contact no.
43
S_EMAIL
Varchar2
30
Not Null
Email id
CST_NO
Varchar2
20
Not Null
Central
sales-tax
no.
VAT_NO
Varchar2
20
Not Null
Value
added-tax
no.
Data Type
Size
Description
Description
Receipt_no.
Varchar2
16
Foreign Key
Receipt no.
P_id
Number
Not null
Product id
Batch
Varchar2
10
Not null
Product name
MFG
Date
Not null
Manufacture
REC_QTY
Number
(10,3)
Not null
Received qty
FREE_QTY
Number
(10,3)
Not null
Free quantity
CONV_FACT
Number
(10,3)
Not null
Conversion
date
factor
TOTAL_QTY
Number
(10,3)
Not null
Total qty
MRP_UNIT
Number
(10,3)
Not null
TAX
Number
Not null
Tax
PACKCOST_PACK
Number
(10,3)
Not null
PACKMRP_PACK
Number
(10,3)
Not null
TOTAL_PACKCOST
Number
(10,3)
Not null
TOTAL_PACKMRP
Number
(10,3)
Not null
44
VAT
Number
Not null
COSTPRICE_PACK
Number
(10,3)
Not null
COSTPRICE_UNIT
Number
(10,3)
Not null
ACTUAL_MRP_UNIT
Number
(10,3)
Not null
TOTALCOST_PRICE
Number
(10,3)
Not null
Data Type
Size
Description
RECEIPT_NO.
Varchar2
16
Primary Key
RECEIPT_DATE
Date
Not null
INVOICE_N0
Varchar2
16
Not null
S_ID
Varchar2
Not null
CREATED_BY
Varchar2
20
Not null
CREATED_ON
Date
Not null
VERIFIED_BY
Varchar2
20
Not null
VERIFIED_ON
Date
Not null
REMARKS
Varchar2
50
Not null
VAT_AMT
Number
(5,3)
Not null
Comment
Supplier id
Value added
tax amount
TOTAL_AMT
Number
10
STATUS
Varchar2
45
Mainstock (main_stock)
Date name
Data type
Size
Description
Comment
RECEIPT_NO
Varchar2
16
Foreign key
Receipt no.
P_ID
Varchar2
Not null
Product id
BATCH
Varchar2
10
Not null
Batch
TOTAL_QTY
Number
10
Not null
Salestock
Data Name
Data Type
Size
Description
RECEIPT_NO
Varchar2
16
Foreign key
P_ID
Varchar2
Not null
BATCH
Varchar2
10
Not null
TOTAL_QTY
Number
10
Not null
Comment
Product id
46
Inpatient_issue_detail
Date name
Data type
Size
Description
Comment
IP_ISSUE_NO
Varchar2
16
Foreign key
Inpatient
issue no.
P_ID
Number
Foreign key
BATCH
Varchar2
10
Not null
10
Not null
QTY_ISSUED Number
AMOUNT
Number
(10,3)
Not null
RECEIPT_NO
Varchar2
16
Not null
Product id
Inpatient_issue_master
Date name
Data type
Size
Description
Comment
IP_ISSUE_NO
Varchar2
16
Primary Key
Inpatient
issue no.
ISSUE_DATE
Date
Not null
47
IP_NO
Number
16
Foreign key
Inpatient
no.
PRESCRIBED_BY
Varchar2
20
Not null
REMARKS
Varchar2
50
Not null
ISSUED_BY
Varchar2
20
Not null
TOTAL_AMOUNT
Number
(10,2)
Not null
ROUNDOFF_AMOUN
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
Department_issue_detail
Date name
Data type
Size
Description
Comment
DP_ISSUE NO
Varchar2
20
Foreign Key
Department
issue no.
P_ID
Number
20
Not null
BATCH
Varchar2
20
Not null
QTY_ISSUED
Number
20
Not null
AMOUNT
Number
RECEIPT_NO
Varchar2
Product id
Not null
20
Not null
48
Department_issue_master
Date name
Data type
Size
Description
Comment
DP_ISSUE NO
Varchar2
16
Primary Key
Department
issue no.
DEP_ID
Varchar2
Not null
Department
id
ISSUE_DATE
Date
Not null
REMARKS
Varchar2
50
Not null
ISSUED_BY
Varchar2
20
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUN
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
Data type
Size
Description
BILL_NO
Varchar2
16
foreign Key
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
ISSUED_QTY
Number
10
Not null
AMOUNT
Number
(10,3)
Not null
Comment
Product id
49
RECEIPT_NO
Varchar2
16
Not null
Date name
Data type
Size
Description
Comment
DEP_ID
Varchar2
16
Primary Key
Department
Department
id
DEP_NAME
Varchar2
20
Not null
Department
name
Data type
Size
Description
BILL_NO
Varchar2
16
Primary Key
OPD_NO
Varchar2
16
Not null
Comment
Outpatient
department
no.
IP_NO
Varchar2
16
Not null
Inpatient no
DOC_ID
Varchar2
10
Not null
Doctor id
USER_ID
Varchar2
10
Not null
BILL_DATE
Date
Not null
50
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUNT
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
REMARKS
Varchar2
50
Not null
Data name
Data type
Size
Description
OPD_NO
Varchar2
16
Primary Key
IP_NO
Varchar2
16
Not null
ADDMISSION_DATE
Date
Not null
PREVIOUS_IP_NO
Varchar2
16
Not null
DOC_ID
Varchar2
16
Not null
PATIENT_TYPE
Varchar2
10
Not null
SERVICE
Varchar2
10
Not null
WARD_NO
Varchar2
10
Not null
BED
Varchar2
10
Not null
CATEGORY
Varchar2
10
Not null
Admission detail
Comment
Doctor id
51
Data type
Size
Description
Comment
DP_RETURN_NO
Varchar2
16
Foreign Key
Department
return no.
P_ID
Number
Foregn key
BATCH
Varchar2
Not null
RETURN_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
Data type
Size
Description
DP_RETURN_NO
Varchar2
16
Primary Key
DP_RETURN_DATE
Date
Not null
DEP_ID
Number
16
Not null
REMARKS
Varchar2
50
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUNT
Number
Not null
Comment
Department id
52
NET_AMOUNT
Number
10
Not null
USER_ID
Varchar2
20
Not null
Data type
Size
Description
RETURN_NO
Varchar2
16
Primary Key
RETURN_DATE
Number
16
Not null
REMARKS
Date
Not null
TOTAL_AMOUNT
Varchar2
16
Not null
ROUNDOFF_AMOUNT
Varchar2
16
Not null
NET_AMOUNT
Varchar2
10
Not null
USER_ID
Not null
IP_NO
Foreign Key
OPD_NO
Foreign Key
Comment
Data type
Size
Description
RETURN_NO
Varchar2
16
Foreign Key
Comment
53
P_ID
Number
Foreign Key
BATCH
Varchar2
10
Not null
RETURN_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Foreign Key
TOTAL_AMOUNT
Number
(10,3)
Not null
Patient detail
Date name
Data type
Size
Description
OPD_NO
Varchar2
16
Primary Key
PAT_NAME
Varchar2
16
Not null
FATHERS_NAME
Varchar2
Not null
SEX
Varchar2
10
Not null
AGE
Number
16
Not null
VILLAGE
Varchar2
10
Not null
HOUSE
Varchar2
10
Not null
PS
Varchar2
10
Not null
DISTRICT
Varchar2
10
Not null
PO
Varchar2
Not null
OCCUPATION
Varchar2
10
Not null
MARITAL_STATUS
Varchar2
Not null
REGION
Varchar2
Not null
NATIONALITY
Varchar2
Not null
PAT_CATEGORY
Varchar2
Not null
Comment
Patient name
Postal
Post office
54
ZIP_NO
Varchar2
Not null
PHONE_NO
Number
Not null
NAME
Varchar2
Not null
RELATIONSHIP
Varchar2
Not null
ADDRESS
Varchar2
Not null
EMERGENCY_PHONE_NO
Number
Not null
Data type
Size
Description
Comment
TRANS_NO
Varchar2
16
Primary Key
Transfer no
TRANS_DATE
Date
Not null
Transfer
date
TRANSFER_FROM
Varchar2
10
Not null
TRANS_TO
Varchar2
10
Not null
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
TRANS_QTY
Number
10
Not null
Transfer to
Transfer
quantity
TRANSFERRED_BY
Varchar2
20
Not null
RECEIPT_NO
Varchar2
16
Foreign Key
55
TRANSFER DETAIL
Data name
Data type
Size
Description
Comment
TRANS_NO
Varchar2
16
Foreign Key
Transfer no
TRANS_DATE
Date
16
Not null
TRANS_FROM
Varchar2
10
Not null
TRANS_TO
Varchar2
10
Not null
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
TRANSFERRED_BY
Varchar2
20
Not null
TRANSFER_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Not null
Product id
56
Process Logic
b. Accept password
c. If valid
Enter into specified module (main & sales
store)
Else
Try for three time and exit
d. End
57
3. Product module
a. Received product
b. Check product
c. Add all details about medicines
d. Verified stock
e. Update stock
4. Supplier module
a. Product order given to supplier.
58
5. Transfer module
a. Insert product code or name
b. Give the quantity to transfer
c. Give the code of a store to which product to be
transfer [s4 to s1] i.e. [main store to sales
store] or vice versa
d. Update both the stock
59
6. Transaction module
a. Customer will order
b. Generate invoice
c. Order confirmation
d. Product issue
e. Bill generate
f. Received payment
g. Product given to customer
Software
Front end tools: C#.net
RDBMS/Back end: Oracle 11g
60
Language/sub-languages: SQL
Operating System
Windows 98/ 7/8/8.1,XP,Vista
Hardware
Processor: Intel Pentium 4. 1.6 GHz
Memory: 256 MB RAM
Hard Disk: 40 GB
Language Specification
C# as front-end tool:
Introduction:
C# is a multi-paradigm, object-oriented programming
language encompassing strong typing, essential,
declarative, efficient, class-based and componentoriented programming disciplines.
C# is one of the programming languages designed for
the Common Language Infrastructure.
C# is a well-designed and type-safe that allows C
Sharp developers to build a wide array of secure and
robust applications that run on the .NET Framework.
61
Reasons of selection:
C# language is projected to be a simple, modern, generalpurpose, object-oriented programming language.
C# helps us to import a namespace and use the classes
in a componentno COM plumbing or registry lookups
required.
C# simplifies the syntax to be more constant and more
rational while also eliminating some of the more difficult
features of C++.
C# allows us to access memory directly using unsafe code
blocks
C# allows us to implement an interface in a base class
and re-implement the interface in the derived class and
provide a new definition for it C# permits nested classes
which are not allowed in C and C++
C# establishes better event management using delegates
and supports conditional compilation & cross-language
interoperability with any .NET language
C# is based on reflection mechanism which is biggest
advantage of C#.
62
Introduction:
Oracle is an RDBMS. It is the software
provided by a vendor such as Oracle Corporation
that manages a relational database. This supports
the user of declarative statements, which describe
the rules that the data must satisfy.
Reasons of selection:
RDBMS approach
It can manage structured data, nonstructural
data, relational, multidimensional and even objectoriented. The performance of oracle is the best.
Manageability in the distributed or centralized all
types of architecture is highly impressive. Lots of
functional enhancements make it an obvious choice.
The topmost quality of this product is its security
features.
63
client-server
technology
involves
64
provides
data
manipulation
facility
REFERENCES
While developing my project I have taken help from
persons and also consulted with books. The books lists
are as follows:
1. OReilly.C.Sharp.5.0.in a Nutshell 5th Edition
2.Tutorialpoints.com/CSharp,codeproject.com
MSDN.microsoft.com
3. Software Engineering Rajib Mall
4. SQL& PL/SQL for oracle 10g BLACK BOOK
(Wiley India)
65
66
Contents
Description
Page no
1. System Requirement and Study
54-60
System Analysis
Preliminary Investigation
Feasibility Study
2. Software Engineering Paradigm.
61-64
3. Environment & Tools.
65-68
Front End Tool
Back End Tool
O/S specification
Hardware
Tools Description
4. Design..
69-74
System Design
Data Flow Diagram
Detailed Design.
75-114
Use Case Diagram
Class diagram
67
Sequence Diagram
Event Diagram
Activity Diagram
Data Dictionary
Table Structure
5. Snapshots & Coding
115-261
6. Code Efficiency..
262
7. Validation Check
263-265
8. Testing..
266
9. Security mechanism.
267
10. Future Scope ..
268
11. Conclusion
269
12. Bibliograpghy..
270
System Analysis
68
must
be
spending
considerable
time
System Study
Existing System.
Proposed System.
Benefits of the proposed system.
69
70
Output Analysis
Identification of Need
71
Preliminary Investigation
When the request is made, the first system
activity
Preliminary
Investigation
begins.
Its
73
Feasibility Study
The feasibility study proposes one or more
conceptual solutions to the problem set for the
project. The conceptual solutions give an idea of what
the system will look like. They define what will be
done on computer and will remain manual. They also
indicate what input will be needed and what outputs
will be produced. These solutions must be proven
feasible and a preferred solution must be accepted.
Three things must be done to establish feasibility.
That three are:
Technical Feasibility
Economical Feasibility
Operational Feasibility
Technical Feasibility:
In technical feasibility I studied the number of technical
issues arises. They are:
74
Economical Feasibility:
There are number of financial issues arise. They are:
Is it financially feasible?
Can development be completed at a cost the clients
afford?
75
Operational Feasibility:
In operational feasibility there are also some
issues to solve. They are:
Does the organization have the resources needed
to succeed?
Will the system be used if it is developed?
Will
there
be
resistance
from
users
that
will
the
user
involved
in
the
planning
and
76
77
development
strategy
that
encompasses
the
as
process
model
or
software
so
suggested
many
by
software
expert
for
engineering
software
paradigm
development.
Waterfall model
Incremental model
78
79
System/informati
on engineering
Analysi
s
Increment
2
Increment
1
Cod
Tes
e
t
Desig
n
Analysi
s
Increment
3
Delivery of
1st
Increment
Desig
n
Cod
e
Analysi
s
Desig
n
Increment4
Analysi
s
Tes
t
Delivery of
2nd
Increment
Cod
e
Test
Desig
n
Cod
e
Delivery
of 3rd
Incremen
Test
Delivery of
4th
Increment
81
Incremental
Calender
Language Specification
C# as front-end tool:
Introduction:
C# is a multi-paradigm, object-oriented programming
language encompassing strong typing, essential,
82
Reasons of selection:
C# language is projected to be a simple, modern, generalpurpose, object-oriented programming language.
C# helps us to import a namespace and use the classes
in a componentno COM plumbing or registry lookups
required.
C# simplifies the syntax to be more constant and more
rational while also eliminating some of the more difficult
features of C++.
C# allows us to access memory directly using unsafe code
blocks
C# allows us to implement an interface in a base class
and re-implement the interface in the derived class and
provide a new definition for it C# permits nested classes
which are not allowed in C and C++
C# establishes better event management using delegates
and supports conditional compilation & cross-language
interoperability with any .NET language.
C# is based on reflection mechanism which is biggest
advantage of C#.
83
ORACLE
Introduction:
Oracle is an RDBMS. It is the software provided by
a vendor such as Oracle Corporation that manages a
relational
database.
This
supports
the
user
of
Reasons of selection:
1. RDBMS approach
It can manage structured data, nonstructural data,
relational, multidimensional and even object-oriented.
The performance of oracle is the best. Manageability in
the distributed or centralized all types of architecture is
84
also
interacts
with
the
database
by
85
provides
data
manipulation
facility
Supply
medicine
Status of
store
Supplier
Admin
Generat
e invoice
Order for
medicine
Transfe
r stock
Maintain
main
stock
86
Check
status
Collect
money
Order to
supplier
Pharmacy Management
System
(Kurji Holi Family
Hospital)
Maintain
sales stock
Status
of
Prescriptio
n
Bill
genera
te
Prescription
Generat
e bill
Payment
Paymen
t
Check
store
status
Received
medicin
e
Patient
Issue
medicin
e
Store Keeper
87
Order
medicin
1.0
Order
Generat
e
Admin
Supplier
Purchas
e details
Supply
medicin
e
Transfer
Prurchase
Admin
Check
status
Get updated
status of
stock
2.0
Main stock
Update
Transfer
details
Transfer &
update
3.0
Sales store
Store keeper
Receive
d
88
Updat
e
Generate
bill
Issue details
Received
Payment
Payment
Prescriptio
4.0
Patient
Admin
Details
of
medicin
1.1
Order to supply
medicine
89
Medicine
detail
Storekeepe
r
Bill receipt
of order
1.2
Generate
invoice
Updat
e
Invoice
detail
Received
invoice
Confirmation
90
Admin
Check
medicine
id & batch
Storekeepe
Storekeepe
r
r
Storekeepe
r
Medicine
Get
received
medicine
stock details
Payment table
Payment
received
2.1
Check main
store status
1.4
Received
medicine
Updat
e
Updat
e
Transfer table of
main store
Purchase
detail table
Transfer
Add
Quantity of
medicine
2.2
Transfer to
main store
91
STORE
Updat
e
Admin
Store
keeper
Admin
Check
medicine
Check
stock
2.3
Maintain3.1
stock
Sales store
Patient
Main stock
table
Get stock
details
Transfer
Get
medicine
stock details
Enter
2.4
Quantity of
Transfer
to sales
medicine to
store
transfer
Available
Store
keeper
Give
prescripti
on
Updat
e
Enter medicine
asked by
patient
Updat
e
Transfer
table of
sales store
3.2
Billing
92
Confirm
3.3
Payment
Patient
Bill
received
Updat
e
Payment
table
Do
payment
Issue
Store
keeper
Issue
medicin
3.4
Issue medicine
Updat
e
Cash salesl
table
Give
prescriptio
n
4.1
Storekeeper
Patient
Check store
status
Enter
medicine
details
4.2
Billing
Store
keeper
Confirmatio
n
94
Ptaient
Bill
received
4.3
Payment
Do
payment
Confirmation
4.4
Received
medicine
Patient
Medicine
1.
95
<< Admin
>>
2.
Issue medicine to patient
Issue medicine to
Inpatient
<< Store
keeper >>
Issue medicine to
department
<<
>>
Uses
<<
Extends
96
<<
Extends
Generate medicine id
<< Admin
>>
<<
Extends
<<
<<
Extends
<<
<< Admin
Scenari
>>
Extends
<<
>>
97
>>
<<
Extends
<<
Extends
<<v Admin
>>
Scenario 1.4
<<
Uses
<<
Extends
<<
<< Scenario
Admin
>>
Extends
98
>>
Provide medicine
information
<<
Uses
<<
Extends
<<
Extends
Transfer medicine
<< Admin
>>
<<
Extends
99
<<
Uses
<<
Extends
>>
Ask prescription
<<
Extends
Generate bill
<< Store
keeper >>
<<
Extends
Update stock
Scenario 2.2
(Return medicine to main store)
Add Product details
<<
Uses
<<
Extends
<<
<< Store
Scenario 2.3
Keeper >>
Extends
Update stock
100
>>
<<
Uses
<<
Extends
Ask prescription
<<
Extends
Generate bill
<< Store
keeper >>
<<
Extends
<<
Extends
Update stock
101
<<
Uses
<<
Extends
<<
Extends
<< Store
keeper >>
<<
Extends
Update stock
102
>>
Class Diagram
Admin maintains
mainstore
MainStore
User_iReceipt_no
d
P_id
Admin
Batch
User_id
Maintain
s
Total Qty
Pass
Trans_to_sales_stock()
Store
Create_user()
Add_new_supplier()
Add_supplier()
Add_item()
View_main_stock()
View_main_stock()
View_sales_stock()
1
103
Receipt_n
o.
Supplier
S_id
User_i
d
S_name
S_add Supplys
medicine
contact
to
Admin
User_id
Pass
store
Create_user()
Add_new_supplier()
View_main_stock()
View_sales_stock()
1
S_id
104
SaleStore
Receipt_no
Relation between Admin and
1
P_id
Receipt_
Supplier.
no
Batch
Total Qty
Return_to_main_stock()
Cash_sale()
Transfer_medic
View_sale_stock()
ine
Inpatient_issue()
Department_issue()
Inpatient_return()
MainStore
Receipt_no
Depertment_return()
Cash_sale_retuen()
P_id
Batch
Total Qty
Trans_to_sale_stock()
Add_supplier()
Add_item()
View_main_stock()
Receipt_n
o
105
Receipt_no
P_id
Batch
Maintain
s
Total Qty
Return_to_main_stock()
Cash_sale()
View_sale_stock()
Inpatient_issue()
Department_issue()
Inpatient_return()
Depertment_return()
Cash_sale_retuen()
StoreKeeper
User_id
password
store
View_sale_stock()
Cash_sale()
Department_issue()
Return_medicine()
106
Patient
opd_no
Patient_name
M
Father name
Gender
Age
Address
Maritalstatus
Nationality
Zip_no.
Receipt_
no
Pat_category
Emergency_ph
_no
occupation
Opd_n
o
Storekeeper maintains
salestore
Storekeeper
User_id
password
store
M
View_sale_stock()
Cash_sale()
Department_issue()
return
107
Issue
medicine
M
User_i
d
Storekeeper issued medicine
to patient
Department
Dep_id
Dep_name
User_i
d
Admits_patient()
Change()
Find()
108
Issue
medicine
Storekeeper
User_id
password
store
View_sale_stock()
Doc_i
Cash_sale()
d
Works
in
Department_issue()
Return_medicine()
Dep_i
d
Doctor
Doct_id
Dep_i
d
Doc_name
Dep_id
Add()
Change()
Find()
Storekeeper provides
medicine to different
departments.
Patient
Opd_n
o
opd_no
Patient_name
Father name
Gender
Age
Department
Dep_id
Dep_name
Address
Add()
Marital- status
Change()
Nationality
Find()
Zip_no.
Pat_category
Admits
in
Emergency_ph_no
occupation
Dep_i
d
110
SEQUENCE DIAGRAM
Scenario1. Add new product
Admin
Stock
Databas
Show
item_id
Ask for
Generate
item_id
Insert additional
information
Store information
in DB
111
Confirm inserted
item
Confirme
d
Admin
Databas
Show
supplier_id
Ask for
item_id
Generate
supplier_id
Insert additional
information
Store information in
Confirm inserted
112
Confirme
Admi
n
Main
Databas
Insert store
keepers
information
Show store
Insert additional
113
Store information in
DB
Confirm inserted
details
Confirme
Sales
Databas
Confirm updated
information
Confirme
d
Sales
Database
115
Update
transfered
information in
Confirm update
information
Confirme
StoreKeep
er
Sales store
Databas
Give Prescription
Display menu to
issue medicine
Insert
medicine
information
Insert patient
Check
med.
stock
Show
available
med. qty
116
Generate Bill
Do
payment
Confirm
Payment
Store issued
information in
DB
Confirm
Bill
Issue
medicine
Update
DB
Confirm
Update
Confirme
d
StoreKeep
er
Databa
Display menu to
issue medicine
Check
medicine
stock
Give patient
id
Sales store
Check med.
stock
Show
available
medicine
117
Insert
patient id
Enter medicine
qty
Generate
Bill
Confirmed
Bill
Store issued
information in
DB
Update
DB
Confirme
Confirm
Update
Issue
medicine
Departme
nt
StoreKeep
Ask for
Medicine
Give
department id
Sales store
Databa
Display menu
to issue
medicine
Insert
department id
118
Check med.
stock
Generate Transfer
no.
Issue
medicine
Show
available
medicine qty
Store issue
information in
DB
Update
DB
Confirme
d
Confirm
Update
Patien
t
StoreKeep
er
Give
Medicine
Sales store
Databas
Display menu
to return
Give bill
no.
Check
information
in DB 119
Show result
Ask
medicine to
return
Enter
medicine qty
Store
information in
Update
DB
Confirm
Update
Confirm
ed
Return
Money
Event diagram
Order
medicine,
do
Admin
Transfer
medicin
e
Update
store
Receive
d
medicin
Generate
invoice
Receive
d
paymen
Supplier
Show
main
store
120
Transfer
medicin
e
Update
store
Main store
Show
sales store
status
Return
medicin
Sales store
Show sales
store
Give
prescription
Patient
Pay
doctor
s fees
Treat
patien
t
Bill payment
Sales
Medicine
Update
Patient
Get
admit
Maintain
sales
store
Storekeep
er
Update
medicine
table
Give
medicine
Receive
Demand
medicin
Prescribed
medicine
Doctor
Works
Update
sales store,
Return
medicine
Received
Medicine
Allot
doctor,
Provide
Managed
patient,
Departm
ent
And workers
Activity diagram
User
121
Log in
If store
keeper
Sales store
If admin
Main stock
Update sales
stock
Sales medicine
If out
-patie
nt
Cash
sales
If inpatient
Credit sales
If
If transfer
purchase
medicine to sales
medicine
store
Update main
stock
End
Data Dictionary
122
Srno
Data Name
Data
Size
Data Type
Table Used
User_id
20
Varchar2
Cash_sale_master
Department_return_master
Sale return_master
P_id
Varchar2
Purchase_detail
Product, sles_stock Main_stock
Inpatient_issue_detail
Cash_sale_detail
Department_return_detail
Sale_return_detail, transfer_detail
Transfer_to_mainstock
Total_qty
10,3
Varchar2
Main_stock
Sales_stock
Bill_no
20
Varchar2
Cash_sale_master
Cash_sale_detail
Receipt_no
20
Varchar2
Purchase_detail
Purchase_master
Main_stock
Sales_stock
Inpatient_issue_detail
Batch
10
Varchar2
Purchase_detail
Main_stock, sale_stock
Inpatient_issue_detail
Cash_sale_detail
Department_return_detail
123
Transfer_to_main_stock Transfer_detail
124
Srno
Data Name
Data
Data Type
Table Used
Varchar2
Inpatient_issue_detail
Size
7
Issued_qty
10
Cash_sale_detail
8
Remarks
50
Varchar2
Department_issue_master
Inpatient_isuue_master
Cash_sale_master
Ip_no
20
Varchar2
Admission_detail
Inpatient_issue_master
Cash_sale_master
10
Opd_no
20
Varchar2
Admission_detail
Patient_detail
Cash_sale_master
11
Doc_id
10
Varchar2
Admission_detail
Cash_sale_master
12
IP_issue_no
16
Varchar2
Impatient_issue_detail
Impatient_issue_master
13
Total_amount
(10,3)
Number
Department issue
Master,Impatient_issue_master
Purchase_master
15
Roundoff_amoun
(10,3)
Number
15
Net_amount
(10,3)
Number
125
Purchase_master
16
status
Varchar2
Srno
Data Name
Data
Data Type
Table Used
Varchar2
Inpatient_issue_detail
Size
17
Amount
10,3
Cash_sale_detail
Department_issue_detail
18
Total_Amount
(10,3)
Number
Purchase_detail
Department_return_detail
Sale_return_detail
19
Trans_no.
16
Varchar2
Transfer_to_main_stock
Transfer_detail
20
Transfer_date
Date
Transfer_to_main_stock
Transfer_detail
21
Trans_from
Varchar2
Transfer_to_main_stock
Transfer_detail
22
Trans_to
Varchar2
Transfer_to_main_stock
Transfer_detail
23
Trans_by
20
Varchar2
Transfer_to_main_stock
Transfer_detail
126
24
Trans_qty
10
Varchar2
Transfer_to_main_stock
Transfer_detail
25
Dep_id
16
Varchar2
Department
Department_return_master
TABLE STRUCTURE
User (log_in)
Data
Data Type
Size
Description
Comment
Varchar2
20
Not Null
User/admi
Name
u_nm
n name
Pass
Varchar2
10
Store
Varchar2
Not Null
password
store
PRODUCT
Data Name
Data
Size
Type
P_ID
Number
Descriptio
Comment
n
5
Primary Key
Product id
127
P_NM
Varchar2
20
Not Null
Product
name
P_TYPE
Varchar2
20
Not Null
Product type
POWER
Varchar2
20
Not Null
Medicine
power
P_CLASS
Varchar2
20
Not Null
Product class
P_S_CLASS
Varchar2
20
Not Null
Product
sub
class
MFGBY
Varchar2
20
Not Null
Manufactured
by
Supplier (supplier)
Data
Data
Size
Description
Comment
Name
Type
S_ID
Number
Primary Key
Supplier id
S_NAME
Varchar2
20
Not Null
Supplier
name
S_ADD
Varchar2
70
Not Null
Supplier
address
CONTACT
Number
20
Not Null
Contact no.
S_EMAIL
Varchar2
30
Not Null
Email id
CST_NO
Varchar2
20
Not Null
Central
sales-tax
no.
VAT_NO
Varchar2
20
Not Null
Value
added-tax
128
no.
Data Type
Size
Description
Description
Receipt_no.
Varchar2
16
Foreign Key
Receipt no.
P_id
Number
Not null
Product id
Batch
Varchar2
10
Not null
Product name
MFG
Date
Not null
Manufacture
date
REC_QTY
Number
(10,3)
Not null
Received qty
FREE_QTY
Number
(10,3)
Not null
Free quantity
CONV_FACT
Number
(10,3)
Not null
Conversion
factor
TOTAL_QTY
Number
(10,3)
Not null
Total qty
MRP_UNIT
Number
(10,3)
Not null
TAX
Number
Not null
Tax
PACKCOST_PACK
Number
(10,3)
Not null
PACKMRP_PACK
Number
(10,3)
Not null
TOTAL_PACKCOST
Number
(10,3)
Not null
TOTAL_PACKMRP
Number
(10,3)
Not null
VAT
Number
Not null
COSTPRICE_PACK
Number
(10,3)
Not null
COSTPRICE_UNIT
Number
(10,3)
Not null
ACTUAL_MRP_UNIT
Number
(10,3)
Not null
129
TOTALCOST_PRICE
Number
(10,3)
Not null
Data Type
Size
Description
RECEIPT_NO.
Varchar2
16
Primary Key
RECEIPT_DATE
Date
Not null
INVOICE_N0
Varchar2
16
Not null
S_ID
Varchar2
Not null
CREATED_BY
Varchar2
20
Not null
CREATED_ON
Date
Not null
VERIFIED_BY
Varchar2
20
Not null
VERIFIED_ON
Date
Not null
REMARKS
Varchar2
50
Not null
VAT_AMT
Number
(5,3)
Not null
Comment
Supplier id
Value added
tax amount
TOTAL_AMT
Number
10
STATUS
Varchar2
130
Mainstock (main_stock)
Date name
Data type
Size
Description
Comment
RECEIPT_NO
Varchar2
16
Foreign key
Receipt no.
P_ID
Varchar2
Not null
Product id
BATCH
Varchar2
10
Not null
Batch
TOTAL_QTY
Number
10
Not null
Salestock
Data Name
Data Type
Size
Description
RECEIPT_NO
Varchar2
16
Foreign key
P_ID
Varchar2
Not null
BATCH
Varchar2
10
Not null
TOTAL_QTY
Number
10
Not null
Comment
Product id
Inpatient_issue_detail
Date name
Data type
Size
Description
Comment
131
IP_ISSUE_NO
Varchar2
16
Foreign key
Inpatient
issue no.
P_ID
Number
Foreign key
BATCH
Varchar2
10
Not null
10
Not null
QTY_ISSUED Number
AMOUNT
Number
(10,3)
Not null
RECEIPT_NO
Varchar2
16
Not null
Product id
Inpatient_issue_master
Date name
Data type
Size
Description
Comment
IP_ISSUE_NO
Varchar2
16
Primary Key
Inpatient
issue no.
ISSUE_DATE
Date
Not null
IP_NO
Number
16
Foreign key
Inpatient
no.
PRESCRIBED_BY
Varchar2
20
Not null
REMARKS
Varchar2
50
Not null
ISSUED_BY
Varchar2
20
Not null
TOTAL_AMOUNT
Number
(10,2)
Not null
132
ROUNDOFF_AMOUN
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
Department_issue_detail
Date name
Data type
Size
Description
Comment
DP_ISSUE NO
Varchar2
20
Foreign Key
Department
issue no.
P_ID
Number
20
Not null
BATCH
Varchar2
20
Not null
QTY_ISSUED
Number
20
Not null
AMOUNT
Number
RECEIPT_NO
Varchar2
Product id
Not null
20
Not null
Department_issue_master
Date name
Data type
Size
Description
Comment
DP_ISSUE NO
Varchar2
16
Primary Key
Department
133
issue no.
DEP_ID
Varchar2
Not null
Department
id
ISSUE_DATE
Date
Not null
REMARKS
Varchar2
50
Not null
ISSUED_BY
Varchar2
20
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUN
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
Data type
Size
Description
BILL_NO
Varchar2
16
foreign Key
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
ISSUED_QTY
Number
10
Not null
AMOUNT
Number
(10,3)
Not null
RECEIPT_NO
Varchar2
16
Not null
Comment
Product id
134
Department
Date name
Data type
Size
Description
Comment
DEP_ID
Varchar2
16
Primary Key
Department
id
DEP_NAME
Varchar2
20
Not null
Department
name
Data type
Size
Description
BILL_NO
Varchar2
16
Primary Key
OPD_NO
Varchar2
16
Not null
Comment
Outpatient
department
no.
IP_NO
Varchar2
16
Not null
Inpatient no
DOC_ID
Varchar2
10
Not null
Doctor id
USER_ID
Varchar2
10
Not null
BILL_DATE
Date
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUNT
Number
Not null
NET_AMOUNT
Number
10
Not null
STATUS
Varchar2
Not null
REMARKS
Varchar2
50
Not null
135
Admission detail
Data name
Data type
Size
Description
OPD_NO
Varchar2
16
Primary Key
IP_NO
Varchar2
16
Not null
ADDMISSION_DATE
Date
Not null
PREVIOUS_IP_NO
Varchar2
16
Not null
DOC_ID
Varchar2
16
Not null
PATIENT_TYPE
Varchar2
10
Not null
SERVICE
Varchar2
10
Not null
WARD_NO
Varchar2
10
Not null
BED
Varchar2
10
Not null
CATEGORY
Varchar2
10
Not null
Comment
Doctor id
Data type
Size
Description
Comment
136
DP_RETURN_NO
Varchar2
16
Foreign Key
Department
return no.
P_ID
Number
Foregn key
BATCH
Varchar2
Not null
RETURN_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
Data type
Size
Description
DP_RETURN_NO
Varchar2
16
Primary Key
DP_RETURN_DATE
Date
Not null
DEP_ID
Number
16
Not null
REMARKS
Varchar2
50
Not null
TOTAL_AMOUNT
Number
(10,3)
Not null
ROUNDOFF_AMOUNT
Number
Not null
NET_AMOUNT
Number
10
Not null
USER_ID
Varchar2
20
Not null
Comment
Department id
137
Data type
Size
Description
RETURN_NO
Varchar2
16
Primary Key
RETURN_DATE
Number
16
Not null
REMARKS
Date
Not null
TOTAL_AMOUNT
Varchar2
16
Not null
ROUNDOFF_AMOUNT
Varchar2
16
Not null
NET_AMOUNT
Varchar2
10
Not null
USER_ID
Not null
IP_NO
Foreign Key
OPD_NO
Foreign Key
Comment
Data type
Size
Description
RETURN_NO
Varchar2
16
Foreign Key
P_ID
Number
Foreign Key
BATCH
Varchar2
10
Not null
RETURN_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Foreign Key
TOTAL_AMOUNT
Number
(10,3)
Not null
Comment
138
Patient detail
Date name
Data type
Size
Description
OPD_NO
Varchar2
16
Primary Key
PAT_NAME
Varchar2
16
Not null
FATHERS_NAME
Varchar2
Not null
SEX
Varchar2
10
Not null
AGE
Number
16
Not null
VILLAGE
Varchar2
10
Not null
HOUSE
Varchar2
10
Not null
PS
Varchar2
10
Not null
DISTRICT
Varchar2
10
Not null
PO
Varchar2
Not null
OCCUPATION
Varchar2
10
Not null
MARITAL_STATUS
Varchar2
Not null
REGION
Varchar2
Not null
NATIONALITY
Varchar2
Not null
PAT_CATEGORY
Varchar2
Not null
ZIP_NO
Varchar2
Not null
PHONE_NO
Number
Not null
NAME
Varchar2
Not null
RELATIONSHIP
Varchar2
Not null
ADDRESS
Varchar2
Not null
EMERGENCY_PHONE_NO
Number
Not null
Comment
Patient name
postal
Post office
139
Data type
Size
Description
Comment
TRANS_NO
Varchar2
16
Primary Key
Transfer no
TRANS_DATE
Date
Not null
Transfer
date
TRANSFER_FROM
Varchar2
10
Not null
TRANS_TO
Varchar2
10
Not null
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
TRANS_QTY
Number
10
Not null
Transfer to
Transfer
quantity
TRANSFERRED_BY
Varchar2
20
Not null
RECEIPT_NO
Varchar2
16
Foreign Key
TRANSFER DETAIL
140
Data name
Data type
Size
Description
Comment
TRANS_NO
Varchar2
16
Foreign Key
Transfer no
TRANS_DATE
Date
16
Not null
TRANS_FROM
Varchar2
10
Not null
TRANS_TO
Varchar2
10
Not null
P_ID
Number
Not null
BATCH
Varchar2
10
Not null
TRANSFERRED_BY
Varchar2
20
Not null
TRANSFER_QTY
Number
10
Not null
RECEIPT_NO
Varchar2
16
Not null
Product id
141
SNAPSHOTS
AND
CODING
142
CLASS FILE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;
namespace KURJI
{
class database
{
OleDbConnection conn;
OleDbCommand cmd;
OleDbDataAdapter da;
public database()
{
conn = new OleDbConnection("Provider =MSDAORA.1;User ID =system;
Password=system;database=orcl");
143
conn.Open();
}
public DataSet getDataTable(string strOrcl)
{
cmd = new OleDbCommand();
DataSet dt = new DataSet();
cmd.CommandType = CommandType.Text;
cmd.CommandText = strOrcl;
cmd.Connection = conn;
da = new OleDbDataAdapter();
da.SelectCommand = cmd;
da.Fill(dt);
da.Dispose();
return dt;
}
public void ExecuteOrcl(string OrclStr)
{
try
{
cmd = new OleDbCommand(OrclStr, conn );
cmd.ExecuteNonQuery();
}
catch
{
MessageBox.Show("transaction not complited please try again");
144
}
}
}
}
LOGIN FORM
145
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
146
using System.Windows.Forms;
using System.Data.OleDb;
using User;
namespace KURJI
{
public Login()
{
InitializeComponent();
}
private void Log_In_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.A && e.Shift)
{
log();
}
}
147
148
149
else
{
MessageBox.Show("incorrect store ");
btnadmin.Enabled = false;
}
}
else if ((txtpass.Text == ds.Tables[0].Rows[0][1].ToString()) &&
(cmbstore.Text == ds.Tables[0].Rows[0][2].ToString()) && (ds.Tables[0].Rows[0]
[2].ToString() == "S1"))
{
MessageBox.Show("Welcome To The Pharmacy");
Pharmacy a = new Pharmacy();
a.ShowDialog(this);
btnadmin.Enabled = false;
}
else if ((txtpass.Text == ds.Tables[0].Rows[0][1].ToString()) &&
(cmbstore.Text == ds.Tables[0].Rows[0][2].ToString()) && (ds.Tables[0].Rows[0]
[2].ToString() == "S4"))
{
MessageBox.Show("Welcome To The Mainstore..");
Main_Store a = new Main_Store();
a.ShowDialog(this);
btnadmin.Enabled = false;
}
else
{
150
}
else
{
}
}
private void Login_Load(object sender, EventArgs e)
{
txtunm.Text = "nitesh";
txtpass.Text = "n";
cmbstore.Items.Add("S1");
cmbstore.Items.Add("S4");
cmbstore.Text = "S1";
}
151
152
}
set
{
userid= value;
}
153
154
using System;
using System.Collections.Generic;
155
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using User;
using System.Text.RegularExpressions;
namespace KURJI
{
public partial class Material_Receipts_New : Form
{
156
TxtMCode.Text = "";
m_name.Text = "";
b_no.Text = "";
mfg.Text = "";
exp.Text = "";
r_qty.Text = "";
f_qty.Text = "";
157
c_factor.Text = "";
t_qty.Text = "";
mrp_p.Text = "";
tax.Text = "";
pack_c_p.Text = "";
p_mrp_p.Text = ""; t_p_c.Text = "";
t_p_m.Text = ""; c_p_u.Text = ""; a_m_u.Text = ""; c_p_p.Text = "";
TxtTAmount.Text = ""; vatamt.Text = "";
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
TxtTAmount.Text = "";
q=q+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["t_amt"].Value));
TxtVatAmount.Text = "";
p=p+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["_v_amt"].Value));
TxtTAmount.Text = Convert.ToString(q);
q = 0;
TxtVatAmount.Text = Convert.ToString(p);
p = 0;
158
t= 0;
string content = TxtTAmount.Text;
TxtNetAmount.Text = Math.Round(double.Parse(TxtTAmount.Text),
0).ToString();
ChangeBtn.Enabled = false;
DeleteBtn.Enabled = true;
RecordBtn.Enabled = true;
addbtn.Enabled = false;
}
}
public void insert_purchase()
{
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
CancelBtn.Enabled = true;
159
db.ExecuteOrcl(sql);
}
160
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
TxtInvoice.Text + " has been succesfully added as New Purchase");
RecordBtn.Enabled = false;
}
else
{
ds = new DataSet();
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
161
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
if (int.Parse(mn) > 3)
{
162
insert_purchase();
}
else
{
insert_purchase();
}
}
else
{
163
else
{
TxtNumber.Text = "PHMR1415000001";
insert_purchase();
}
}
}
private void c_factor_Leave(object sender, EventArgs e)
{
if(c_factor.Text!="")
{
if (int.Parse(c_factor.Text) != 0)
{
if (r_qty.Text != "" && c_factor.Text != "" && f_qty.Text != "")
{
r = (Convert.ToDecimal(r_qty.Text)) +
(Convert.ToDecimal(f_qty.Text));
r = r * (Convert.ToDecimal(c_factor.Text));
t_qty.Text = (Convert.ToString(r));
}
else
{
MessageBox.Show("Please Enter Full Detail");
c_factor.Focus();
}
164
}
else
{
MessageBox.Show("Cannot Enter 0");
c_factor.Text = "";
}
}
else{
MessageBox .Show("Please Enter The Conversion Factor");
}
}
private void s_name_TextChanged(object sender, EventArgs e)
{
dataGridView2.Visible = true;
groupBox3.Visible = true;
string str = "%" + s_name.Text + "%";
sql = "select s_id,s_name from supplier where (s_name like '" + str + "' or
s_id like '" + str + "')";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView2.DataSource = ds.Tables [0];
dataGridView2.DataMember = "";
165
dataGridView2.Columns["s_id"].HeaderCell.Value = "ID";
dataGridView2.Columns["s_name"].HeaderCell.Value = "NAME";
}
r = (Convert.ToDecimal(p_mrp_p.Text)) * ((Convert.ToDecimal(tax.Text)
/ 100));
rs = (Convert.ToDecimal(r)) + (Convert.ToDecimal(pack_c_p.Text));
c_p_p.Text = (Convert.ToString(rs));
166
rs = (Convert.ToDecimal(c_p_p.Text)) /
(Convert.ToDecimal(c_factor.Text));
c_p_u.Text = (Convert.ToString(rs));
r = (Convert.ToDecimal(t_p_m.Text)) * ((Convert.ToDecimal(tax.Text) /
100));
vatamt.Text = (Convert.ToString(r));
rs = (Convert.ToDecimal(r)) + (Convert.ToDecimal(t_p_c.Text));
txttotal.Text = (Convert.ToString(rs));
}
else
{
MessageBox.Show("Enter Full Detail");
}
this.Refresh();
TxtSupplier.Text = "";
s_name.Text = "";
TxtNetAmount.Text = "";
167
TxtTAmount.Text = "";
TxtUserId.Text = "";
TxtNumber.Text = "";
TxtVatAmount.Text = "";
TxtInvoice.Text = "";
TxtRemarks.Text = "";
created_on.Text = "";
TxtRoundOff.Text = "";
TxtMCode.Text = "";
m_name.Text = "";
b_no.Text = "";
mfg.Text = "";
exp.Text = "";
r_qty.Text = "";
f_qty.Text = "";
c_factor.Text = "";
t_qty.Text = "";
mrp_p.Text = "";
tax.Text = "";
pack_c_p.Text = "";
p_mrp_p.Text = ""; t_p_c.Text = "";
t_p_m.Text = ""; c_p_u.Text = ""; txttotal.Text = ""; a_m_u.Text = "";
c_p_p.Text = ""; TxtTAmount.Text = ""; vatamt.Text = "";
168
DataGridView1.Rows.Clear();
dataGridView2.Visible = false;
groupBox3.Visible = false;
dataGridView3.Visible = false;
groupBox4.Visible = false;
}
169
{
ChangeBtn.Enabled = true;
TxtMCode.Text =
DataGridView1.SelectedRows[0].Cells["m_code"].Value.ToString();
m_name.Text =
DataGridView1.SelectedRows[0].Cells["nm"].Value.ToString();
b_no.Text =
DataGridView1.SelectedRows[0].Cells["Batch"].Value.ToString();
mfg.Text =
DataGridView1.SelectedRows[0].Cells["_mfg"].Value.ToString();
exp.Text = DataGridView1.SelectedRows[0].Cells["_exp"].Value.ToString();
r_qty.Text =
DataGridView1.SelectedRows[0].Cells["_r_qty"].Value.ToString();
f_qty.Text =
DataGridView1.SelectedRows[0].Cells["_f_qty"].Value.ToString();
c_factor.Text =
DataGridView1.SelectedRows[0].Cells["c_f"].Value.ToString();
t_qty.Text =
DataGridView1.SelectedRows[0].Cells["_t_qty"].Value.ToString();
mrp_p.Text =
DataGridView1.SelectedRows[0].Cells["_mrp_p"].Value.ToString();
tax.Text = DataGridView1.SelectedRows[0].Cells["tx"].Value.ToString();
pack_c_p.Text =
DataGridView1.SelectedRows[0].Cells["p_cost_p"].Value.ToString();
p_mrp_p.Text =
DataGridView1.SelectedRows[0].Cells["p_mr_p"].Value.ToString();
t_p_c.Text =
DataGridView1.SelectedRows[0].Cells["t_p_cost"].Value.ToString();
t_p_m.Text =
DataGridView1.SelectedRows[0].Cells["t_p_mrp"].Value.ToString();
170
vatamt.Text =
DataGridView1.SelectedRows[0].Cells["_v_amt"].Value.ToString();
c_p_p.Text =
DataGridView1.SelectedRows[0].Cells["_c_p_p"].Value.ToString();
c_p_u.Text =
DataGridView1.SelectedRows[0].Cells["_p_u"].Value.ToString();
a_m_u.Text =
DataGridView1.SelectedRows[0].Cells["A_mrp_u"].Value.ToString();
txttotal.Text =
DataGridView1.SelectedRows[0].Cells["_dis"].Value.ToString();
TxtTAmount.Text =
DataGridView1.SelectedRows[0].Cells["t_amt"].Value.ToString();
rs = (Convert.ToDecimal(r_qty.Text)) *
(Convert.ToDecimal(p_mrp_p.Text));
t_p_m.Text = (Convert.ToString(rs));
rs = (Convert.ToDecimal(r_qty.Text)) *
(Convert.ToDecimal(pack_c_p.Text));
t_p_c.Text = (Convert.ToString(rs));
171
r = (Convert.ToDecimal(p_mrp_p.Text)) * ((Convert.ToDecimal(tax.Text) /
100));
rs = (Convert.ToDecimal(r)) + (Convert.ToDecimal(pack_c_p.Text));
c_p_p.Text = (Convert.ToString(rs));
rs = (Convert.ToDecimal(c_p_p.Text)) /
(Convert.ToDecimal(c_factor.Text));
c_p_u.Text = (Convert.ToString(rs));
r = (Convert.ToDecimal(t_p_m.Text)) * ((Convert.ToDecimal(tax.Text) /
100));
vatamt.Text = (Convert.ToString(r));
rs = (Convert.ToDecimal(r)) + (Convert.ToDecimal(t_p_c.Text));
TxtTAmount.Text = (Convert.ToString(rs));
DataGridView1.Rows.Add(TxtMCode.Text, m_name.Text, b_no.Text,
mfg.Text, exp.Text, int.Parse(r_qty.Text), int.Parse(f_qty.Text),
int.Parse(c_factor.Text), int.Parse(t_qty.Text), decimal.Parse(mrp_p.Text),
decimal.Parse(tax.Text), decimal.Parse(pack_c_p.Text),
decimal.Parse(p_mrp_p.Text), decimal.Parse(t_p_c.Text),
decimal.Parse(t_p_m.Text), decimal.Parse(vatamt.Text),
decimal.Parse(c_p_p.Text), decimal.Parse(c_p_u.Text),
decimal.Parse(a_m_u.Text), decimal.Parse(txttotal.Text),
decimal.Parse(TxtTAmount.Text));
ChangeBtn.Enabled = false;
for (int i = 0; i < DataGridView1.Rows.Count - 1; i++)
{
TxtTAmount.Text = "";
q=q+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["t_amt"].Value));
172
TxtVatAmount.Text = "";
p=p+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["_v_amt"].Value));
t=t+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["_dis"].Value));
}
TxtTAmount.Text = Convert.ToString(q);
q = 0;
TxtVatAmount.Text = Convert.ToString(p);
p = 0;
t = 0;
TxtNetAmount.Text = Math.Round(double.Parse(TxtTAmount.Text),
0).ToString();
TxtMCode.Text = "";
m_name.Text = "";
b_no.Text = "";
mfg.Text = "";
exp.Text = "";
r_qty.Text = "";
173
f_qty.Text = "";
c_factor.Text = "";
t_qty.Text = "";
mrp_p.Text = "";
tax.Text = "";
pack_c_p.Text = "";
p_mrp_p.Text = ""; t_p_c.Text = "";
t_p_m.Text = ""; c_p_u.Text = ""; txttotal.Text = ""; a_m_u.Text = "";
c_p_p.Text = ""; vatamt.Text = "";
dataGridView3.Visible = true;
groupBox4.Visible = true;
string str = "%" + m_name.Text + "%";
sql = "select p_id,p_nm,p_type,power from product where (p_nm like '" +
str + "' or p_id like '" + str + "')";
ds = new DataSet();
ds = db.getDataTable(sql );
dataGridView3.DataSource = ds.Tables[0] ;
dataGridView3.DataMember = "";
dataGridView3.Columns["p_id"].HeaderCell.Value = "ID";
dataGridView3.Columns["p_nm"].HeaderCell.Value = "NAME";
174
dataGridView3.Columns["p_type"].HeaderCell.Value = "TYPE";
dataGridView3.Columns["power"].HeaderCell.Value = "POWER";
}
private void c_factor_TextChanged(object sender, EventArgs e)
{
if (Regex.IsMatch(c_factor.Text, "[^0-9]"))
{
MessageBox.Show("please enter a number");
c_factor.Text = "";
}
}
}
}
175
if (Regex.IsMatch(f_qty.Text, "[^0-9]"))
{
MessageBox.Show("Please Enter a Number");
f_qty.Text = "";
}
}
}
}
else
{
MessageBox.Show("Please Enter the received quantity");
r_qty.Focus();
}
176
dataGridView3.Visible = false;
groupBox4.Visible = false;
}
catch
{
MessageBox.Show("Invalid Product Name");
}
}
177
dataGridView2.Visible = false;
groupBox3.Visible = false;
}
catch
{
MessageBox.Show("Invalid Supplier Name");
}
}
178
179
180
{
if (f_qty.Text == "")
{
181
182
183
namespace KURJI
{
public partial class Material_Receipts_Lists : Form
{
184
string str1;
decimal q;
string sql;
database db = new database();
DataSet ds;
public Material_Receipts_Lists()
{
InitializeComponent();
}
MessageBox.Show((UserAccess.C_Receipt).ToString());
185
string status =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["status"].Value.ToStrin
g();
if (status == "D")
{
MessageBox.Show("Cannot Verify Deleted Item");
}
else
{
Material_Receipts_Verify m = new Material_Receipts_Verify(str1);
m.Show();
}
}
else
{
MessageBox.Show("");
}
}
public void delete()
{
if (DataGridView1.Rows.Count > 0)
{
int i;
i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
186
str1 =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["receipt_no"].Value.ToS
tring();
UserAccess.C_Receipt =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["status"].Value.ToStrin
g();
MessageBox.Show((UserAccess.C_Receipt).ToString());
string status =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["status"].Value.ToStrin
g();
if (status == "V")
{
MessageBox.Show("Cannot Verify,The Record Is Already Verified");
}
else if (status == "D")
{
MessageBox.Show("Cannot Delete,The Record Is Already Deleted");
}
else
{
sql = "update purchase_master set status='D' where receipt_no='" +
DataGridView1.Rows[i].Cells[0].Value + "'";
db.ExecuteOrcl(sql);
DataGridView1.Rows[i].Cells[4].Value = "D";
}
187
}
else
{
MessageBox.Show("No Data Found,Can't Be Deleted");
}
}
public void show_receipt_list()
{
sql = "select
purchase_master.receipt_no,purchase_master.receipt_date,supplier.s_name,purc
hase_master.total_amt,purchase_master.status from purchase_master inner join
supplier on supplier.s_id=purchase_master.s_id where
purchase_master.receipt_date between'" + dateTimePicker1.Text + "' and '" +
dateTimePicker2.Text + "'order by purchase_master.receipt_no";
ds = new DataSet();
ds = db.getDataTable(sql);
DataGridView1.DataSource = ds.Tables[0];
DataGridView1.DataMember = "";
int t = ds.Tables[0].Rows.Count;
if (t > 0)
{
DataGridView1.Columns["receipt_no"].HeaderCell.Value = "Receipt
Number";
DataGridView1.Columns["receipt_no"].Width = 125;
DataGridView1.Columns["receipt_date"].HeaderCell.Value = "Receipt
Date";
188
DataGridView1.Columns["s_name"].HeaderCell.Value = "Supplier
Name";
DataGridView1.Columns["total_amt"].HeaderCell.Value = "Total
Amount";
DataGridView1.Columns["status"].HeaderCell.Value = "Status";
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
TxtTotalAmt.Text = "";
q=q+
(Convert.ToDecimal(DataGridView1.Rows[i].Cells["total_amt"].Value));
}
TxtTotalAmt.Text = Convert.ToString(q);
q = 0;
Deletebtn.Enabled = true;
}
else
{
MessageBox.Show("No Data Found ");
}
}
show_receipt_list();
}
189
if (DataGridView1.Rows.Count > 0)
{
int i;
i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
str1 =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["receipt_no"].Value.ToS
tring();
190
}
}
191
192
namespace KURJI
{
public partial class Transfer_Sales_Stock : Form
{
database db = new database();
DataSet ds;
193
string sql;
string rec;
public Transfer_Sales_Stock()
{
InitializeComponent();
txttransferedby.Text = (UserAccess.C_User).ToString();
}
194
sql = "update main_stock set total_qty= " + stkqty + " where p_id=
" + mainstkp_id + " and batch= '" + mainbatch + "'";
db.ExecuteOrcl(sql);
MessageBox.Show(b_no.Text.Length.ToString());
sql = "select p_id,batch,total_qty from sales_stock";
ds = new DataSet();
ds = db.getDataTable(sql);
195
int b;
int sstrow = ds.Tables[0].Rows.Count;
int d = 0;
if (sstrow > 0)
{
for (b = 0; b < sstrow; b++)
{
Int32 ssp = Convert.ToInt32(ds.Tables[0].Rows[b]["p_id"]);
string ssbatch = ds.Tables[0].Rows[b]
["batch"].ToString().Trim();
Int32 ssqty = Convert.ToInt32(ds.Tables[0].Rows[b]
["total_qty"]);
if ((mainstkp_id == ssp) && (mainbatch == ssbatch))
{
MessageBox.Show(" hhhhhsss");
d = 1;
ssqty = ssqty + trsqty;
sql = "update sales_stock set receipt_no='" + rec + "',
total_qty= " + ssqty + " where p_id= " + ssp + " and batch= '" + ssbatch + "' ";
db.ExecuteOrcl(sql);
}
196
}
if (d == 0)
{
MessageBox.Show("hello");
db.ExecuteOrcl(sql);
}
}
if (sstrow == 0)
{
MessageBox.Show("hiii");
sql = "insert into sales_stock values('" + rec + "', " + mainstkp_id
+ ", '" + mainbatch + "', " + trsqty + ")";
db.ExecuteOrcl(sql);
}
ds = new DataSet();
ds = db.getDataTable(sql);
197
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
198
db.ExecuteOrcl(sql);
}
else
{
TxtNumber.Text = "TMTS1400000001";
sql = "insert into Transfer_Detail values('" + TxtNumber.Text +
"','" + transferdate.Text + "','" + TxtStore.Text + "','" + txtsalestore.Text + "'," +
int.Parse(txtcode.Text) + ",'" + b_no.Text + "','" + txttransferedby.Text + "'," +
int.Parse(tqty.Text) + ", '" + rec + "' )";
db.ExecuteOrcl(sql);
}
}
else
{
MessageBox.Show(" can't transfer this much Qty");
}
tqty.Text = "";
ttcp.Text = "";
}
else
{
MessageBox.Show("please Enter your detail");
199
}
}
private void RecordBtn_Click(object sender, EventArgs e)
{
record();
}
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
int i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
string str1 = (dataGridView1.Rows[i].Cells[1].Value).ToString();
MessageBox.Show(str1);
}
200
else
{
MessageBox.Show("please enter Qty");
}
}
else
{
MessageBox.Show("Cannot Transfer");
}
}
private void tqty_Leave(object sender, EventArgs e)
{
cal_amount();
}
private void cmdaccept_Click(object sender, EventArgs e)
{
try
{
if (dataGridView1.Rows.Count > 1)
{
int i = 0;
i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
201
txtprod_search.Text =
dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
txttype.Text =
dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
txtcode.Text =
dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
b_no.Text =
dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
txtstockqty.Text =
dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
mrppunit.Text =
dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
a_m_u.Text =
dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
mfg.Text =
dataGridView1.SelectedRows[0].Cells[7].Value.ToString();
exp.Text =
dataGridView1.SelectedRows[0].Cells[8].Value.ToString();
cppunit.Text =
dataGridView1.SelectedRows[0].Cells[9].Value.ToString();
tcp.Text =
dataGridView1.SelectedRows[0].Cells[10].Value.ToString();
rec = dataGridView1.SelectedRows[0].Cells[11].Value.ToString();
groupBox3.Visible = false;
}
else
{
MessageBox.Show("cannot select ");
202
}
}
catch
{
MessageBox.Show("Select any Row");
}
}
sql = "select
product.p_nm,product.p_type,main_stock.p_id,main_stock.batch,main_stock.tot
al_qty,purchase_detail.mrp_unit,purchase_detail.actual_mrp_unit,purchase_det
ail.mfg,purchase_detail.exp,purchase_detail.costprice_unit,
(purchase_detail.costprice_unit*main_stock.total_qty)totalcostprice,main_stock.r
eceipt_no from product,main_stock,purchase_detail where
product.p_id=main_stock.p_id and main_stock.p_id=purchase_detail.p_id and
purchase_detail.batch=main_stock.batch and
purchase_detail.receipt_no=main_stock.receipt_no and product.p_nm like ('" +
str + "')order by product.p_nm";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView1.Visible = true;
203
groupBox3.Visible = true;
dataGridView1.DataSource = ds.Tables[0];
}
private void tqty_TextChanged(object sender, EventArgs e)
{
if (System.Text.RegularExpressions .Regex.IsMatch(tqty.Text, "[^0-9]"))
{
MessageBox.Show("Please enter a number");
tqty.Text = "";
}
}
204
}
private void btncancel_Click(object sender, EventArgs e)
{
txttype.Text = "";
b_no.Text = "";
txtstockqty.Text = "";
cppunit.Text = "";
tcp.Text = "";
a_m_u.Text = "";
mrppunit.Text = "";
mfg.Text = "";
exp.Text = "";
dataGridView1.Visible = false;
groupBox3.Visible = false;
}
205
}
}
206
207
namespace KURJI
{
public partial class Transfer_To_Sales_Stock_List : Form
{
database db=new database();
DataSet ds;
string sql;
public Transfer_To_Sales_Stock_List()
{
InitializeComponent();
}
208
ds = db.getDataTable(sql);
int c = ds.Tables[0].Rows.Count;
if (c > 0)
{
int j = ds.Tables[0].Rows.Count - 1;
txtfrom.Text = ds.Tables[0].Rows[0]["trans_no"].ToString().Trim();
txtto.Text = ds.Tables[0].Rows[j]["trans_no"].ToString().Trim();
dataGridView2.DataSource = ds.Tables[0];
decimal q = 0;
for (int i = 0; i < dataGridView2.Rows.Count - 1; i++)
{
TxtTotalAmt.Text = "";
q=q+
(Convert.ToDecimal(dataGridView2.Rows[i].Cells["total_costprice"].Value));
}
209
TxtTotalAmt.Text = q.ToString();
}
else
{
MessageBox.Show("no data found");
}
}
private void Showbtn_Click(object sender, EventArgs e)
{
show_list();
}
210
k.Show();
}
}
}
Main Stock
211
212
namespace KURJI
{
public partial class View_Main_Stock : Form
{
database db=new database();
DataSet ds;
string sql;
public View_Main_Stock()
{
InitializeComponent();
}
public void prod_search()
{
213
sql = "select
product.p_nm,product.p_type,main_stock.p_id,main_stock.batch,main_stock.tot
al_qty,purchase_detail.mrp_unit,purchase_detail.actual_mrp_unit,purchase_det
ail.mfg,purchase_detail.exp,purchase_detail.costprice_unit,
(purchase_detail.costprice_unit*main_stock.total_qty)totalcostprice from
product,main_stock,purchase_detail where product.p_id=main_stock.p_id and
main_stock.p_id=purchase_detail.p_id and
purchase_detail.batch=main_stock.batch and
purchase_detail.receipt_no=main_stock.receipt_no and product.p_nm like ('" +
str + "')";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView1.Visible = true;
dataGridView1.DataSource = ds.Tables[0];
214
215
txttype.Text =
dataGridView1.SelectedRows[0].Cells["p_type"].Value.ToString();
cppunit.Text =
dataGridView1.SelectedRows[0].Cells["costprice_unit"].Value.ToString();
tcp.Text =
dataGridView1.SelectedRows[0].Cells["totalcostprice"].Value.ToString();
txtstockqty.Text =
dataGridView1.SelectedRows[0].Cells["total_qty"].Value.ToString();
a_m_u.Text =
dataGridView1.SelectedRows[0].Cells["actual_mrp_unit"].Value.ToString();
mfg.Text =
dataGridView1.SelectedRows[0].Cells["mfg"].Value.ToString();
exp.Text =
dataGridView1.SelectedRows[0].Cells["exp"].Value.ToString();
mrppunit.Text =
dataGridView1.SelectedRows[0].Cells["mrp_unit"].Value.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
216
217
218
219
namespace KURJI
{
public partial class New_Product : Form
{
string sql;
database db = new database();
DataSet ds;
public New_Product()
{
InitializeComponent();
}
public void record_product()
{
if (txtclass.Text == "" || txtmfgby.Text == "" || txtpnm.Text == "" ||
txtpower.Text == "" || txtsclass.Text == "" || txttype.Text == "")
220
{
MessageBox.Show("Enter your Full detail");
}
else
{
sql = "select p_id from product order by p_id";
ds = new DataSet();
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
if (p > 0)
{
221
}
else
{
txtpid.Text = "10001";
sql = "insert into product values(" + int.Parse(txtpid.Text) + ",'" +
txtpnm.Text + "','" + txttype.Text + "','" + txtpower.Text + "','" + txtclass.Text + "','"
+ txtsclass.Text + "','" + txtmfgby.Text + "')";
db.ExecuteOrcl(sql);
}
}
}
private void btmrecord_Click(object sender, EventArgs e)
{
record_product();
}
public void search_product()
{
string str = "%" + txtsearch.Text + "%";
sql = "select p_nm product_Name,p_id product_id,p_type
Type,power,mfgby,p_class,p_s_class from product where ((p_nm like '" + str + "')
or (p_id like '" + str + "')) ";
ds = new DataSet();
ds = db.getDataTable(sql);
222
dataGridView1.DataSource = ds.Tables[0];
}
private void textBox1_Leave(object sender, EventArgs e)
{
search_product();
}
ds = db.getDataTable(sql);
dataGridView1.DataSource = ds.Tables[0];
223
}
}
224
225
226
namespace KURJI
{
public partial class New_Supplier : Form
{
string sql;
database db = new database();
DataSet ds;
public New_Supplier()
{
InitializeComponent();
}
public void disp()
{
sql = "select * from supplier";
227
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView1.DataSource = ds.Tables[0];
}
private void btnref_Click(object sender, EventArgs e)
{
disp();
}
public void record()
{
if (txtsnm.Text == "" || txtvat.Text == "" || txtemail.Text == "" ||
txtcst.Text == "" || txtcontact.Text == "" || txtaddress.Text == "")
{
MessageBox.Show("Enter Full Details");
}
else
{
sql = "select s_id from supplier order by s_id";
ds = new DataSet();
ds = db.getDataTable(sql);
228
int p = ds.Tables[0].Rows.Count;
if (p > 0)
{
db.ExecuteOrcl(sql);
}
else
{
txtsid.Text = "1001";
sql = "insert into supplier values(" + int.Parse(txtsid.Text) + ",'" +
txtsnm.Text + "','" + txtaddress.Text + "'," + int.Parse(txtcontact.Text) + ",'" +
txtemail.Text + "','" + txtcst.Text + "','" + txtvat.Text + "')";
db.ExecuteOrcl(sql);
229
}
}
private void btmrecord_Click(object sender, EventArgs e)
{
record();
}
public void supplier_search()
{
string str = "%" + txtsearch.Text + "%";
sql = "select * from supplier where ((s_name like '" + str + "') or (s_id like
'" + str + "')) ";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView1.DataSource = ds.Tables[0];
}
private void txtsearch_Leave(object sender, EventArgs e)
{
supplier_search();
}
230
{
disp();
}
}
}
231
232
233
namespace KURJI
{
public partial class Transfer_To_Main_Stock_List : Form
{
public Transfer_To_Main_Stock_List()
{
InitializeComponent();
}
public void display_sales_tranfer_list()
{
string sql = " select
t.trans_no,t.trans_date,t.transfered_by,t.trans_from,t.trans_to,p.p_nm,p.p_type,
p.power,t.p_id,t.batch,t.trans_qty,pr.mrp_unit,pr.costprice_unit,
(pr.costprice_unit*t.trans_qty) total_costprice,pr.mfg,pr.exp from product
p,purchase_detail pr,transfer_to_main_stock t where p.p_id=t.p_id and
t.p_id=pr.p_id and t.batch=pr.batch and t.receipt_no=pr.receipt_no and
t.trans_date between '" + datefrom.Text + "' and '" + dateto.Text + "'order by
t.trans_no";
234
dataGridView2.DataSource = ds.Tables[0];
decimal q = 0;
for (int i = 0; i < dataGridView2.Rows.Count - 1; i++)
{
TxtTotalAmt.Text = "";
q=q+
(Convert.ToDecimal(dataGridView2.Rows[i].Cells["total_costprice"].Value));
}
TxtTotalAmt.Text = q.ToString();
}
else
{
235
}
}
236
237
238
namespace KURJI
{
public partial class Transfer_To_Main_Stock_New : Form
{
string sql,rec;
database db = new database();
DataSet ds;
public Transfer_To_Main_Stock_New()
{
InitializeComponent();
txttransferedby.Text = (UserAccess.C_User).ToString();
}
public void product_search()
{
string str = txtproduct_search.Text + "%";
239
sql = "select
p.p_nm,p.p_type,m.p_id,m.batch,m.total_qty,pr.mrp_unit,pr.actual_mrp_unit,pr.
mfg,pr.exp,pr.costprice_unit,
(pr.costprice_unit*m.total_qty)totalcostprice,m.receipt_no from product
p,sales_stock m,purchase_detail pr where p.p_id=m.p_id and m.p_id=pr.p_id
and pr.batch=m.batch and pr.receipt_no=m.receipt_no and p.p_nm like ('" +
str + "')";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView1.Visible = true;
groupBox3.Visible = true;
dataGridView1.DataSource = ds.Tables[0];
}
if (dataGridView1.Rows.Count > 0)
{
int i = 0;
240
i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
txtproduct_search.Text =
dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
txttype.Text =
dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
txtcode.Text =
dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
b_no.Text =
dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
txtstockqty.Text =
dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
mrppunit.Text =
dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
a_m_u.Text =
dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
mfg.Text =
dataGridView1.SelectedRows[0].Cells[7].Value.ToString();
exp.Text =
dataGridView1.SelectedRows[0].Cells[8].Value.ToString();
cppunit.Text =
dataGridView1.SelectedRows[0].Cells[9].Value.ToString();
tcp.Text =
dataGridView1.SelectedRows[0].Cells[10].Value.ToString();
rec = dataGridView1.SelectedRows[0].Cells[11].Value.ToString();
groupBox3.Visible = false;
}
else
{
241
}
}
public void cal_amount()
{
if (txtstockqty.Text != "")
{
242
{
if (int.Parse(tqty.Text) <= int.Parse(txtstockqty.Text))
{
decimal ds = decimal.Parse(tqty.Text);
decimal ds1 = decimal.Parse(cppunit.Text);
decimal ds3 = ds * ds1;
ttcp.Text = ds3.ToString();
}
else
{
MessageBox.Show("Too Much Quantity,Can't Transfer");
}
}
else
{
MessageBox.Show("Please Enter Quantity");
}
}
else
{
MessageBox.Show("You don't have Stock Qty,Can't Transfer");
}
}
private void tqty_Leave(object sender, EventArgs e)
{
243
cal_amount();
txtcode.Focus();
}
public void record()
{
if (txtcode.Text != "" && tqty.Text != "")
{
int stkqty = int.Parse(txtstockqty.Text);
int trsqty = int.Parse(tqty.Text);
int mainstkp_id = int.Parse(txtcode.Text);
string mainbatch = (b_no.Text).ToString().Trim();
sql = "update sales_stock set total_qty= " + stkqty + " where p_id=
" + mainstkp_id + " and batch= '" + mainbatch + "'";
db.ExecuteOrcl(sql);
ds = new DataSet();
244
ds = db.getDataTable(sql);
int b;
int sstrow = ds.Tables[0].Rows.Count;
if (sstrow > 0)
{
for (b = 0; b < sstrow; b++)
{
Int32 ssp = Convert.ToInt32(ds.Tables[0].Rows[b]["p_id"]);
string ssbatch = ds.Tables[0].Rows[b]
["batch"].ToString().Trim();
Int32 ssqty = Convert.ToInt32(ds.Tables[0].Rows[b]
["total_qty"]);
if ((mainstkp_id == ssp) && (mainbatch == ssbatch))
{
db.ExecuteOrcl(sql);
}
}
245
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
246
db.ExecuteOrcl(sql);
}
else
{
TxtNumber.Text = "TMTS1400000001";
sql = "insert into transfer_to_main_stock values('" +
TxtNumber.Text + "','" + transferdate.Text + "','" + TxtStore.Text + "','" +
txtsalestore.Text + "'," + int.Parse(txtcode.Text) + ",'" + b_no.Text + "'," +
int.Parse(tqty.Text) + ",'" + txttransferedby.Text + "','" + rec + "' )";
db.ExecuteOrcl(sql);
247
else
{
MessageBox.Show(" Can't Transfer This Much Quantity");
}
tqty.Text = "";
ttcp.Text = "";
}
else
{
MessageBox.Show("Please Enter Your Detail");
}
248
{
this.Close();
}
249
}
}
Sales Stock
250
251
namespace KURJI
{
public partial class View_Sales_Stock : Form
{
string sql;
DataSet ds;
database db=new database();
public View_Sales_Stock()
{
InitializeComponent();
}
public void prod_search()
{
string str = "%" + txtproductsearch.Text + "%";
sql = "select
p.p_nm,p.p_type,p.power,s.p_id,s.batch,s.total_qty,pr.mrp_unit,pr.actual_mrp_u
nit,pr.mfg,pr.exp,pr.costprice_unit,(pr.costprice_unit*s.total_qty)totalcostprice
from product p,sales_stock s,purchase_detail pr where p.p_id=s.p_id and
252
ds = db.getDataTable(sql);
dataGridView1.Visible = true;
dataGridView1.DataSource = ds.Tables[0];
}
private void txtproductsearch_Leave(object sender, EventArgs e)
{
prod_search();
}
private void dataGridView1_Click(object sender, EventArgs e)
{
try
{
int i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
txtcode.Text =
dataGridView1.SelectedRows[0].Cells["p_id"].Value.ToString();
m_name.Text =
dataGridView1.SelectedRows[0].Cells["p_nm"].Value.ToString();
b_no.Text =
dataGridView1.SelectedRows[0].Cells["batch"].Value.ToString();
txttype.Text =
dataGridView1.SelectedRows[0].Cells["p_type"].Value.ToString();
253
cppunit.Text =
dataGridView1.SelectedRows[0].Cells["costprice_unit"].Value.ToString();
tcp.Text =
dataGridView1.SelectedRows[0].Cells["totalcostprice"].Value.ToString();
txtstockqty.Text =
dataGridView1.SelectedRows[0].Cells["total_qty"].Value.ToString();
a_m_u.Text =
dataGridView1.SelectedRows[0].Cells["actual_mrp_unit"].Value.ToString();
mfg.Text =
dataGridView1.SelectedRows[0].Cells["mfg"].Value.ToString();
exp.Text =
dataGridView1.SelectedRows[0].Cells["exp"].Value.ToString();
mrppunit.Text =
dataGridView1.SelectedRows[0].Cells["mrp_unit"].Value.ToString();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
254
}
}
}
255
256
namespace KURJI
{
public partial class Cash_Sales_Bill_Only_List : Form
{
database db = new database();
public Cash_Sales_Bill_Only_List()
{
InitializeComponent();
}
257
{
int i;
i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
string str1 =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells[0].Value.ToString();
if (cmbpatient_type.Text == "OPD")
{
if
(DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["ip_no"].Value.ToStrin
g() == "")
{
Cash_Sales_Bill_Only_Display f = new
Cash_Sales_Bill_Only_Display(str1, cmbpatient_type.Text);
f.Show();
}
else
{
MessageBox.Show("Refresh List");
}
}
else
{
258
if
(DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["ip_no"].Value.ToStrin
g() != "")
{
Cash_Sales_Bill_Only_Display f = new
Cash_Sales_Bill_Only_Display(str1, cmbpatient_type.Text);
f.Show();
}
else
{
MessageBox.Show("Refresh List");
}
}
}
else
{
MessageBox.Show("Cannot Display");
}
}
private void Cash_Sales_Bill_Only_List_Load(object sender, EventArgs e)
{
}
public void sum_total()
{
decimal q = 0;
259
260
sum_total();
}
else
{
MessageBox.Show("No Record Found");
}
}
else if (cmbpatient_type.Text == "IP")
{
MessageBox.Show(cmbpatient_type.Text);
string sql = "select
m.bill_no,m.ip_no,m.opd_no,p.pat_name,m.bill_date,m.net_amount from
Patient_detail p,admission_detail ad,Cash_Sale_Master m where
p.opd_no=m.opd_no and p.opd_no=ad.opd_no and m.ip_no=ad.ip_no and
m.bill_date between '" + datefrom.Text + "'and'" + dateto.Text + "'order by
m.bill_no";
261
DataGridView1.DataSource = ds.Tables[0];
sum_total();
}
else
{
MessageBox.Show("No Record Found");
}
}
else
{
MessageBox.Show("Invalid Selection");
}
}
262
}
}
263
264
265
namespace KURJI
{
public partial class Cash_Sales_Bill_Only_New : Form
{
database db = new database();
string sql, patient_type;
DataSet ds;
string rec;
public Cash_Sales_Bill_Only_New(string patient)
{
InitializeComponent();
patient_type = patient;
txtuser_id.Text = UserAccess.C_User;
}
266
{
if (txtremark.Text != "" && m_name.Text != "" && ComboBox1.Text != ""
&& textBox1.Text != "" && txtdate.Text != "" && txtuser_id.Text != "" &&
DataGridView1.Rows.Count > 1)
{
insert_cash_sale();
update_sales();
}
else
{
MessageBox.Show("Please enter full detail");
}
}
267
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
268
db.ExecuteOrcl(sql);
}
sql = "insert into
Cash_Sale_master(Bill_NO,opd_no,Doc_Id,User_Id,Bill_Date,Total_amount,Roun
doff_amount,Net_amount,status,Remarks,ip_no)values('" + txtNumber.Text + "','"
+ txtopd.Text + "','" + ComboBox1.Text + "','" + txtuser_id.Text + "','" +
txtdate.Text + "'," + decimal.Parse(txttotalamt.Text) + "," +
decimal.Parse(roundoff_amount.Text) + "," + decimal.Parse(txtnet_total.Text) +
",'A', '" + txtremark.Text + "','" + txtip.Text + "')";
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
txtip.Text + " has been succesfully added as New Purchase");
cmdrecord.Enabled = false;
}
else
{
for (int i = 0; i < DataGridView1.Rows.Count ; i++)
269
{
cmdcancel.Enabled = true;
sql = "insert into Cash_Sale_detail values('" + txtNumber.Text +
"'," + DataGridView1.Rows[i].Cells["Material_Code"].Value + ",'" +
DataGridView1.Rows[i].Cells["Batch"].Value + "'," +
DataGridView1.Rows[i].Cells["issqty"].Value + "," +
DataGridView1.Rows[i].Cells["Amount"].Value + ",'" +
DataGridView1.Rows[i].Cells["receipt_no"].Value + "')";
db.ExecuteOrcl(sql);
}
sql = "insert into
Cash_Sale_master(Bill_NO,opd_no,Doc_Id,User_Id,Bill_Date,Total_amount,Roun
doff_amount,Net_amount,status,Remarks)values('" + txtNumber.Text + "','" +
txtopd.Text + "','" + ComboBox1.Text + "','" + txtuser_id.Text + "','" + txtdate.Text
+ "'," + decimal.Parse(txttotalamt.Text) + "," +
decimal.Parse(roundoff_amount.Text) + "," + decimal.Parse(txtnet_total.Text) +
",'A', '" + txtremark.Text + "')";
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
txtip.Text + " has been succesfully added as New Purchase");
cmdrecord.Enabled = false;
}
}
else
{
if (patient_type == "IP")
{
270
txtNumber.Text = "BILL1400000001";
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
cmdcancel.Enabled = true;
sql = "insert into Cash_Sale_detail values('" + txtNumber.Text +
"'," + DataGridView1.Rows[i].Cells["Material_Code"].Value + ",'" +
DataGridView1.Rows[i].Cells["Batch"].Value + "'," +
DataGridView1.Rows[i].Cells["issqty"].Value + "," +
DataGridView1.Rows[i].Cells["Amount"].Value + ",'" +
DataGridView1.Rows[i].Cells["receipt_no"].Value + "')";
db.ExecuteOrcl(sql);
}
}
else
{
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
cmdcancel.Enabled = true;
271
db.ExecuteOrcl(sql);
}
sql = "insert into
Cash_Sale_master(Bill_NO,opd_no,Doc_Id,User_Id,Bill_Date,Total_amount,Roun
doff_amount,Net_amount,status,Remarks)values('" + txtNumber.Text + "','" +
txtopd.Text + "','" + ComboBox1.Text + "','" + txtuser_id.Text + "','" + txtdate.Text
+ "'," + decimal.Parse(txttotalamt.Text) + "," +
decimal.Parse(roundoff_amount.Text) + "," + decimal.Parse(txtnet_total.Text) +
",'A', '" + txtremark.Text + "')";
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
txtip.Text + " has been succesfully added as New Purchase");
cmdrecord.Enabled = false;
}
}
}
public void prod_search()
{
string str = txtmname.Text + "%";
sql = "select
p.p_nm,p.p_type,s.p_id,s.batch,s.total_qty,p.power,pr.ACTUAL_MRP_UNIT,pr.mr
p_unit,pr.exp,pr.mfg,s.receipt_no from product p,sales_stock s,purchase_detail
272
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView3.Visible = true;
btncan_item.Visible = true;
btnaccept_item.Visible = true;
dataGridView3.DataSource = ds.Tables[0];
ds = db.getDataTable(sql);
panel1.Visible = true;
273
dataGridView2.DataSource = ds.Tables[0];
dataGridView2.Columns["pat_name"].HeaderCell.Value = "Patient
Name";
dataGridView2.Columns["ip_no"].HeaderCell.Value = "IP No.";
dataGridView2.Columns["opd_no"].HeaderCell.Value = "OPD No.";
dataGridView2.Columns["ward_no"].HeaderCell.Value = "Ward No";
}
else if (patient_type == "OPD")
{
ds = new DataSet();
ds = db.getDataTable(sql);
panel1.Visible = true;
dataGridView2.Visible = true;
dataGridView2.DataSource = ds.Tables[0];
}
else
{
MessageBox.Show("Wrong Choice");
}
274
DataGridView1.Rows.Add(int.Parse(txtcode.Text), txtmname.Text,
txttype.Text, txtbatch_no.Text, decimal.Parse(txtmrp.Text),
decimal.Parse(txtactmrp.Text), int.Parse(txtqty_issued.Text),
int.Parse(txtstock.Text), decimal.Parse(txtamount.Text), txtpower.Text,
txtmfg.Text, txtexp.Text, rec);
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
d=d+
Convert.ToDecimal(DataGridView1.Rows[i].Cells[8].Value);
txttotalamt.Text = d.ToString();
string content = txttotalamt.Text;
275
}
else
{
MessageBox.Show("Cannot Transfer");
}
}
else
{
MessageBox.Show("please enter your detail");
}
}
private void cmdadd_Click(object sender, EventArgs e)
{
load_grid();
276
txtcode.Focus();
}
}
else
{
MessageBox.Show("Enter Quantity to be issued");
}
277
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView4.DataSource = ds.Tables[0];
dataGridView4.Visible = true;
}
278
}
}
private void cmddone_Click(object sender, EventArgs e)
{
this.Close();
}
private void Cash_Sales_Bill_Only_New_Load(object sender, EventArgs e)
{
279
280
txtexp.Text =
dataGridView3.SelectedRows[0].Cells[8].Value.ToString();
txtmfg.Text =
dataGridView3.SelectedRows[0].Cells[9].Value.ToString();
rec = dataGridView3.SelectedRows[0].Cells[10].Value.ToString();
dataGridView3.Visible = false;
btncan_item.Visible = false;
btnaccept_item.Visible = false;
}
catch
{
MessageBox.Show("please select a Row");
}
}
int i = dataGridView2.Rows.IndexOf(dataGridView2.CurrentRow);
281
m_name.Text = dataGridView2.Rows[i].Cells[0].Value.ToString();
txtip.Text = dataGridView2.Rows[i].Cells[1].Value.ToString();
txtopd.Text = dataGridView2.Rows[i].Cells[2].Value.ToString();
txtward.Text = dataGridView2.Rows[i].Cells[3].Value.ToString();
txtbed.Text = dataGridView2.Rows[i].Cells[4].Value.ToString();
txtsex.Text = dataGridView2.Rows[i].Cells[5].Value.ToString();
txtage.Text = dataGridView2.Rows[i].Cells[6].Value.ToString();
panel1.Visible = false;
}
int i = dataGridView2.Rows.IndexOf(dataGridView2.CurrentRow);
string str = "";
string str1 =
Convert.ToString(dataGridView2.Rows[i].Cells["ip_no"].Value);
if (str == str1)
{
m_name.Text = dataGridView2.Rows[i].Cells[0].Value.ToString();
txtopd.Text = dataGridView2.Rows[i].Cells[1].Value.ToString();
txtsex.Text = dataGridView2.Rows[i].Cells[3].Value.ToString();
txtage.Text = dataGridView2.Rows[i].Cells[4].Value.ToString();
282
panel1.Visible = false;
}
else
{
MessageBox.Show("please select OPD");
}
}
else
{
MessageBox.Show("Please select a Row");
}
}
catch
{
MessageBox.Show("Please select a Row");
}
}
private void btncan_pat_detail_Click(object sender, EventArgs e)
{
txtopd.Text = "";
txtpat_name.Text = "";
txtip.Text = "";
m_name.Text = "";
283
txtbed.Text = "";
txtage.Text = "";
txtsex.Text = "";
txtward.Text = "";
panel1.Visible = false;
dataGridView2.Visible = false;
}
284
285
namespace KURJI
{
public partial class Department_Issue_List : Form
{
string sql;
database db = new database();
DataSet ds;
286
public Department_Issue_List()
{
InitializeComponent();
}
public void department_issue_list()
{
sql = "select
m.dp_issue_no,m.issue_date,d.dep_name,m.dep_id,m.net_amount,m.status
from department_issue_master m,department d where m.dep_id=d.dep_id
and issue_date between '" + datefrom.Text + "'and '" + dateto.Text + "' order
by m.dp_issue_no";
ds = new DataSet();
ds = db.getDataTable(sql);
int c = ds.Tables[0].Rows.Count;
if (c > 0)
{
dataGridView1.DataSource = ds.Tables[0];
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
decimal d = 0;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
d=d+
Convert.ToDecimal(dataGridView1.Rows[i].Cells[4].Value);
}
287
TextBox2.Text = d.ToString();
}
else
{
MessageBox.Show("Data Not Found");
}
}
private void Department_Issue_List_Load(object sender, EventArgs e)
{
288
{
int i;
i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
string bill =
dataGridView1.Rows[dataGridView1.Rows[i].Index].Cells[0].Value.ToString();
string depid =
dataGridView1.Rows[dataGridView1.Rows[i].Index].Cells[3].Value.ToString();
Department_Issue_Display f = new
Department_Issue_Display(bill, depid);
f.Show();
}
else
{
MessageBox.Show("Cannot Display");
}
}
private void btndis_Click(object sender, EventArgs e)
{
display();
}
289
this.Close();
}
}
}
}
290
291
292
namespace KURJI
{
public partial class Department_issue_New : Form
{
DataSet ds;
database db = new database();
string sql;
string str1,str2,total_receipt;
int f=0;
public Department_issue_New()
{
InitializeComponent();
txtuser_id .Text =UserAccess.C_User;
}
293
ds = new DataSet();
ds = db.getDataTable(sql);
panel1.Visible = true;
dataGridView2.DataSource = ds.Tables[0];
}
private void cmdaccept_Click(object sender, EventArgs e)
{
try
{
int i = dataGridView2.Rows.IndexOf(dataGridView2.CurrentRow);
txtip.Text = dataGridView2.Rows[i].Cells[0].Value.ToString();
m_name.Text = dataGridView2.Rows[i].Cells[1].Value.ToString();
panel1.Visible = false;
}
catch
{
294
}
public void load_grid()
{
if (txtcode.Text != "" && txtname.Text != "" && txtqty_issued.Text != "")
{
if (((int.Parse(txtqty_issued.Text)) <= (int.Parse(txtstock.Text)) &&
(int.Parse(txtqty_issued.Text) != 0)))
{
decimal d = 0;
MessageBox.Show(total_receipt);
DataGridView1.Rows.Add(int.Parse(txtcode.Text), txtname.Text,
txttype.Text, txtbatch_no.Text, decimal.Parse(txtmrp.Text),
decimal.Parse(txtactmrp.Text), int.Parse(txtstock.Text),
int.Parse(txtqty_issued.Text), decimal.Parse(txtamount.Text), txtpower.Text,
txtmfg.Text, txtexp.Text, total_receipt);
MessageBox.Show(total_receipt);
txttotalamt.Text = d.ToString();
295
}
txtnet_total.Text = (Math.Round(double.Parse(txttotalamt.Text),
0)).ToString();
}
txtstock.Text = (int.Parse(txtstock.Text) int.Parse(txtqty_issued.Text)).ToString();
}
else
{
MessageBox.Show("Cannot Transfer");
}
}
else
296
{
MessageBox.Show("please enter your detail");
}
}
load_grid();
}
private void cmdrecord_Click(object sender, EventArgs e)
{
if (m_name.Text != "" && txtip.Text != "" && remarks.Text != "" &&
DataGridView1 .Rows.Count >1)
{
sql = "select * from department_issue_details";
ds = new DataSet();
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
297
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
db.ExecuteOrcl(sql);
298
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
txtip.Text + " has been succesfully added as New Purchase");
cmdrecord.Enabled = false;
}
else
{
txtNumber.Text = "DPIS1400000001";
for (int i = 0; i < DataGridView1.Rows.Count - 1; i++)
{
cmdcancel.Enabled = true;
sql = "insert into department_issue_details values('" +
txtNumber.Text + "'," + DataGridView1.Rows[i].Cells["material_code"].Value + ",'"
299
+ DataGridView1.Rows[i].Cells["batch"].Value + "'," +
DataGridView1.Rows[i].Cells["issqty"].Value + "," +
DataGridView1.Rows[i].Cells["Amount"].Value + ",'" +
DataGridView1.Rows[i].Cells["receipt_no"].Value + "')";
db.ExecuteOrcl(sql);
}
}
update_sales();
}
else
{
MessageBox.Show("please enter your detail");
}
}
public void update_sales()
{
Int32 sqty = 0;
300
db.ExecuteOrcl(sql);
}
}
public void cal_amount()
{
if (txtqty_issued.Text != "" && int.Parse(txtqty_issued.Text) != 0)
{
301
}
else
{
MessageBox.Show("Enter Quantity to be issued");
}
}
private void txtqty_issued_Leave(object sender, EventArgs e)
{
cal_amount();
}
private void txtqty_issued_TextChanged(object sender, EventArgs e)
{
if (Regex.IsMatch(txtqty_issued.Text, "[^0-9]"))
{
MessageBox.Show("please enter a number");
txtqty_issued.Text = "";
}
private void textBox5_Leave(object sender, EventArgs e)
{
string str = txtname.Text + "%";
302
sql = "select
p.p_nm,p.p_type,s.p_id,s.batch,s.total_qty,p.power,pr.ACTUAL_MRP_UNIT,pr.mr
p_unit,pr.exp,pr.mfg,s.receipt_no from product p,sales_stock s,purchase_detail
pr where p.p_id=s.p_id and s.p_id=pr.p_id and s.batch=pr.batch and
s.receipt_no=pr.receipt_no and p.p_nm like '" + str + "'";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView3.Visible = true;
btncanitem.Visible = true;
btnacceptitem.Visible = true;
dataGridView3.DataSource = ds.Tables[0];
}
private void cmddone_Click(object sender, EventArgs e)
{
this.Close();
}
303
txtip.Text = "";
panel1.Visible = false;
}
304
txtbatch_no.Text =
dataGridView3.SelectedRows[0].Cells[3].Value.ToString();
txtstock.Text =
dataGridView3.SelectedRows[0].Cells[4].Value.ToString();
txtpower.Text =
dataGridView3.SelectedRows[0].Cells[5].Value.ToString();
txtactmrp.Text =
dataGridView3.SelectedRows[0].Cells[6].Value.ToString();
txtmrp.Text =
dataGridView3.SelectedRows[0].Cells[7].Value.ToString();
txtexp.Text =
dataGridView3.SelectedRows[0].Cells[8].Value.ToString();
txtmfg.Text =
dataGridView3.SelectedRows[0].Cells[9].Value.ToString();
MessageBox.Show(dataGridView3.SelectedRows[0].Cells[10].Value.ToString());
total_receipt =
dataGridView3.SelectedRows[0].Cells[10].Value.ToString();
dataGridView3.Visible = false;
btncanitem.Visible = false;
btnacceptitem.Visible = false;
}
catch
{
MessageBox.Show("please select a Row");
}
}
}
305
306
Ip Issue List
307
308
namespace KURJI
{
public partial class Ip_Issue_Lists : Form
{
database db = new database();
public Ip_Issue_Lists()
{
InitializeComponent();
}
public void list()
{
string sql = "select
m.ip_issue_no,p.Pat_name,m.issue_date,m.net_amount,a.opd_no,m.ip_no from
Inpatient_issue_master m,Patient_Detail p,Admission_Detail a where
a.opd_no=p.opd_no and issue_date between '" + datefrom.Text + "'and'" +
dateto.Text + "'";
DataSet ds = new DataSet();
ds = db.getDataTable(sql);
309
int c = ds.Tables[0].Rows.Count;
if (c > 0)
{
dataGridView1.DataSource = ds.Tables[0];
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
decimal d = 0;
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
d = d + Convert.ToDecimal(dataGridView1.Rows[i].Cells[3].Value);
}
TxtTotalAmt.Text = d.ToString();
}
else
{
MessageBox.Show("Data Not Found");
}
}
private void Showbtn_Click(object sender, EventArgs e)
{
list();
}
310
{
if (dataGridView1.Rows.Count > 0)
{
int i;
i = dataGridView1.Rows.IndexOf(dataGridView1.CurrentRow);
string str1 =
dataGridView1.Rows[dataGridView1.Rows[i].Index].Cells[0].Value.ToString();
MessageBox.Show(str1);
Inpatient_Issue_Display f = new Inpatient_Issue_Display(str1);
f.Show();
}
else
{
MessageBox.Show("Cannot Display, First Show Records");
}
311
}
}
312
Ip Issue New
313
namespace KURJI
{
public partial class Inpatient_Issue_New : Form
{
string sql;
database db=new database();
DataSet ds;
string rec,str1;
public Inpatient_Issue_New()
{
InitializeComponent();
314
txtuser_id.Text = UserAccess.C_User;
}
private void TextBox7_TextChanged(object sender, EventArgs e)
{
string str = "%"+ m_name.Text + "%";
ds = db.getDataTable(sql);
panel1.Visible = true;
dataGridView2.DataSource = ds.Tables[0];
}
private void cmdaccept_Click_1(object sender, EventArgs e)
{
try
{
int i = dataGridView2.Rows.IndexOf(dataGridView2.CurrentRow);
m_name.Text = dataGridView2.Rows[i].Cells[0].Value.ToString();
txtip.Text = dataGridView2.Rows[i].Cells[1].Value.ToString();
txtward.Text = dataGridView2.Rows[i].Cells[2].Value.ToString();
txtbed.Text = dataGridView2.Rows[i].Cells[3].Value.ToString();
txtsex.Text = dataGridView2.Rows[i].Cells[4].Value.ToString();
315
txtage.Text = dataGridView2.Rows[i].Cells[5].Value.ToString();
panel1.Visible = false;
}
catch
{
MessageBox.Show("please select a Row ");
}
}
private void button2_Click_1(object sender, EventArgs e)
{
try
{
int i = 0;
i = dataGridView3.Rows.IndexOf(dataGridView3.CurrentRow);
txtname.Text =
dataGridView3.SelectedRows[0].Cells[0].Value.ToString();
txttype.Text =
dataGridView3.SelectedRows[0].Cells[1].Value.ToString();
txtcode.Text =
dataGridView3.SelectedRows[0].Cells[2].Value.ToString();
txtbatch_no.Text =
dataGridView3.SelectedRows[0].Cells[3].Value.ToString();
txtstock.Text =
dataGridView3.SelectedRows[0].Cells[4].Value.ToString();
txtpower.Text =
dataGridView3.SelectedRows[0].Cells[5].Value.ToString();
316
txtactmrp.Text =
dataGridView3.SelectedRows[0].Cells[6].Value.ToString();
txtmrp.Text =
dataGridView3.SelectedRows[0].Cells[7].Value.ToString();
txtexp.Text =
dataGridView3.SelectedRows[0].Cells[8].Value.ToString();
txtmfg.Text =
dataGridView3.SelectedRows[0].Cells[9].Value.ToString();
rec = dataGridView3.SelectedRows[0].Cells[10].Value.ToString();
dataGridView3.Visible = false;
button1.Visible = false;
button2.Visible = false;
}
catch
{
MessageBox.Show("please select a Row");
317
}
else
{
MessageBox.Show("Enter Quantity to be issued");
}
318
{
decimal d = 0;
MessageBox.Show(str1);
DataGridView1.Rows.Add(int.Parse(txtcode.Text), txtname.Text,
txttype.Text, txtbatch_no.Text, decimal.Parse(txtmrp.Text),
decimal.Parse(txtactmrp.Text), int.Parse(txtqty_issued.Text),
int.Parse(txtstock.Text), decimal.Parse(txtamount.Text), txtpower.Text,
txtmfg.Text, txtexp.Text, rec);
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
d=d+
Convert.ToDecimal(DataGridView1.Rows[i].Cells[8].Value);
txttotalamt.Text = d.ToString();
string content = txttotalamt.Text;
319
}
else
{
MessageBox.Show("Cannot Transfer");
}
}
else
{
MessageBox.Show("please enter your detail");
}
}
private void cmdrecord_Click_1(object sender, EventArgs e)
{
if (txtremark.Text != "" && m_name.Text != "" && txtdate.Text != "" &&
txtdoc_id.Text != "" && DataGridView1.Rows.Count > 1)
{
insert_ip_issue();
update_sales();
}
else
{
320
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
321
if (p > 0)
{
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
322
db.ExecuteOrcl(sql);
db.ExecuteOrcl(sql);
MessageBox.Show("The following Product Having Invoice No." +
txtip.Text + " has been succesfully added as New Purchase");
cmdrecord.Enabled = false;
}
else
{
txtNumber.Text = "IPIS1400000001";
323
db.ExecuteOrcl(sql);
}
}
324
this.Close();
}
private void txtname_Leave(object sender, EventArgs e)
{
string str = txtname.Text + "%";
sql = "select
p.p_nm,p.p_type,s.p_id,s.batch,s.total_qty,p.power,pr.ACTUAL_MRP_UNIT,pr.mr
p_unit,pr.exp,pr.mfg,s.receipt_no from product p,sales_stock s,purchase_detail
pr where p.p_id=s.p_id and s.p_id=pr.p_id and s.batch=pr.batch and
s.receipt_no=pr.receipt_no and p.p_nm like '" + str + "'";
ds = new DataSet();
ds = db.getDataTable(sql);
dataGridView3.Visible = true;
button1.Visible = true;
button2.Visible = true;
dataGridView3.DataSource = ds.Tables[0];
}
ds = new DataSet();
ds = db.getDataTable(sql);
325
dataGridView4.DataSource = ds.Tables[0];
dataGridView4.Visible = true;
}
}
}
326
327
328
329
namespace KURJI
{
public partial class Inpatient_Return_Lists : Form
{
string sql;
database db = new database();
DataSet ds;
public Inpatient_Return_Lists()
{
InitializeComponent();
}
public void list()
{
330
sql = "select
m.Ip_return_no,ipm.ip_no,m.ip_issue_no,m.net_amount,m.return_date from
Ip_Return_master m,Inpatient_Issue_Master ipm where
ipm.ip_issue_no=m.ip_issue_no and m.return_date between'" + datefrom.Text +
"' and '" +dateto.Text + "'order by m.ip_return_no ";
ds = new DataSet();
ds = db.getDataTable(sql);
int c = ds.Tables[0].Rows.Count;
if (c > 0)
{
DataGridView1.DataSource = ds.Tables[0];
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
decimal d = 0;
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
d = d + Convert.ToDecimal(DataGridView1.Rows[i].Cells[3].Value);
}
txttotal_amount.Text = d.ToString();
}
else
{
MessageBox.Show("Data Not Found");
}
}
331
if (DataGridView1.Rows.Count > 0)
{
int i;
i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
string str1 =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells[0].Value.ToString();
332
f.Show();
}
else
{
MessageBox.Show("Cannot Display, First Show Records");
}
}
private void txtbill_Leave(object sender, EventArgs e)
{
sql = "select
m.Ip_return_no,ipm.ip_issue_no,m.net_amount,m.return_date,ipm.ip_no from
Inpatient_issue_Master ipm,Ip_Return_master m where
m.ip_issue_no=ipm.ip_issue_no and m.ip_issue_no='"+txtbill.Text+"'";
ds = new DataSet();
ds = db.getDataTable(sql);
int c = ds.Tables[0].Rows.Count;
MessageBox.Show(c.ToString());
if (c > 0)
{
DataGridView1.DataSource = ds.Tables[0];
}
else
{
MessageBox.Show("No Record Found");
333
}
private void Inpatient_Return_Lists_Load(object sender, EventArgs e)
{
}
}
}
334
335
336
namespace KURJI
{
public partial class Inpatient_Return_New : Form
{
string sql;
database db=new database();
DataSet ds1;
DataSet ds = new DataSet();
int f = 0,amt=0;
decimal s = 0;
public Inpatient_Return_New()
{
InitializeComponent();
}
337
338
txtbed.Text = ds.Tables[0].Rows[0]["bed"].ToString();
sql = "select
p.p_nm,d.p_id,d.batch,d.qty_issued,p.p_type,p.power,pr.mrp_unit,pr.actual_mrp
_unit,pr.mfg,pr.exp,d.amount,pr.receipt_no from Product p,Purchase_Detail
pr,Inpatient_Issue_Detail d where p.p_id=d.p_id and pr.p_id=d.p_id and
pr.batch=d.batch and pr.receipt_no=d.receipt_no and d.ip_issue_no='" +
txtbill_number.Text + "'";
ds = new DataSet();
ds = db.getDataTable(sql);
DataGridView1.DataSource = ds.Tables[0];
}
else
{
MessageBox.Show("Incorrect Bill");
}
}
private void txtbill_number_Leave(object sender, EventArgs e)
{
search_bill();
}
if (txtbill_number.Text == "")
{
339
ds1 = db.getDataTable(sql);
int c = ds1.Tables[0].Rows.Count;
MessageBox.Show(c.ToString());
if (c > 0)
{
s = 0;
sql = "Select ip_return_no from Ip_RETURN_MASTER order by
ip_return_no";
ds = new DataSet();
ds = db.getDataTable(sql);
340
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
341
else
{
txtNumber.Text = "IPRN1400000001";
update_stock(c);
}
}
342
}
else
{
MessageBox.Show("Hello");
qty = Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
if (qty > 0 && qty <=
Convert.ToInt32(DataGridView1.Rows[i].Cells[5].Value))
{
decimal d =
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value) *
Convert.ToDecimal(DataGridView1.Rows[i].Cells["actual_mrp_unit"].Value);
DataGridView1.Rows[i].Cells[1].Value = d;
decimal sum = 0;
for (int c = 0; c < DataGridView1.Rows.Count - 1; c++)
{
if (Convert.ToString(DataGridView1.Rows[c].Cells[1].Value) !=
"")
{
sum = sum +
Convert.ToDecimal(DataGridView1.Rows[c].Cells[1].Value);
MessageBox.Show(sum.ToString());
343
}
txttotal_amount.Text = sum.ToString();
string content = sum.ToString();
}
txtnet_amount.Text = Math.Round(double.Parse(sum.ToString()),
0).ToString();
txttotal_amount.Text = sum.ToString();
}
else
{
MessageBox.Show("Cannot Return This much Quantity");
DataGridView1.Rows[i].Cells[0].Value = "";
DataGridView1.Rows[i].Cells[0].Value = "";
}
}
}
344
string st = Convert.ToString(DataGridView1.Rows[i].Cells[0].Value);
345
string str1 =
Convert.ToString(DataGridView1.Rows[i].Cells[1].Value);
MessageBox.Show(st);
MessageBox.Show(str1);
346
qty = qty +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
MessageBox.Show(qty.ToString());
sql = "update sales_stock set total_qty=" + qty + " where
p_id=" + pid + "and batch='" + batch + "'";
db.ExecuteOrcl(sql);
}
}
}
}
if (amt == 1)
{
MessageBox.Show("Hello Master");
txttotal_amount.Text = s.ToString();
txtnet_amount.Text = s.ToString();
sql = "insert into
Ip_return_master(ip_return_no,return_date,user_id,remarks,total_amount,roun
doff_amount,net_amount,ip_issue_no) values('" + txtNumber.Text + "','" +
txtdate.Text + "','" + txtuser_id.Text + "','" + txtremarks.Text + "'," +
decimal.Parse(txttotal_amount.Text) + "," + decimal.Parse(txtrdf_amount.Text) +
"," + decimal.Parse(txtnet_amount.Text) + ",'" + txtbill_number.Text + "')";
db.ExecuteOrcl(sql);
}
347
}
private void Inpatient_Return_New_Load(object sender, EventArgs e)
{
348
349
350
namespace KURJI
{
public partial class Department_Return_List : Form
{
database db = new database();
public Department_Return_List()
{
InitializeComponent();
}
351
if (c > 0)
{
DataGridView1.DataSource = ds.Tables[0];
bill_no_from.Text = ds.Tables[0].Rows[0][2].ToString();
bill_no_to .Text = ds.Tables[0].Rows[c - 1][2].ToString();
decimal d = 0;
for (int i = 0; i < DataGridView1.Rows.Count; i++)
{
d = d + Convert.ToDecimal(DataGridView1.Rows[i].Cells[5].Value);
}
txttotal_amount.Text = d.ToString();
}
else
{
MessageBox.Show("Data Not Found");
352
}
}
private void btnshow_Click(object sender, EventArgs e)
{
show_list();
}
private void Department_Return_List_Load(object sender, EventArgs e)
{
}
public void bill_search()
{
string sql = "select
d.dep_name,m.dep_id,m.dp_return_no,m.dp_return_date,dm.dp_issue_no,m.tot
al_amount,dm.dp_issue_no from Department_Return_Master m,Department
d,Department_Issue_Master dm where m.dep_id=d.dep_id and
dm.dp_issue_no=m.dp_issue_no and dm.dp_issue_no='" + txtbill.Text + "' order
by m.dp_return_no";
353
354
string bill =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells[2].Value.ToString();
string depid =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells[1].Value.ToString();
Department_Return_Display f = new Department_Return_Display(bill,
depid);
f.Show();
}
else
{
MessageBox.Show("Cannot Display, First Show Records");
}
}
}
}
355
356
357
namespace KURJI
{
public partial class Department_Return_New : Form
{
string str, sql;
database db = new database();
DataSet ds,ds1;
int f=0,c=0;
decimal s;
public Department_Return_New()
{
InitializeComponent();
txtuser_id.Text = UserAccess.C_User;
358
ds = new DataSet();
ds = db.getDataTable(sql);
int i = ds.Tables[0].Rows.Count;
if (i > 0)
{
txtdep_id.Text = ds.Tables[0].Rows[0][0].ToString();
txtdep_name.Text = ds.Tables[0].Rows[0][1].ToString();
txttotal_amount.Text = ds.Tables[0].Rows[0][2].ToString();
txtrdf_amount.Text = ds.Tables[0].Rows[0][3].ToString();
txtnet_amount.Text = ds.Tables[0].Rows[0][4].ToString();
sql = "select
p.p_nm,p.p_id,p.p_type,p.power,d.batch,d.qty_issued,d.amount,pr.mfg,pr.exp,pr
.mrp_unit,pr.actual_mrp_unit,pr.receipt_no from product p,purchase_detail
pr,department_issue_details d where p.p_id=d.p_id and d.p_id=pr.p_id and
d.batch=pr.batch and d.receipt_no=pr.receipt_no and d.dp_issue_no='" +
txtbill_number.Text + "'";
ds = new DataSet();
359
ds = db.getDataTable(sql);
DataGridView1.DataSource = ds.Tables[0];
}
else
{
MessageBox.Show("Incorrect Bill Number");
}
}
private void txtbill_number_Leave(object sender, EventArgs e)
{
search_bill();
}
360
if (Convert.ToString(DataGridView1.Rows[i].Cells[1].Value) != "")
{
string stbatch =
Convert.ToString(DataGridView1.Rows[i].Cells[6].Value);
MessageBox.Show(batch + pid);
if ((pid == Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value)
&& (stbatch == batch)))
{
f = 1;
s=s+
Convert.ToDecimal(DataGridView1.Rows[i].Cells[1].Value);
MessageBox.Show("From OPD");
MessageBox.Show(s.ToString());
sql = "insert into
Department_Return_Detail(dp_return_no,p_id,batch,return_qty,receipt_no,total_
amount) values('" + txtNumber.Text + "'," +
Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value) + ",'" +
DataGridView1.Rows[i].Cells[6].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value) + ",'" +
DataGridView1.Rows[i].Cells[13].Value + "'," +
Convert.ToDecimal(DataGridView1.Rows[i].Cells[1].Value) + ")";
db.ExecuteOrcl(sql);
qty = qty +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
MessageBox.Show(qty.ToString());
sql = "update sales_stock set total_qty=" + qty + " where
p_id=" + pid + "and batch='" + batch + "'";
361
db.ExecuteOrcl(sql);
}
}
}
MessageBox.Show(s.ToString());
txttotal_amount.Text = s.ToString();
txtnet_amount.Text = s.ToString();
sql = "insert into
department_return_master(dp_return_no,dp_return_date,remarks,total_amount
,roundoff_amount,net_amount,user_id,dep_id,dp_issue_no) values('" +
txtNumber.Text + "','" + txtdate.Text + "','" + txtremarks.Text + "'," +
decimal.Parse(txttotal_amount.Text) + "," + decimal.Parse(txtrdf_amount.Text) +
"," + decimal.Parse(txtnet_amount.Text) + ",'" + txtuser_id.Text + "','" +
txtdep_id.Text + "','" + txtbill_number.Text + "')";
db.ExecuteOrcl(sql);
}
private void DataGridView1_CellLeave(object sender,
DataGridViewCellEventArgs e)
{
int qty=0;
362
try
{
int i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
DataGridView1.Rows[i].Cells[1].Value = "";
if
(Regex.IsMatch(DataGridView1.Rows[i].Cells[0].Value.ToString(),"[^0-9]"))
{
MessageBox.Show("please enter a number");
DataGridView1.Rows[i].Cells[0].Value = "";
}
else
{
MessageBox.Show("Hello");
qty = Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
if (qty > 0 && qty <=
Convert.ToInt32(DataGridView1.Rows[i].Cells[7].Value))
{
decimal d =
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value) *
Convert.ToDecimal(DataGridView1.Rows[i].Cells["actual_mrp_unit"].Value);
DataGridView1.Rows[i].Cells[1].Value = d;
decimal sum = 0;
for (int c = 0; c < DataGridView1.Rows.Count - 1; c++)
363
if (Convert.ToString(DataGridView1.Rows[c].Cells[1].Value)!=
"")
{
sum = sum +
Convert.ToDecimal(DataGridView1.Rows[c].Cells[1].Value);
MessageBox.Show(sum.ToString());
}
}
txttotal_amount.Text = sum.ToString();
string content = sum.ToString();
364
txtnet_amount.Text = Math.Round(double.Parse(sum.ToString()),
0).ToString();
txttotal_amount.Text = sum.ToString();
}
else
{
MessageBox.Show("Cannot Return This much Quantity");
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void btnrecord_Click(object sender, EventArgs e)
{
if (txtbill_number.Text == "")
{
MessageBox.Show("Please Enter Bill Number");
}
else if (txtremarks.Text == "")
{
MessageBox.Show("Please Enter Remarks");
}
365
else
{
sql = "select p_id,batch,total_qty from sales_stock";
ds1 = new DataSet();
ds1 = db.getDataTable(sql);
c = ds1.Tables[0].Rows.Count;
if (c > 0)
{
s = 0;
sql = "Select dp_return_no from DEPARTMENT_RETURN_MASTER
order by dp_return_no";
ds = new DataSet();
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
366
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
insert_and_updatestock();
}
else
{
txtNumber.Text = "DPRN1400000001";
insert_and_updatestock();
367
}
}
}
}
}
}
368
369
namespace KURJI
{
public partial class Sales_Return_Lists : Form
{
database db = new database();
public Sales_Return_Lists()
{
InitializeComponent();
}
370
371
int c = ds.Tables[0].Rows.Count;
if (c > 0)
{
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
DataGridView1.DataSource = ds.Tables[0];
sum_total();
}
else
{
MessageBox.Show("No Data Found");
}
}
else
{
string sql = "select
m.return_no,p.pat_name,m.ip_no,m.opd_no,m.return_date,csm.bill_no,m.total_
amount from Sale_Return_Master m,Admission_Detail ad,Patient_Detail
p,Cash_sale_master csm where p.opd_no=m.opd_no and csm.bill_no=m.bill_no
and m.return_date between '" +datefrom.Text + "' and '" + dateto.Text + "'";
372
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
DataGridView1.DataSource = ds.Tables[0];
sum_total();
}
else
{
MessageBox.Show("No Data Found");
}
}
}
private void btnshow_Click(object sender, EventArgs e)
{
show_list();
}
public void display()
{
if (DataGridView1.Rows.Count > 0)
{
int i;
i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
string str1 =
DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells[0].Value.ToString();
373
if (cmbreturn_type.Text == "OPD")
{
if
(DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["ip_no"].Value.ToStrin
g() == "")
{
Sales_Return_Display f = new
Sales_Return_Display(cmbreturn_type.Text, str1);
f.Show();
}
else
{
MessageBox.Show("Refresh List");
}
}
else
{
if
(DataGridView1.Rows[DataGridView1.Rows[i].Index].Cells["ip_no"].Value.ToStrin
g() != "")
{
Sales_Return_Display f = new
Sales_Return_Display(cmbreturn_type.Text, str1);
f.Show();
}
374
else
{
MessageBox.Show("Refresh List");
}
}
}
else
{
MessageBox.Show("Cannot Display");
}
}
}
private void btnnew_Click(object sender, EventArgs e)
{
Sales_Return_New f = new Sales_Return_New(cmbreturn_type.Text);
f.Show();
}
375
display();
}
else
{
display();
}
}
376
txtfrom.Text = ds.Tables[0].Rows[0][0].ToString();
txtto.Text = ds.Tables[0].Rows[c - 1][0].ToString();
DataGridView1.DataSource = ds.Tables[0];
sum_total();
}
else
{
MessageBox.Show("No Data Found");
}
}
else
{
string sql = "select
m.return_no,p.pat_name,m.ip_no,m.opd_no,csm.bill_no,m.return_date,m.total_
amount from Sale_Return_Master m,Admission_Detail ad,Cash_Sale_Master
csm,Patient_Detail p where p.opd_no=m.opd_no and csm.bill_no=m.bill_no and
csm.bill_no='" + txtbill.Text + "'";
377
DataGridView1.DataSource = ds.Tables[0];
sum_total();
}
else
{
MessageBox.Show("No Data Found");
}
}
}
}
}
378
379
380
namespace KURJI
{
public partial class Sales_Return_New : Form
{
string str,sql,str1;
database db = new database();
database db1;
DataSet ds,ds1;
int f = 0,f1=0,c=0;
decimal s = 0;
public Sales_Return_New(string returntype)
{
InitializeComponent();
str = returntype;
txtuser_id.Text = UserAccess.C_User;
381
sql = "select
p.pat_name,p.sex,p.age,m.total_amount,m.roundoff_amount,m.net_amount,m.o
pd_no,m.ip_no from Patient_Detail p,Cash_Sale_Master m where
p.opd_no=m.opd_no and m.bill_no='" + txtbill_number.Text + "'";
ds = new DataSet();
ds = db.getDataTable(sql);
int x = ds.Tables[0].Rows.Count;
382
sql = "select
p.p_nm,d.p_id,d.batch,d.issued_qty,p.p_type,p.power,pr.mrp_unit,pr.actual_mrp
_unit,pr.mfg,pr.exp,d.amount,pr.receipt_no from Product p,Purchase_Detail
pr,Cash_Sale_Detail d where p.p_id=d.p_id and pr.p_id=d.p_id and
pr.batch=d.batch and pr.receipt_no=d.receipt_no and d.bill_no='" +
txtbill_number.Text + "'";
database db1 = new database();
DataSet ds1 = new DataSet();
ds1 = db1.getDataTable(sql);
DataGridView1.DataSource = ds1.Tables[0];
txtpname.Text = ds.Tables[0].Rows[0][0].ToString();
txtsex.Text = ds.Tables[0].Rows[0][1].ToString();
txtage.Text = ds.Tables[0].Rows[0][2].ToString();
txttotal_amount.Text = ds.Tables[0].Rows[0][3].ToString();
txtrdf_amount.Text = ds.Tables[0].Rows[0][4].ToString();
txtnet_amount.Text = ds.Tables[0].Rows[0][5].ToString();
txtopd.Text = ds.Tables[0].Rows[0][6].ToString();
}
else
{
MessageBox.Show("Incorrect Bill");
}
}
else
{
383
sql = "select
p.pat_name,ad.bed,ad.ward_no,p.sex,p.age,m.total_amount,m.roundoff_amount
,m.net_amount,m.ip_no,m.opd_no from Patient_Detail p,Cash_Sale_Master
m,admission_detail ad where p.opd_no=m.opd_no and ad.ip_no=m.ip_no and
m.bill_no='" + txtbill_number.Text + "'";
ds = new DataSet();
ds = db.getDataTable(sql);
int x = ds.Tables[0].Rows.Count;
if (x > 0)
{
sql = "select
p.p_nm,d.p_id,d.batch,d.issued_qty,p.p_type,p.power,pr.mrp_unit,pr.actual_mrp
_unit,pr.mfg,pr.exp,d.amount,pr.receipt_no from Product p,Purchase_Detail
pr,Cash_Sale_Detail d where p.p_id=d.p_id and pr.p_id=d.p_id and
pr.batch=d.batch and pr.receipt_no=d.receipt_no and d.bill_no='" +
txtbill_number.Text + "'";
database db1 = new database();
DataSet ds1 = new DataSet();
ds1 = db1.getDataTable(sql);
DataGridView1.DataSource = ds1.Tables[0];
txtpname.Text = ds.Tables[0].Rows[0][0].ToString();
txtbed.Text = ds.Tables[0].Rows[0][1].ToString();
txtward.Text = ds.Tables[0].Rows[0][2].ToString();
txtsex.Text = ds.Tables[0].Rows[0][3].ToString();
txtage.Text = ds.Tables[0].Rows[0][4].ToString();
txttotal_amount.Text = ds.Tables[0].Rows[0][5].ToString();
txtrdf_amount.Text = ds.Tables[0].Rows[0][6].ToString();
384
txtnet_amount.Text = ds.Tables[0].Rows[0][7].ToString();
txtip.Text = ds.Tables[0].Rows[0][8].ToString();
txtopd.Text = ds.Tables[0].Rows[0][9].ToString();
}
else
{
MessageBox.Show("Incorrect Bill");
}
}
int i = DataGridView1.Rows.IndexOf(DataGridView1.CurrentRow);
MessageBox.Show(i.ToString());
try
{
int qty = Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
MessageBox.Show(qty.ToString());
if (qty > 0 && qty <=
Convert.ToInt32(DataGridView1.Rows[i].Cells[5].Value))
{
385
decimal d = Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value)
* Convert.ToDecimal(DataGridView1.Rows[i].Cells["actual_mrp_unit"].Value);
DataGridView1.Rows[i].Cells[1].Value = d;
decimal sum = 0;
for (int c = 0; c < DataGridView1.Rows.Count - 1; c++)
{
if ((Convert.ToString(DataGridView1.Rows[c].Cells[0].Value)) !=
"" && (Convert.ToString(DataGridView1.Rows[c].Cells[1].Value) != ""))
{
sum = sum +
Convert.ToDecimal(DataGridView1.Rows[c].Cells[1].Value);
MessageBox.Show(sum.ToString());
}
}
string content = sum.ToString();
386
txtnet_amount.Text = Math.Round(double.Parse(sum.ToString()),
0).ToString();
txttotal_amount.Text = sum.ToString();
}
else
{
MessageBox.Show("Cannot Return this much Quantity");
}
}
catch
{
MessageBox.Show("Please Select a Row");
}
}
387
MessageBox.Show(s.ToString());
sql = "insert into sale_return_detail values('" + txtNumber.Text + "',"
+ Convert.ToInt32(DataGridView1.Rows[k].Cells[3].Value) + ",'" +
DataGridView1.Rows[k].Cells[4].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[0].Value) + ",'" +
DataGridView1.Rows[k].Cells[13].Value + "'," +
Convert.ToDecimal(DataGridView1.Rows[k].Cells[1].Value) + ")";
db.ExecuteOrcl(sql);
sql = "insert into sales_stock values('" +
DataGridView1.Rows[k].Cells[13].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[3].Value) + ",'" +
Convert.ToString(DataGridView1.Rows[k].Cells[4].Value) + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[0].Value) + ")";
db.ExecuteOrcl(sql);
}
}
if (f1 == 1)
{
sql = "insert into
sale_return_master(return_no,return_date,remarks,total_amount,roundoff_amo
unt,net_amount,user_id,opd_no,bill_no) values('" + txtNumber.Text + "','" +
txtdate.Text + "','" + txtremarks.Text + "'," + decimal.Parse(txttotal_amount.Text)
388
MessageBox.Show(s.ToString());
sql = "insert into sale_return_detail values('" + txtNumber.Text + "',"
+ Convert.ToInt32(DataGridView1.Rows[k].Cells[3].Value) + ",'" +
DataGridView1.Rows[k].Cells[4].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[0].Value) + ",'" +
DataGridView1.Rows[k].Cells[13].Value + "'," +
Convert.ToDecimal(DataGridView1.Rows[k].Cells[1].Value) + ")";
389
db.ExecuteOrcl(sql);
sql = "insert into sales_stock values('" +
DataGridView1.Rows[k].Cells[13].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[3].Value) + ",'" +
Convert.ToString(DataGridView1.Rows[k].Cells[4].Value) + "'," +
Convert.ToInt32(DataGridView1.Rows[k].Cells[0].Value) + ")";
db.ExecuteOrcl(sql);
}
}
if (f1 == 1)
{
sql = "insert into
sale_return_master(return_no,return_date,remarks,total_amount,roundoff_amo
unt,net_amount,user_id,ip_no,opd_no,bill_no) values('" + txtNumber.Text + "','" +
txtdate.Text + "','" + txtremarks.Text + "'," + decimal.Parse(txttotal_amount.Text)
+ "," + decimal.Parse(txtrdf_amount.Text) + "," +
decimal.Parse(txtnet_amount.Text) + ",'" + txtuser_id.Text + "','" + txtip.Text + "','"
+ txtopd.Text + "','" + txtbill_number.Text + "')";
db.ExecuteOrcl(sql);
}
else
{
MessageBox.Show("Please enter the Quantity and Press Tab to
calculate");
}
390
}
public void insert_cash_saleip()
{
for (int i = 0; i < DataGridView1.Rows.Count - 1; i++)
{
MessageBox.Show("hello");
MessageBox.Show(c.ToString());
for (int x = 0; x < c; x++)
{
MessageBox.Show(x.ToString());
MessageBox.Show("hello again");
Int32 pid = Convert.ToInt32(ds1.Tables[0].Rows[x]["p_id"]);
string batch = Convert.ToString(ds1.Tables[0].Rows[x]["batch"]);
Int32 qty = Convert.ToInt32(ds1.Tables[0].Rows[x]["total_qty"]);
if ((Convert.ToString(DataGridView1.Rows[i].Cells[0].Value)) != ""
&& (Convert.ToString(DataGridView1.Rows[i].Cells[1].Value) != ""))
{
MessageBox.Show("no quantity");
f1 = 1;
string str6 =
Convert.ToString(DataGridView1.Rows[i].Cells[4].Value);
if (pid == Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value)
&& (str6 == batch))
{
MessageBox.Show("matched");
391
f = 1;
MessageBox.Show(s.ToString());
sql = "insert into sale_return_detail values('" + txtNumber.Text
+ "'," + Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value) + ",'" +
DataGridView1.Rows[i].Cells[4].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value) + ",'" +
DataGridView1.Rows[i].Cells[13].Value + "'," +
Convert.ToDecimal(DataGridView1.Rows[i].Cells[1].Value) + ")";
db.ExecuteOrcl(sql);
qty = qty +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
MessageBox.Show(batch);
MessageBox.Show(qty.ToString());
sql = "update sales_stock set total_qty=" + qty + " where
p_id=" + pid + "and batch='" + batch + "'";
db.ExecuteOrcl(sql);
}
if (f1 == 1)
392
{
MessageBox.Show("not inserted");
sql = "insert into
sale_return_master(return_no,return_date,remarks,total_amount,roundoff_amo
unt,net_amount,user_id,ip_no,opd_no,bill_no) values('" + txtNumber.Text + "','" +
txtdate.Text + "','" + txtremarks.Text + "'," + decimal.Parse(txttotal_amount.Text)
+ "," + decimal.Parse(txtrdf_amount.Text) + "," +
decimal.Parse(txtnet_amount.Text) + ",'" + txtuser_id.Text + "','" + txtip.Text + "','"
+ txtopd.Text + "','" + txtbill_number.Text + "')";
db.ExecuteOrcl(sql);
}
else
{
MessageBox.Show("Please enter the Quantity and Press Tab to
calculate amount");
}
}
public void insert_cash_saleop()
{
for (int i = 0; i < DataGridView1.Rows.Count - 1; i++)
{
393
if ((Convert.ToString(DataGridView1.Rows[i].Cells[0].Value)) != ""
&& (Convert.ToString(DataGridView1.Rows[i].Cells[1].Value) != ""))
{
f1 = 1;
string str6 =
Convert.ToString(DataGridView1.Rows[i].Cells[4].Value);
if ((pid == Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value)
&& (str6 == batch)))
{
f = 1;
MessageBox.Show("From OPD");
MessageBox.Show(s.ToString());
sql = "insert into
sale_return_detail(return_no,p_id,batch,return_qty,receipt_no,total_amount)
values('" + txtNumber.Text + "'," +
Convert.ToInt32(DataGridView1.Rows[i].Cells[3].Value) + ",'" +
DataGridView1.Rows[i].Cells[4].Value + "'," +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value) + ",'" +
DataGridView1.Rows[i].Cells[13].Value + "'," +
Convert.ToDecimal(DataGridView1.Rows[i].Cells[1].Value) + ")";
394
db.ExecuteOrcl(sql);
qty = qty +
Convert.ToInt32(DataGridView1.Rows[i].Cells[0].Value);
MessageBox.Show(qty.ToString());
sql = "update sales_stock set total_qty=" + qty + " where
p_id=" + pid + "and batch='" + batch + "'";
db.ExecuteOrcl(sql);
}
}
if (f1 == 1)
{
sql = "insert into
sale_return_master(return_no,return_date,remarks,total_amount,roundoff_amo
unt,net_amount,user_id,opd_no,bill_no) values('" + txtNumber.Text + "','" +
txtdate.Text + "','" + txtremarks.Text + "'," + decimal.Parse(txttotal_amount.Text)
+ "," + decimal.Parse(txtrdf_amount.Text) + "," +
decimal.Parse(txtnet_amount.Text) + ",'" + txtuser_id.Text + "','" + txtopd.Text +
"','" + txtbill_number.Text + "')";
395
db.ExecuteOrcl(sql);
}
else
{
MessageBox.Show("Please enter the Quantity And Press Tab to
calculate amount");
}
396
if (str == "OPD")
{
sql = "Select return_no from sale_return_master order by
return_no";
ds = new DataSet();
ds = db.getDataTable(sql);
397
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
insert_cash_saleop();
398
else
{
txtNumber.Text = "CSRN1400000001";
insert_cash_saleop();
}
}//else closed of p>0
else
{
sql = "Select return_no from sale_return_master order by
return_no";
ds = new DataSet();
ds = db.getDataTable(sql);
int p = ds.Tables[0].Rows.Count;
int j = ds.Tables[0].Rows.Count - 1;
if (p > 0)
{
399
int l = int.Parse(str1) + 1;
MessageBox.Show(l.ToString());
insert_cash_saleip();
}
else
{
txtNumber.Text = "CSRN1400000001";
insert_cash_saleip();
}
400
}
}//c closed
}
}
}
}
401
Code
Efficiency
maintained
and
compact
enough
to
run
402
403
Validation Checks
validation
check
to
prevent
invalid
405
Type of information
Completeness check
performed
several
required to be entered
whenever
fields
were
before processing.
This
Format check
We
checked
all
the
check
was
fields
containing
This
performed
numeric
fields.
minimum
check
was
on
all
data
and
with
all
and
maximum values.
Check digit check
Applied
Check
digits
numeric codes.
added
to
were
numeric
codes.
Consistency check
This
was
ensure
done
that
combination
of
This
to
the
was
whenever
applied
the
data
were related.
data
were valid.
406
Database check
This
was
applied
to
database
to
ensure
their correctness.
Testing
407
408
CONCLUSION
410
for
the
smooth
and
easy
working
of
411
Bibliography
While developing my project I have taken help
from persons and also consulted with books. The books
lists are as follows:
412
413