You are on page 1of 118

SNDT Women’s University,Mumbai

BACHELOR OF COMPUTR APPLICATION

Regal college of technology


(Kondhe) Chiplun, Dist-Ratnagiri
2015-2016

A
PROJECT REPORT
ON
“pet shop management
system” Under the guidance of
Mrs. Reshma More

Submitted by

Miss. Akshaya Subhash Kadam

1
CERTIFICATE
This is certify that the project report entitled,

“PET SHOP MANAGEMENT SYSTEM”

Has been successfully completed & it embodies the


Genuine & Original work submitted by,

Miss. Akshaya Subhash Kadam


In the partial fulfillment of requirement of

BACHELOR OF COMPUTER
APPLICATION
DATE:

MRS. MORE RESHMA MRS.MORE RESHMA


(Project Guide) (H.O.D)

PRINCIPAL EXTERNAL

2
EXAMINER

Index
Table of Contents
Sr. No Phase Name Page No.
1. Preliminary Investigation 4
1.1 Acknowledgement 5
1.2 Organizational Overview 6
1.3 Current System 7
1.4 Limitations Of the system 7
1.5 Scope of proposed system 7
1.6 Advantage of proposed system 8
1.7 Feasibility Study 9
1.8 Gantt Chart 11
2. System Analysis 12
2.1 Fact Finding Techniques 13
2.2 Event Table 14
2.3 Use Case 18
2.4 Activity Diagram 24
2.5 Class Diagram 32
2.6 Object Diagram 35
2.7 Sequence Diagram 41
2.8 Collaboration Diagram 52
3. System Design 57
3.1 Derived Tables from entities and relationships 58
3.2 Deployment Diagram 63
3.3 Component Diagram 64
3.4 System Flow Chart 65
4. System Coding 66
4.1 Menu Tree 67
4.2 Test Cases, Test Data, Test Result 68
4.3 Program Descriptor 81
4.4 Code 88
4.5 Screen Layout 113
4.6 Hardware & Software requirement 116
4.7 References & Bibliography 117
3
Phase – 1
4
Preliminary
Investigation

Acknowledgement

We here by taken an opportunity to express our deep sense


of gratitude to Mrs. Reshma More for her valuable
guidance and esteemed suggestion along with constant
encouragement during each of our project,which enabled
this project work to be successful.
We are thankful to our beloved H.O.D Mrs. Reshma
More for this continuous encouragement and valuable
advice.

5
Your’s sincerely,
MISS. AKSHAYA SUBHASH KADAM .

Date:

Organizational Overview
Name of organization: -
“Sai Pet
Shop”

Address:-
At Post (Markandi)
Tal –chiplun Dist - Ratnagiri

Contact No:-
9587440344
6
This project is made for the Sai Pet shop,which is one
of the popular Pet shop in Chiplun city.

This Pet shop was established in 2011 in


Chiplun Mr. Keralkar is the profiler of Pet shop.

Since 2011 this Pet shop is providing a very


good service to its own area and other places

Study Of Current
System
This project is of Computer System for Pet Shop
Management. Their current system is also manual system.
But this current system is very lass user friendly and
it have no facility of printed pay slip so whenever client comes
then receptionist first fill up all the information on computer
and then prepares the receipt manually .
This procedure consumes so much valuable time of
receptionist as well as client. In the existing system assigning
appointment to individual client and maintaining their daily
records is a time consuming process .
Pet shop manager has to manually maintain record
of client and pet in the form of case paper.

7
Limitations Of Current
System
 Maintaining register s very tedious and time
making job.
 Mistakes can happen while rewriting into in
register.
 One can make error while calculations bill amount
in hand.
 Any charge in staff information required.

Proposed System
This system is designed for Pet Shop Management.
The scope of the system includes:

 Proposed system is able to allot & maintain record of client &


pet.
 Proposed system accepts client information and generate client
Id.
 Proposed system prepares reports of pet.
 Proposed system helps the user to generate consulting doctor
receipt.

8
 In proposed system all receipt of a pet are generated by
receptionist

Advantages & Drawbacks of


Proposed System

 Proposed system is fully computerized. Proposed system


has following advantages.
 Proposed system reduced paper work.
 The manual receipt generation takes lot of time. Proposed
system overcome this problem by providing printed
receipt generation.
 Proposed system through generated report help the
manager to maintain history of pet and client detail.
 Proposed system is more users friendly.

Drawbacks
 The only drawbacks of this system are that the
system has no central database.

 This application is flexible and central database


can be implemented using technology like
VB.Net.

9
FEASIBILTY STUDY

Feasibility study is the system proposal according to its


work ability impaction the organization to meet the user needs
and effective use of the resources. The following point need to
be considered while studying the feasibility of the proposed
system.

Technical feasibility
The proposed system that has developed is found technology feasible for
the Pet shop system .The hardware and software resources are easily available to
the branch. The staff has efficient knowledge of hardware and software
technology, so there is no need to depend on outside experts.

Operational feasibility
 Operational feasibility measures of how will the applications well work in
organization. Required operational skills and expertise is already been
available with the firm. Operational feasibility of the system can be
ensuring through the following:

 The user of the system can be trained to use the application system adjust
with the new environment, so that they are capable to work on the new
system.
 User friendliness of the proposed system makes the user to do the work
efficiently.
 System work smoothly without any difficulties.
 Well documentation of the proposed system gives complete idea about the
system design to the user.

10
 So the proposed system has the support by applicants who makes
application . So the system is operationally feasible.

Economic feasibility
Economic feasibility is most important from the point of any system.
Before finalizing the decision it should be seen that whether the proposed system
is financial viable or not. Cost-benefit analysis is required to be carried out.
In case of the present system, it found as the firm’s business is
increasing day to day they should go far computerized system. The cost of
hardware and software is affordable to the branch.
The cost of development and maintenance of the system is justifiable to
the use and benefits of the owner.
As the existing system will be replace by the computerized one the
computerized one the complexities and difficulties will be reduced significantly.

Gantt chart
Sr.No Phase Expected Date of Completion Actual date Remark
of
Completion
1 Preliminary Investigation

A Organizational 20th June


Overview
B Limitations of current 25th June
System advantages of

11
proposed system
C Feasibility Study 30th June
2 System Analysis
A Fact finding 5th July
B Even Table 25th Nov
C Use Case Diagram 30th Nov
D Activity Diagram 5th Dec
E Class Diagram 10th Dec
F Object Diagram 15th Dec
G Sequence/Collaboration 20th Dec
Diagram
3 System Design
A Derive Tables from 3rd Jan
entities and relationships
B Component Diagram 5th Jan
C Package Diagram 8th Jan
D Deployment Diagram 12th Jan
E Form/Report Layouts 15th Jan
4 System Coding
A Design database(tables 20th Jan
with attributes &
constraints)
B Coding 20th Feb
C Test cases and 25th Feb
Validations
5 Soft Copy Submission 1st March
6 System Implementation 5th March
7 Project Review 7th March
8 Project Report 10th March
Submission

12
Phase - 2
13
System Analysis

Fact finding technique


(Interviewing)
1) Is Your System Manual or Computerized?
 Manual.

2) How do you Maintain records?


 By Keeping Registers.

3) How do you search previous record?


 As records are maintained in registers, we search through
registers which is a tedious job.

4) How do you maintain Information of client?


 By keeping records in the register.

14
5) How do you maintain Information of vendor?
 By keeping records in the register.

6) How do you generate bill?


 By using a bill book. We keep one copy and give another
to the client.

Event Table:
Sr. Event Trigger Source Activity Response Destination
1 Add new New Admin Create new New client Admin
client client client record record is
record details addad
2 Search Searching Admin Search for Display Admin
client client client details client
records details details
3 Update Updating Admin i. Search for Client Admin
client client client record is
record details details updated
ii. Update
client
record
4 Delete Deleting Admin i. Search for Client Admin
client client client record is
record details details deleted
ii. Delete
client
details
5 Add new New Admin Create new New Admin
vendor vendor vendor record vendor
record details record is
addad

15
6 Search Searching Admin Search for Display Admin
vendor vendor vendor details vendor
records details details
7 Update Updating Admin i. Search for Vendor Admin
vendor vendor vendor record is
record details details updated
ii. Update
vendor
record
8 Delete Deleting Admin i. Search for Vendor Admin
vendor vendor vendor record is
record details details deleted
ii. Delete
vendor
details
9 Add new New Admin Create new New Admin
employee employee employee record employee
record details record is
added
10 Search Searching Admin Search for Display Admin
employee employee employee details employee
records details details
11 Update Updating Admin i. Search for Employee Admin
employee employee employee record is
record details details updated
ii. Update
employee
record
12 Delete Deleting Admin i. Search for Employee Admin
employee employee employee record is
record details details deleted
ii. Delete
employee
details
13 Add new New pet Admin Create new pet New pet Admin
pet record details record record is
added
14 Search pet Searching Admin Search for pet Display pet Admin
records pet details details details

16
15 Update pet Updating Admin i. Search for Pet record Admin
record pet details pet details is updated
ii. Update pet
record
16 Delete pet Deleting Admin i. Search for Pet record Admin
record pet details pet details is deleted
ii. Delete pet
details
17 Add new New Admin Create new New Admin
purchase purchase purchase purchase
product details products record product
record record is
added
18 Search Searching Admin Search for Display Admin
purchase purchase purchase product purchase
product product details product
records details details
19 Update Updating Admin i. Search for Purchase Admin
purchase purchase purchase product
record product product record is
details details updated
ii. Update
purchase
product
record
20 Delete Deleting Admin i. Search for Purchase Admin
purchase purchase purchase product
product product product record is
record details details deleted
ii. Delete
purchase
product
details
21 Add new New stock Admin Create new stock New stock Admin
stock details record record is
added
22 Search Searching Admin Search for stock Display Admin
stock stock details stock
records details details

17
23 Update Updating Admin i. Look up Stock Admin
stock stock product record is
record details availabilit updated
y
ii. Search for
stock
details
iii. Update
stock
Record
24 Delete Deleting Admin i Search for Stock Admin
stock stock stock record is
record details details deleted
ii Delete
stock
details
25 Add new New order Admin Create new order New order Admin
order details record record is
record added
26 Search Searching Admin Search for order Order Admin
order order details record is
records details searched
27 Update Updating Admin i Search for Order Admin
order order order record is
record details details updated
ii Update
order
record
28 Delete Deleting Admin i Search for Order Admin
order order order record is
record details details deleted
ii Delete
order
details
29 Generate Generating Admin Generate bill/ Bill Admin
bill bill Calculate bill generated
30 Search bill Search old Admin Search for bill Bill found Admin
bill

18
31 Update bill Change Admin i search bill Bill Admin
bill details ii update bill updated

Use Case Diagram

19
Admin

Manage Customer Record

20
Manage Supplier Record

Manage Pet Record

21
Manage Purchase Product Record

Manage Stock Record

22
Manage Customer Order Record

Manage Supplier Order Record

23
Manage Employee Record

Manage Customer Bill Record

24
Activity Diagram

25
1) Customer
a) Add new customer

b) Update customer details

c) Delete customer details

26
2) Supplier
a) Add new supplier

b) Update supplier details

27
C) Delete supplier details

3)Employee
28
a) Add new employee

b) Update employee details

c) Delete employee details


29
4)Order from customer

5)Cancel customer order

30
6) Generate order for supplier

7)Received Order
31
8)Generate customer bill

32
9)Update customer

33
Class Diagrams:

Customer Supplier

Cust_id:numeric supp_id:numeric
Cust_name:varchar supp_name:varchar
cust_adds:varchar supp_adds:varchar
contact_no:numeric contact_no:numeric

Add():structure Add():structure
Update():void Update():void
Delete():void Delete():void
Delete():text

Employee Product
emp_id:numeric prod_id:numeric
emp_name:varchar prod_name:varchar
emp_adds:varchar prod_type:text
contact_no:numeric
New_prod:structure
Add():structure Update():void
Update():void Delete():void
Delete():void

Stock Pet

Prod_id:numeric pet_id:numeric
Prod__name:varchar pet_type:varchar
quantity:numeric pet_color:varchar
prod_weight:numeric pet_price:numeric
34
Update Stock():null Add():structure
Update():void
Delete():void
Bill

Bill_no:numeric
Bill_date:date
Cust_id:numeric
Cust_name:varchar
Prod_qty:numeric
Total_amt:numeric

Create_bill():void
Print():void

Order

order_no:numeric
order_date:date
prod_list:varchar
Tax:numeric
discount:numeric
Total_amt:numeric

Create_order():void
Update():void
Delete():void

35
Class Association Diagram

1
Employee 1 * Customer

1 1 1 1

* Pet *

Supplier

1
*
Product
*
*

1 1 1
1 1 1 1
Stock Customer Order
Supplier Order
1

1
Customer Bill

36
Object Diagrams
1) One employee has one or many pet

P1:Pet

Pet_id:101
Pet_type:cat
Pet_color:white
Pet_price:3000

e:Employee P2:Pet

emp_id:111 Pet_id:102
emp_name:Abhishek Pet_type:cat
emp_address:pune Pet_color:white
emp__salary:5000 Pet_price:3000
cont__no:922297390

P3:Pet

Pet_id:101
Pet_type:cat
Pet_color:Brown 37
Pet_price:000
2) One customer has one or many pet

P1:Pet

Pet_id:101
Pet_type:cat
Pet_color:white
Pet_price:3000

C: Customer
P2:Pet
Cust_id:1
Pet_id:102
Cust_Name: abc
Pet_type:cat
Cust_Addr: chiplun
Pet_color:white
ContactNo: 258027
Pet_price:3000

P3:Pet

Pet_id:103
Pet_type:cat 38
Pet_color:white
Pet_price:3500
3) One stock has one or many product

p1:product

prod_id:101
prod_name:cat

s1:stock p2product

prod_id:101
prod_name:cat prod_id:102
prod_quant:10 prod_name:cat
prod_weight:8kg

p3:product

prod_id:103
prod_name:cat

4) One employee has one stock


e:Employee s:stock

emp_id:111 prod_id:101
emp_name:Ankita prod_name:cat
emp_address:chiplun prod_quant:10
emp_salary:5000 39
prod_weight:8kg
cont_no:56669930
5) One employee to many customer

o:supplier order
6)s:supplier
One supplier has one supplier order
order_id:100
supplier_id:111 order_date:11 jan 2014
supplier_name:Amit supplier_name:sachin
supplier_address:chiplun prod_name:pet 40
cont_no:56669930 prod_quantity:10
prod_weight:kg
7) One employee to many product

p1:product

prod_id:101
prod_name:cat
prod_price:5000

e:Employee p2:product

emp_id:111
emp_name:Ankita prod_id:102
emp_address:chiplun prod_name:cat
emp_salary:5000 prod_price:4000
cont_no:56669930

p3:product

prod_id:103
prod_name:cat
prod_price:4500

8) One customer order to one customer bill

41
B:customer bill
o:customer order

bill_id:101
order_id:100 date:11 feb 2016
order_date:11 jan 2014 customer_name:shakti
customer_name:Amar cont_no:8778447780
prod_name:pet pet_type:cat
prod_quantity:10 pet_color:black
prod_weight:kg pet_price:4000

9) One supplier order to many products

p1:product

prod_id:101
prod_name:cat
prod_price:4500

o:supplier order

p2:product
order_id:100
order_date:11 jan 2014
supplier_name:sachin
prod_id:102
prod_name:pet
prod_name:cat
prod_quantity:10
prod_price:4500
prod_weight:kg

p3:product

prod_id:103
prod_name:cat
prod_price:4500

42
Sequence Diagrams:

1) Add new customer

43
2) Update customer record

44
3) Delete customer record:

45
4) Add new supplier

5) Update supplier record:

46
6) Delete supplier record:

47
7) Add new employee

48
8) Update employee record:

9) Delete employee record:

49
10) Add new pet

50
11) Update pet Record

12) Delete Pet Record

51
13) Add stock record

14) Update stock record

52
15) Add purchase_order record

16) Update purchase_order record

53
Collaboration Diagrams:
54
1) Add customer record

2) Update customer record

3) Delete customer record

4) Add supplier record


55
5) Update supplier record

6) Delete supplier record

7) Add employee record

8) Update employee record


56
9) Delete employee record

10) Add pet record

:User Interface :Pet


1.add pet record 1.1 add pet()

:Admin

11) Update pet record


1.1search pet
1update pet record 1.2edit pet
1.3update pet
:User Interface :Pet

57
12) Generating order

13) putting supplier order

58
14) Receive order

59
Phase – 3
System
Design

Derive Table From Entities & Relationship

60
1) Customer Details

Field Name Data Type Description Attributes


Customer Id Number Hold customer Id Field size=50
Customer Name Text Hold customer name Field size=50

Customer Address Text Hold customer address Field size=50

Contact Number Number Hold contact number Field size=50

2) Supplier Details
Field Name Data Type Description Attributes
Supplier Id Number Hold supplier Id Field size=50
Supplier Name Text Hold supplier name Field size=50

Supplier Address Text Hold supplier address Field size=50

Contact Number Number Hold contact number Field size=50

3) Pet Details
Field Name Data Type Description Attributes
Pet Type Text Hold Pet type Field size=50
Pet Id Number Hold Pet Id Field size=50
Pet Color Text Hold Pet color Field size=50
Pet Status Text Hold Pet status Field size=50
Pet Price Number Hold Pet price Field Size=50

4) Products Details
61
Field Name Data Type Description Attributes
Product Id Number Hold product Id Field size=50
Product Name Text Hold product name Field size=50

5) Stock Details
Field Name Data Type Description Attributes
Product Id Number Hold product Id Field size=50
Product Name Text Hold product name Field size=50
Product Quantity Number Hold product quantity Field size=50
Product Weight Number Hold product weight Field size=50

6) Customer Order Details


Field Name Data Type Description Attributes
Order Id Number Hold order Id Field size=50
Order Date Datetime Hold order date Field size=50
Customer Name Text Hold customer name Field size=50
Pet Id Number Hold Pet Id Field size=50
Pet Name Text Hold pet name Field size=50
Pet color Text Hold Pet color Field size=50
Pet status Text Hold Pet status Field size=50

7) Supplier Order Details


Field Name Data Type Description Attributes
Order Id Number Hold order Id Field size=50
Order Date Datetime Hold order date Field size=50

62
Supplier Name Text Hold supplier name Field size=50
Product Name Text Hold product name Field size=50
Product Quantity Number Hold product quantity Field size=50
Product Weight Number Hold product weight Field size=50

8) Employee Details
Field Name Data Type Description Attributes
Employee Id Number Hold employee Id Field size=50
Employee Name Text Hold employee name Field size=50

Employee Address Text Hold employee address Field size=50


Employee Salary Number Hold employee salary Field Size=50
Contact Number Number Hold contact number Field size=50

9) Customer Bill Details


Bill Id Number Hold bill Id Field size=50
Date Datetime Hold date Field size=50
Customer Name Text Hold customer name Field size=50
Contact Number Number Hold contact number Field size=50
Pet Type Text Hold pet type Field size=50
Pet Id Number Hold Pet Id Field size=50
Pet color Text Hold Pet color Field size=50
Pet Status Text Hold Pet Status Field size=50
Pet Price Number Hold Pet Price Field size=50
Total Number Hold total Field size=50

Deployment Diagram:
63
DB:Database

AAAAAAAAAAAAAAA
Application Server:

SysAdmin:Executable

CommonApps:
Executable

User1:Admin

Printer

Component Diagram
64
System Flow Chart

65
Maintain customer info
Add Customer
customer

Maintain supplier info


Supplier
Add
supplier

Maintain supplier order


Supplier order
Supplier
order

Maintain stock info


Stock
Stock

Maintain bill info


Billing
Billing

Maintain employee info


Employe Employee
e

Maintain product info


Product Product

Maintain customer
Put order Customer
custome order
r

jorder
66
order
Phase - 4
System Coding

Menu Tree

Customer
67
Supplier
Entry
Form
Employee

Product

Stock
Customer
Stationery Order
Management Order
System Vendor
Order

SaleBill

Notepad
Utility
Calculator

Report
Program descriptor with naming convention
1) class : login form
Login form is to hold all information about login.
Naming Description
68
Username This naming convention is used
to stored the username
Password This naming convention is used
to stored the password
 Function:
1. Login: This function gives the access to program application
2. Exit: This function close the login form.

2) Class : Customer form

Naming Description
Customer Id This naming convention is
used to stored the customer id
Customer Name This naming convention is
used to stored the customer
name
Customer Address This naming convention is
used to stored the customer’s
address
Contact Number This naming convention is
used to stored the customer’s
contact number

 Function:
1. Add: this function add the customer record
2. Update: this function update the customer record
3. Delete: this function delete the customer record
4. Search: this function search the customer record

3) Class: Supplier form


Supplier form is hold all information about supplier.
Naming Description

69
Supplier Id This naming convention is
used to stored the supplier id
Supplier Name This naming convention is
used to stored the supplier
name
Supplier Address This naming convention is
used to stored the supplier
address
Contact Number This naming convention is
used to stored the Contact
Number
 Function:
1) add: this function add the supplier record
2) update: this function update the supplier record
3) delete: this function delete the supplier record
4) search: this function search the supplier record

4) Class: Pet form


Pet form is hold all information about Pet.

Naming Description
Pet Type This naming convention is
used to stored the Pet type
Pet Color This naming convention is
used to stored the Pet flavor

Pet Weight This naming convention is


used to stored the Pet weight
Pet Quantity This naming convention is
used to stored the Pet quantity
Pet Price This naming convention is
used to stored the Pet price

 Function:
70
1) add: this function add the Pet record
2) update: this function update the Pet record
3) search: this function search the Pet record

5) Class: Products form


Products form is hold all information about product.
Naming Description
Product Id This naming convention is
used to stored the product id
Product Name This naming convention is
used to stored the product
name

 Function:
1) add: this function add the product record
2) update: this function update the product record
3) search: this function search the product record

6) Class: Stock form


Stock form is hold all information about stock.
Naming Description
Product Id This naming convention is
used to stored the product id
Product Name This naming convention is
used to stored the product
name
Product Quantity This naming convention is
used to stored the product
quantity

71
Product Weight This naming convention is
used to stored the product
weight
 Function:
1) update: this function update the stock record

7) Class: Customer Order form


Customer Order form is hold all information about customer order.
Naming Description
Order Id This naming convention is
used to stored the order id
Order Date This naming convention is
used to stored the order date
Customer Name This naming convention is
used to stored the customer
name
Pet Type This naming convention is
used to stored the Pet type

Pet Color This naming convention is


used to stored the Pet color

Pet Weight This naming convention is


used to stored the Pet weight
Pet Quantity This naming convention is
used to stored the Pet
quantity

 Function:
1) add: this function add the customer order record
2) update: this function update the customer order record
3) cancel: this function cancel the customer order record
4) search: this function search the customer order record

72
8) Class: Supplier Order form
Supplier Order form is hold all information about supplier order.
Naming Description
Order Id This naming convention is
used to stored the order id
Order Date This naming convention is
used to stored the order date
Supplier Name This naming convention is
used to stored the supplier
name
Product Name This naming convention is
used to stored the product
name
Product Quantity This naming convention is
used to stored the product
quantity
Product Weight This naming convention is
used to stored the product
weight
 Function:
1) add: this function add the supplier order record
2) update: this function update the supplier order record
3) cancel: this function cancel the supplier order record
4) search: this function search the supplier order record

9) Class: Employee form


Employee form is hold all information about employee.
Naming Description
Employee Id This naming convention is
used to stored the employee id
Employee Name This naming convention is
used to stored the employee
name

73
Employee Address This naming convention is
used to stored the employee
address
Employee Salary This naming convention is
used to stored the employee
salary
Contact Number This naming convention is
used to stored the Contact No.
 Function:
1) add: this function add the employee record
2) update: this function update the employee record
3) delete: this function delete the employee record
4) search: this function search the employee record

10) Class: Customer Bill form


Customer Bill form is hold all information about
customer bill.

Naming Description
Bill Id This naming convention is
used to stored the order id
Date This naming convention is
used to stored the date
Customer Name This naming convention is
used to stored the customer
name
Contact Number This naming convention is
used to stored the contact
number
Pet Type This naming convention is
used to stored the Pet type
Pet Color This naming convention is
used to stored the Pet color

74
Pet Weight This naming convention is
used to stored the Pet weight
Pet Quantity This naming convention is
used to stored the Pet quantity
Pet Price This naming convention is
used to stored the Pet price
Total This naming convention is
used to stored the total
 Function:
1) add: this function add the customer bill record
2) update: this function update the customer bill record
3) search: this function search the customer bill record

Test case and validation


Test Testing Assumption Test data Step to test Excepted result Actual result Pass/F
case unit ail
no
Username=”text” Username=”Admin” 1)open login Display message Display Pass
Password=”num” Password=”12345” form “welcome” message
2)enter “welcome”
username and
password
3)click ok
1 Login Username=” Admin“ Username=” “ Step:1] ,2],3] Display message Display Pass
module Password=” 12345” Password=” “ “please enter message
username” ”please enter
username”
Username=”12345” Step:1] ,2],3] Display message Display Pass
Password=”23415” ”invalid login” message
”invalid login”
Username=”Admin” Step:1] ,2],3] Display message Display Pass
Password=” “ “please enter message “
password” please enter
password”
2 Customer C id=“number” C id=“1” 1)open Display message Display Pass
module C name=”text” C name=” rohan” customer form “record saved message
Address=”text” Address=”khed” 2)fill all successfully” “record saved
Contact no=”number” Contact details successfully”
no=”5690348954” 3)click ok

C id=” er“ Step:1] ,2],3] Display message Display Pass

75
“please enter message
number” “please enter
number”
C name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
Contact no=”106” Step:1] ,2],3] Display message Display Pass
”at most 10 digit message “ at
are require” most 10 digit
are require”
C id=”1” Step:1] ,2],3] Display message Display Pass
C name=” “ “fill all details” message=”fill
Address=” “ all details”
Contact
no=”4567890234”

3 Supplier S id=“number” s id=“1” 1)open Display message Display Pass


module S name=”text” s name=” rohan” supplier form “record saved message
S Address=”text” S Address=”khed” 2)fill all successfully” “record saved
Contact no=” Contact details successfully”
number” no=”5690348954” 3)click ok

s id=” er“ Step:1] ,2],3] Display message Display Pass


“please enter message
number” “please enter
number”
s name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
Contact no=”106” Step:1] ,2],3] Display message Display Pass
”at most 10 digit message “ at
are require” most 10 digit
are require”
s id=”1” Step:1] ,2],3] Display message Display Pass
s name=” “ “fill all details” message=”fill
Address=” “ all details”
Contact
no=”4567890234”

4 Pet Pet type=”text” Pet type=”veg” 1)open Pet Display message Display Pass
module Pet color=”text” Pet color=”white” form “record saved message
Pet weight=”num” Pet weight=”10” 2)fill all successfully” “record saved
Pet status=”num” Pet status=”available” details successfully”
Pet price=”num” Pet price=”3000” 3)click ok
Pet type=” 2“ Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet color= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
Pet weight=”abc” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
Pet status=”65” Step:1] ,2],3] Display message Display Pass
“please enter message

76
character” “please enter
number”
Pet price=”fghg” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
Pet type=”cvvv ” Step:1] ,2],3] Display message Display Pass
Pet color=”abc ” “fill all details” message=”fill
Pet weight=” ” all details”
Pet status=” ”
Pet price=” ”
5 Product p id=“number” p id=“1” 1)open Display message Display Pass
module p name=”text” p name=” abc” product form “record saved message
2)fill all successfully” “record saved
details successfully”
3)click ok
p id=” er“ Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
P name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
p id=”1” Step:1] ,2],3] Display message Display Pass
p name=” “ “fill all details” message=”fill
all details”
6 Stock P id=“number” p id=“1” 1)open stock Display message Display Pass
module P name=”text” p name=”avbc” form “record saved message
P status=”number” p status= “60” 2)fill all successfully” “record saved
P weight=”number” P weight=”10” details successfully”
3)click ok
P id=” er“ Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
P name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
P status=”a” Step:1] ,2],3] Display message Display Pass
”please enter message “
number” please enter
number”
P weight=”a” Step:1] ,2],3] Display message Display Pass
”please enter message “
number” please enter
number”
P id=”1” Step:1] ,2],3] Display message Display Pass
P name=” “ “fill all details” message=”fill
P status=”70 “ all details”
P weight=” ”

7 Cust O id=”number” O id=”1” 1]open order Display message Display Pass


Order O date=”date” O date=”14/11/2012 form “record saved message
module Cust name=”text” Cust name=”pooja” 2]fill all successfully” “record saved
Pet type= “text” Pet type= “cat” information successfully”
Pet status= “number” Pet status= “available” 3]click ok
Pet color=”text” Pet color=”black”
Pet weight=”number” Pet weight=”5”
O id= “ret” Step:1] ,2],3] Display message Display Pass

77
“please enter message
number” “please enter
number”
O date= “14/3/” Step:1], 2],3] Display message Display Pass
“please enter message
year” “please enter
year”
Cust name= “134” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet type=”h67h” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet status=”566” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
number”
Pet color=” 143” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet weight=”tyre” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
O id=”1” Step:1], 2],3] Display message Display Pass
O date=” ” “fill all message “fill all
Cust name=”pooja” information” information”
Pet type= “cat”
Pet status= “1”
Pet color=”black”
Pet weight=” ”
8 Supp O id=”number” O id=”1” 1]open order Display message Display Pass
Order O date=”date” O date=”14/11/2012 form “record saved message
module Supp name=”text” Supp name=”suraj” 2]fill all successfully” “record saved
Prod name= “text” Prod name= “dalada” information successfully”
Prod status= Prod status= “100” 3]click ok
“number” Prod weight=”5”
prod
weight=”number”
O id= “ret” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
O date= “14/3/” Step:1], 2],3] Display message Display Pass
“please enter message
year” “please enter
year”
Supp name= “134” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Prod name=”h67h” Step:1] ,2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Prod status=”lmn” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter

78
number”
Prod weight=”pnv” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
O id=”1” Step:1], 2],3] Display message Display Pass
O date=”14/11/2012 “fill all message “fill all
Supp name=” ” information” information”
Prod name= “dalada”
Prod status= “ ”
Prod weight=”5”
9 Employee E id= e id=“1” 1)open Display message Display Pass
module “number” e name=” rohan” employee “record saved message
E name=”text” E Address=”khed” form successfully” “record saved
E Address=”text” E salary=”5000” 2)fill all successfully”
E salary=”number” Contact details
contact no=” no=”5690348954” 3)click ok
number”
E id=” er“ Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
E name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message
character” ”please enter
character”
E salary=”tyg” Step:1] ,2],3] Display message Display Pass
”enter number” message” enter
number”

Contact no=”106” Step:1] ,2],3] Display message Display Pass


”at most 10 digit message “ at
are require” most 10 digit
are require”
e id=”1” Step:1] ,2],3] Display message Display Pass
e name=” “ “fill all details” message=”fill
e Address=” “ all details”
e salary=”4000”
contact no=””
10 Billing Bill id=”number Bill id=” 101” 1] open billing Display message Display Pass
module ” Date=”15/5/1014” form “record saved message
Date=”date” Cust name=”nitish” 2] fill all successfully” “record saved
Cust name=”text” Contact details successfully”
Contact no.=”number” 3]click ok
no.=”number” Pet type=”cat”
Pet type=”text” Pet color=”whiite”
Pet color=”text” Pet status=”avalabl”
Pet status=”number” Pet weight=”8”
Pet weight=”number” Pet price=”5000”
Total=”5000”
C id= “op” Step:1] ,2],3] Display message Display Pass
“please enter message
number” “please enter
number”
Date=/2/2015 Step:1] ,2],3] Display message Display Pass
“please enter message
day” “please enter
day”
Cust name= “45” Step:1] ,2],3] Display message Display Pass
“please enter message

79
character” “please enter
character”
Pet type=”459” Step:1], 2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet color=”n87” Step:1], 2],3] Display message Display Pass
“please enter message
character” “please enter
character”
Pet status=”jk” Step:1], 2],3] Display message Display Pass
”please enter message
number” ”please enter
number”
Pet weight=”ab” Step:1], 2],3] Display message Display Pass
”please enter message
number” ”please enter
number”
Pet price=”ahg” Step:1], 2],3] Display message Display Pass
”please enter message
number” ”please enter
number”
Total =”nhj890” Step:1], 2],3] Display message Display Pass
”please enter message
number” ”please enter
number”
Bill id=” 101” Step:1], 2],3] Display message Display Pass
Date=”15/5/1014” “please fill all message
Cust name=”nitish” information” “please fill all
Contact information”
no.=”8552992587”
Pet type=””
Pet color=” bhj”
Pet status=” ”
Pet weight=”5”
Pet price=”300”
Total=”1500”

80
Program descriptor with naming convention

11) class : login form


Login form is to hold all information about login.
Naming Description
Username This naming convention is used to
stored the username
Password This naming convention is used to
stored the password
 Function:
3. Login: This function gives the access to program application
4. Exit: This function close the login form.

12) Class : Customer form


Customer form is to hold all information about customer.
Naming Description
81
Customer Id This naming convention is used
to stored the customer id
Customer Name This naming convention is used
to stored the customer name
Customer Address This naming convention is used
to stored the customer’s address
Contact Number This naming convention is used
to stored the customer’s contact
number
 Function:
5. Add: this function add the customer record
6. Update: this function update the customer record
7. Delete: this function delete the customer record
8. Search: this function search the customer record

13) Class: Supplier form


Supplier form is hold all information about supplier.
Naming Description
Supplier Id This naming convention is used
to stored the supplier id
Supplier Name This naming convention is used
to stored the supplier name

Supplier Address This naming convention is used


to stored the supplier address
Contact Number This naming convention is used
to stored the Contact Number
 Function:
1) add: this function add the supplier record
2) update: this function update the supplier record
3) delete: this function delete the supplier record
4) search: this function search the supplier record

14) Class: Pet form


82
Pet form is hold all information about Pet.

Naming Description
Pet Type This naming convention is used
to stored the Pet type
Pet Color This naming convention is used
to stored the Pet color

Pet Weight This naming convention is used


to stored the Pet weight
Pet Status This naming convention is used
to stored the Pet status
Pet Price This naming convention is used
to stored the Pet price
 Function:
1) add: this function add the Pet record
2) update: this function update the Pet record
3) search: this function search the Pet record

15) Class: Products form


Products form is hold all information about product.
Naming Description
Product Id This naming convention is used
to stored the product id
Product Name This naming convention is used
to stored the product name

 Function:
1) add: this function add the product record
2) update: this function update the product record
3) search: this function search the product record

83
16) Class: Stock form
Stock form is hold all information about stock.
Naming Description
Product Id This naming convention is used
to stored the product id
Product Name This naming convention is used
to stored the product name

Product Status This naming convention is used


to stored the product status

Product Weight This naming convention is used


to stored the product weight

 Function:
2) update: this function update the stock record

17) Class: Customer Order form


Customer Order form is hold all information about customer order.
Naming Description
Order Id This naming convention is used
to stored the order id
Order Date This naming convention is used
to stored the order date
Customer Name This naming convention is used
to stored the customer name
Pet Type This naming convention is used
to stored the Pet type
PetColor This naming convention is used
to stored the Pet flavour

Pet Weight This naming convention is used


to stored the Pet weight

84
Pet Status This naming convention is used
to stored the Pet status

 Function:
1) add: this function add the customer order record
2) update: this function update the customer order record
3) cancel: this function cancel the customer order record
4) search: this function search the customer order record

18) Class: Supplier Order form


Supplier Order form is hold all information about supplier order.
Naming Description
Order Id This naming convention is used
to stored the order id
Order Date This naming convention is used
to stored the order date
Supplier Name This naming convention is used
to stored the supplier name
Product Name This naming convention is used
to stored the product name
Product Status This naming convention is used
to stored the product status

Product Weight This naming convention is used


to stored the product weight
 Function:
1) add: this function add the supplier order record
2) update: this function update the supplier order record
3) cancel: this function cancel the supplier order record
4) search: this function search the supplier order record

19) Class: Employee form


Employee form is hold all information about employee.
85
Naming Description
Employee Id This naming convention is used
to stored the employee id
Employee Name This naming convention is used
to stored the employee name

Employee Address This naming convention is used


to stored the employee address
Employee Salary This naming convention is used
to stored the employee salary
Contact Number This naming convention is used
to stored the Contact No.
 Function:
1) add: this function add the employee record
2) update: this function update the employee record
3) delete: this function delete the employee record
4) search: this function search the employee record

20) Class: Customer Bill form


Customer Bill form is hold all information about customer
bill.

Naming Description
Bill Id This naming convention is used
to stored the order id
Date This naming convention is used
to stored the date
Customer Name This naming convention is used
to stored the customer name
Pet Type This naming convention is used
to stored the Pet type
Pet Color This naming convention is used
to stored the Pet flavour

86
Pet Weight This naming convention is used
to stored the Pet weight
Pet Status This naming convention is used
to stored the Pet status
Pet Price This naming convention is used
to stored the Pet price
Total This naming convention is used
to stored the total

 Function:
1) add: this function add the customer bill record
2) update: this function update the customer bill record
3) search: this function search the customer bill record

87
Code :-

Login Form:-
Imports System.Data.SqlClient
Public Class Form1
Dim i As Integer
Dim con As New sqlconnection
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles OK.Click
If txtusernm.Text = "admin" And txtpasswrd.Text = "admin" Then
MsgBox("Log In Successful")
Loading.Show()
' MDIParent1.Show()
Me.Hide()
Else
MsgBox("Log In UnSuccessful")
txtusernm.Text = ""
txtpasswrd.Text = ""
i = i + 1
End If

If i = 3 Then
MsgBox("You Lost Your Log In! Please Try Later.")
End If
End Sub

Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btncancel.Click
Me.Close()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'Timer1.Start()
' My.Computer.Audio.Play(My.Resources.pause, AudioPlayMode.Background)

88
'con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
' con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files (x86)\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
' con.ConnectionString = "Data Source=.\sqlexpress;Initial
Catalog=mydatabase;Integrated Security=True;User Instance=False"
End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label1.Click

End Sub
Private Sub txtpasswrd_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtpasswrd.TextChanged
Dim j = txtpasswrd.Text
If j.Length >= 5 Then
MsgBox("Minimum 5 characters")
End If
End Sub
End Class

MDI Form:-
Imports System.Windows.Forms

Public Class MDIParent1

Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)


' Create a new instance of the child form.
Dim ChildForm As New System.Windows.Forms.Form
' Make it a child of this MDI form before showing it.
ChildForm.MdiParent = Me

m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber

ChildForm.Show()
End Sub

Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)


Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then

89
Dim FileName As String = OpenFileDialog.FileName
' TODO: Add code here to open the file.
End If
End Sub

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"

If (SaveFileDialog.ShowDialog(Me) =
System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = SaveFileDialog.FileName
' TODO: Add code here to save the current contents of the form to
a file.
End If
End Sub

Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
Me.Close()
End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
' Use My.Computer.Clipboard to insert the selected text or images into
the clipboard
End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
' Use My.Computer.Clipboard to insert the selected text or images into
the clipboard
End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData
to retrieve information from the clipboard.
End Sub

Private Sub ToolBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
' Me.ToolStrip.Visible = Me.ToolBarToolStripMenuItem.Checked
End Sub

Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As Object, ByVal


e As EventArgs)
' Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.Checked
End Sub

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e


As EventArgs)
Me.LayoutMdi(MdiLayout.Cascade)

90
End Sub

Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object,


ByVal e As EventArgs)
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub

Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal


e As EventArgs)
' Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub

Private m_ChildFormNumber As Integer

Private Sub CustomerToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles CustomerToolStripMenuItem.Click
customerdetails.Show()
End Sub

Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CalculatorToolStripMenuItem.Click
Process.Start("C:\Windows\System32\calc.exe")
End Sub

Private Sub VendorToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles VendorToolStripMenuItem.Click
VendorDetail.Show()
End Sub

Private Sub EmployeeToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles EmployeeToolStripMenuItem.Click
EmployeeInfo.Show()
End Sub

Private Sub ProductToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ProductToolStripMenuItem.Click
ProductDetails.Show()
End Sub

Private Sub CustomerBillToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CustomerBillToolStripMenuItem.Click
SaleBill.Show()

91
End Sub

Private Sub PurchaseOrderToolStripMenuItem1_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
PurchaseOrderToolStripMenuItem1.Click
PurchaseOrder.Show()
End Sub

Private Sub PetToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs)

End Sub

Private Sub NotepadToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles NotepadToolStripMenuItem.Click
Process.Start("C:\Windows\System32\notepad.exe")
End Sub

Private Sub CustomerOrderToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs)
CustomerOrder.Show()
End Sub

Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub

Private Sub StockToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles StockToolStripMenuItem.Click

End Sub

Private Sub ProductStockToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ProductStockToolStripMenuItem.Click
ProductStock.Show()
End Sub

Private Sub StockToolStripMenuItem1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles StockToolStripMenuItem1.Click
Stock.Show()
End Sub

Private Sub StockToolStripMenuItem2_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles StockToolStripMenuItem2.Click

End Sub

Private Sub ReportToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ReportToolStripMenuItem.Click
Report.Show()
End Sub
End Class

92
Customer Form:-
Imports System.Data.SqlClient

Public Class customer


Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim dr As SqlDataReader
Dim ds As DataSet
Dim id As Integer
Dim cnt As Integer
Dim nme As String, ch As Char
Dim m, c As Integer
Dim BindingSource1 As New BindingSource()
Function refres()
Try
con.Open()
cmd.CommandText = "select CustomerName from Customer"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
cbcustname.Items.Add(dr(0).ToString)
End While
dr.Close()
Catch ex As Exception
End Try
con.Close()
Return 0
End Function

Function idgenerate()

txtcustaddrss.Text = ""
txtcustcont.Text = ""
'cbcustname.Text = ""
TextBox1.Text = ""
Try
con.Open()
cmd.CommandText = "select max(CustomerID) from customer"
cmd.Connection = con
dr = cmd.ExecuteReader
If dr.Read Then
id = dr(0) + 1
txtcustid.Text = id
End If
dr.Close()
Catch Excep As Exception
txtcustid.Text = "1"
End Try
con.Close()
Return 0
End Function

93
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label3.Click

End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd.Click
Try
If txtcustcont.TextLength < 10 Then
MessageBox.Show("mobile number not valid only 10 digit
required")
con.Close()
txtcustcont.Focus()
Else
con.Open()
cmd.CommandText = "insert into customer values('" &
txtcustid.Text & "','" & TextBox1.Text & "','" & txtcustaddrss.Text & "','" &
txtcustcont.Text & "')"
cmd.Connection = con
cmd.ExecuteNonQuery()
con.Close()
MessageBox.Show("Record Inserted In System")
idgenerate()
End If
Catch ex As Exception

MsgBox("Blank Record Cannot Be Inserted")


con.Close()

End Try
End Sub

Private Sub btnmodify_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnmodify.Click
Try
con.Open()
cmd.CommandText = "update customer set CustomerID='" &
txtcustid.Text & "', CustomerAddress='" & txtcustaddrss.Text & "',
CustomerContNo='" & txtcustcont.Text & "'where CustomerName='" &
cbcustname.Text & "' "
cmd.Connection = con
cmd.ExecuteNonQuery()
MessageBox.Show("Record Updated In System")
con.Close()
txtcustid.Text = ""
txtcustaddrss.Text = ""
txtcustcont.Text = ""
Catch
End Try
End Sub

Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btndelete.Click
If RadioButton2.Checked = True Then
Try
con.Open()

94
cmd.CommandText = "delete from customer where CustomerName='"
& cbcustname.Text & "'"
cmd.Connection = con
cmd.ExecuteNonQuery()
MessageBox.Show("RECORD DELETED")
con.Close()
txtcustid.Text = ""
txtcustaddrss.Text = ""
txtcustcont.Text = ""
cbcustname.Items.Remove(cbcustname.SelectedItem)

Catch ex As Exception
MessageBox.Show("No Such Record Found")
End Try
End If
End Sub

Private Sub btnview_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnview.Click
CustomerInfo.Show()
End Sub

Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnclose.Click
Me.Close()
End Sub

Private Sub txtcustid_TextChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles txtcustid.TextChanged

End Sub

Private Sub txtcustaddrss_TextChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles txtcustaddrss.TextChanged

End Sub

Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles GroupBox1.Enter

End Sub

Private Sub txtcustcont_TextChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles txtcustcont.TextChanged
Dim I As Integer = 9
Dim Nam = txtcustcont.Text
For I = 0 To Nam.Length - 1
ch = Nam.Chars(I)
If Not Char.IsDigit(ch) Then
MessageBox.Show("The contactno must be in digits")
txtcustcont.Focus()
End If
Next
If txtcustcont.TextLength > 10 Then
MessageBox.Show("mobile number not valid only 10 digit required")

End If

95
End Sub

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
idgenerate()
btnadd.Enabled = True
txtcustid.Enabled = False
btnmodify.Enabled = False
btndelete.Enabled = False
cbcustname.Visible = False
TextBox1.Visible = True
txtcustaddrss.Text = ""
TextBox1.Text = ""
txtcustcont.Text = ""

End If
End Sub

Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles GroupBox2.Enter

End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
cbcustname.DropDownStyle = ComboBoxStyle.DropDownList
txtcustid.Enabled = True
cbcustname.Visible = True
btnadd.Enabled = False
btnmodify.Enabled = True
btndelete.Enabled = True
cbcustname.Visible = True
cbcustname.Items.Clear()
TextBox1.Visible = False
txtcustaddrss.Text = ""
txtcustid.Text = ""
txtcustcont.Text = ""
refres()
End Sub

Private Sub cbcustname_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles cbcustname.SelectedIndexChanged
If RadioButton1.Checked = False Then

Try
con.Open()
cmd.CommandText = "select * from customer where
CustomerName='" & cbcustname.Text & "' "
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
txtcustid.Text = dr(0)
cbcustname.Text = dr(1)
txtcustaddrss.Text = dr(2)
txtcustcont.Text = dr(3)

96
con.Close()
Catch ex As Exception
End Try
End If
End Sub

' Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles TextBox1.TextChanged
'If Char.IsDigit(e.KeyChar) = True Or Char.IsPunctuation(e.KeyChar) = True
Or Char.IsSymbol(e.KeyChar) = True Then
' MessageBox.Show("Please Alphabets Only")
'e.Handled = True
'End If
'End Sub

Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label2.Click

End Sub
End Class

Bill :-
Imports System.Data.SqlClient
Public Class SaleBill
Dim con As New SqlConnection '(dbconnection.conStr)
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
Dim da As SqlDataAdapter
Dim dt As DataTable
Dim pname As String
Dim total As Integer
Dim qty As Integer
Dim amount As Integer
Dim str As String
Dim id As Integer
Dim avail As Integer
Function idgenerate()

txtcustname.Text = ""
txtQuantity.Text = ""
txtAvailable.Text = ""
txttotal.Text = ""
cbProductnm.Text = ""
con.Open()
Try
cmd.CommandText = "select max(ID) from SaleBill"
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
Dim id As String
id = dr(0).ToString
id = id.Remove(0, 1)

97
Dim oid As Integer
oid = CInt(id)
oid = oid + 1
id = "b" & oid
txtBillNo.Text = id
dr.Close()
Catch ex As Exception
txtBillNo.Text = "b101"
End Try
con.Close()
Return 0
End Function
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick

End Sub

Private Sub SaleBill_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'MydatabaseDataSet5.SaleBill' table. You can move, or remove it, as needed.
'Me.SaleBillTableAdapter.Fill(Me.MydatabaseDataSet5.SaleBill)
'con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
' con.ConnectionString = "Data Source=.\sqlexpress;Initial
Catalog=mydatabase;Integrated Security=True;User Instance=False"
con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files (x86)\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
' con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
rbnewbill.Checked = True
con.Open()
cmd.CommandText = "select * from Stock1 "
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
cbProductnm.Items.Add(dr(1).ToString)
End While
dr.Close()
con.Close()
idgenerate()
End Sub

Private Sub rbnewbill_CheckedChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles rbnewbill.CheckedChanged
If rbnewbill.Checked = True Then
dtp1.Text = System.DateTime.Today
btnGenerate.Enabled = True
txtBillNo.Enabled = False
cbProductnm.Enabled = True
txtQuantity.Enabled = True

txtAmount.Visible = True

98
txtAvailable.Visible = True
txttotal.Visible = True
txtAmount.Enabled = True
txtAvailable.Enabled = True
txttotal.Enabled = True
idgenerate()
txtcustname.Text = ""
txtQuantity.Text = ""
txtAvailable.Text = ""
txttotal.Text = ""
cbProductnm.Text = ""
End If
End Sub

Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnGenerate.Click
Dim sum As Single = 0
Dim i As Integer
con.Close()
For i = 0 To DataGridView1.Rows.Count - 1
total = DataGridView1.Rows(i).Cells(3).Value
sum = sum + total
Next
txtfinal.Text = sum
For x = 0 To DataGridView1.Rows.Count - 1
pname = DataGridView1.Rows(x).Cells(0).Value
amount = DataGridView1.Rows(x).Cells(1).Value
qty = DataGridView1.Rows(x).Cells(2).Value
total = DataGridView1.Rows(x).Cells(3).Value
str = "insert into SaleBill Values('" & txtBillNo.Text & "','" &
txtcustname.Text & "','" & pname & "','" & amount & "','" & qty & "','" &
total & "')"
con.Open()
cmd.CommandText = str
cmd.Connection = con
cmd.ExecuteNonQuery()
cmd.Dispose()
con.Close()
MessageBox.Show("Record Inserted")
con.Open()
avail = txtAvailable.Text - qty
cmd.CommandText = "update Stock1 set Quantity='" & avail & "'where
ProductName='" & pname & "' "
cmd.Connection = con
cmd.ExecuteNonQuery()
con.Close()
Next

'frmBillGenerator.Show()
End Sub

Private Sub cbProductnm_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
cbProductnm.SelectedIndexChanged
If rbnewbill.Checked = True Then
Try
con.Open()

99
cmd.CommandText = "select * from Product where ProductName='"
& cbProductnm.Text & "' "
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
txtAmount.Text = dr(2)
con.Close()
con.Open()
cmd.CommandText = "select * from Stock1 where ProductName='" &
cbProductnm.Text & "' "
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
txtAvailable.Text = dr(2)
con.Close()
Catch ex As Exception
End Try
End If
End Sub

' Private Sub txtQuantity_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles txtQuantity.TextChanged
' If Char.IsLetter(e.KeyChar) = True Or
Char.IsPunctuation(e.KeyChar) = True Or Char.IsSymbol(e.KeyChar) = True Then
' MessageBox.Show("Please Enter Only Digit")
' e.Handled = True
' End If
' End Sub
'End Class

Private Sub txtQuantity_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtQuantity.KeyPress
If Char.IsLetter(e.KeyChar) = True Or Char.IsPunctuation(e.KeyChar) =
True Or Char.IsSymbol(e.KeyChar) = True Then
MessageBox.Show("Please Enter Only Digit")
e.Handled = True
End If
End Sub

Private Sub txtQuantity_Leave(ByVal sender As Object, ByVal e As


System.EventArgs) Handles txtQuantity.Leave
If txtQuantity.Text = "" Then
MsgBox("Empty Field")
txtQuantity.Focus()
Else
txttotal.Text = CDbl(txtAmount.Text * txtQuantity.Text)
If txtQuantity.Text > txtAvailable.Text Then
MsgBox("Product Quantity Not Available")
txtQuantity.Text = ""
End If
End If
End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd.Click
Dim rowNum As Integer = DataGridView1.Rows.Add()
DataGridView1.Rows.Item(rowNum).Cells(0).Value = cbProductnm.Text

100
DataGridView1.Rows.Item(rowNum).Cells(1).Value = txtAmount.Text
DataGridView1.Rows.Item(rowNum).Cells(2).Value = txtQuantity.Text
DataGridView1.Rows.Item(rowNum).Cells(3).Value = txttotal.Text
End Sub

Order :-
Imports System.Data.SqlClient

Public Class PurchaseOrder


Dim con As New SqlConnection(Class1.conStr)
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
Dim id, c As Integer
Dim pname, vid, vname, pid As String
Dim qty As Integer
Dim availb As Integer
Dim avail As Integer
Function idgenerate()
txtquantity.Text = ""

TextBox1.Text = ""
cbprdname.Text = ""
cbVendorname.Text = ""
con.Open()
Try
cmd.CommandText = "select max(ID) from POrder"
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
Dim id As String
id = dr(0).ToString
id = id.Remove(0, 1)
Dim oid As Integer
oid = CInt(id)
oid = oid + 1
id = "o" & oid
TextBox1.Text = id
dr.Close()
Catch ex As Exception
TextBox1.Text = "o101"
End Try
con.Close()
Return 0

End Function
Function ref()
'DataGridView1.Rows.Clear()
'con.Open()
'Try

101
' cmd.CommandText = "select ProductName,Quantity from POrder where
ID='" & cbID.SelectedItem & "'"
' cmd.Connection = con
' dr = cmd.ExecuteReader
' While dr.Read
' DataGridView1.Rows.Add(dr(0).ToString, dr(1).ToString,
dr(2).ToString, dr(3).ToString)
' End While
' dr.Close()
' con.Close()
'Catch ex As Exception
' MsgBox(ex.Message)
'End Try
'Return 0
DataGridView1.Rows.Clear()
con.Open()
Try

cmd.CommandText = "select ProductName,Availabilty,Quantity from


POrder where [ID]='" & cbID.SelectedItem & "'"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
DataGridView1.Rows.Add(dr(0).ToString, dr(1).ToString,
dr(2).ToString)
End While
dr.Close()
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return 0
End Function
Public Sub clear()
' txtproductidd.Text = ""
txtquantity.Text = ""
'txtvendid.Text = ""
cbVendorname.Text = ""
cbprdname.Text = ""
'txtAvailable.Text = ""
End Sub
Private Sub PurchaseOrder_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'MydatabaseDataSet6.POrder' table. You can move, or remove it, as needed.
'Me.POrderTableAdapter.Fill(Me.MydatabaseDataSet6.POrder)
' con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files (x86)\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
' con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"

102
' con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
'con.ConnectionString = "Data Source=.\sqlexpress;Initial
Catalog=mydatabase;Integrated Security=True;User Instance=False"
rdneworder.Checked = True
con.Open()

cmd.CommandText = "select [ID], count([ID]) totalCount from POrder


group by [ID]"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
cbID.Items.Add(dr(0).ToString)
End While
dr.Close()
con.Close()
con.Open()

cmd.CommandText = "select * from Vendor "


cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
cbVendorname.Items.Add(dr(1).ToString)
End While
dr.Close()
con.Close()
con.Open()
cmd.CommandText = "select * from Stock1 "
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
cbprdname.Items.Add(dr(1).ToString)
End While
dr.Close()
con.Close()

idgenerate()
dr.Close()
con.Close()
End Sub

Private Sub rdneworder_CheckedChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles rdneworder.CheckedChanged
DataGridView1.Rows.Clear()
If rdneworder.Checked = True Then

rdneworder.Checked = True
TextBox1.Enabled = False
TextBox1.Visible = True
cbID.Visible = False
cbprdname.Visible = True
'ComboBox2.Visible = False
txtprodname.Visible = False
txtvendname.Visible = False

cbVendorname.Enabled = True

103
idgenerate()
btnAdd.Enabled = True
btngenerate.Enabled = True
btngenerate.Visible = True

clear()
End If
End Sub

Private Sub rbrecieved_CheckedChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles rbrecieved.CheckedChanged
cbVendorname.Enabled = True
cbID.Enabled = True
TextBox1.Visible = False
cbID.Visible = True

btngenerate.Visible = False

cbID.DropDownStyle = ComboBoxStyle.DropDownList
TextBox1.Visible = False
cbID.Items.Clear()
Try
con.Open()
cmd.CommandText = "select [ID], count([ID]) totalCount from POrder
group by [ID]"
cmd.Connection = con
dr = cmd.ExecuteReader

While dr.Read
cbID.Items.Add(dr(0).ToString)
End While
dr.Close()
con.Close()
clear()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

'cbVendorname.Enabled = True
'cbID.Enabled = True
'TextBox1.Visible = False
'cbID.Visible = True

'btngenerate.Visible = False

'cbID.DropDownStyle = ComboBoxStyle.DropDownList
'TextBox1.Visible = False
'cbID.Items.Clear()
'Try
' con.Open()
' 'cmd.CommandText = "select [ID], count([ID]) totalCount from
[POrder] group by [ID]"
' cmd.CommandText = "select distinct [ID] from [POrder]"

104
' cmd.Connection = con
' dr = cmd.ExecuteReader

' While dr.Read


' cbID.Items.Add(dr(0).ToString)
' End While
' dr.Close()
' con.Close()
' clear()
'Catch ex As Exception
' MsgBox(ex.ToString)
'End Try
End Sub

Private Sub rdshoworder_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles rdshoworder.CheckedChanged
btngenerate.Enabled = False
cbID.DropDownStyle = ComboBoxStyle.DropDownList
TextBox1.Visible = False
cbID.Visible = True
cbID.Enabled = True
cbprdname.Enabled = False
cbVendorname.Enabled = False
txtquantity.Enabled = False

End Sub

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnAdd.Click
''dr.Close()
'Try

' 'DataGridView1.Rows.Add(dr(2).ToString, dr(3).ToString,


dr(4).ToString)
' DataGridView1.Rows.Add(dr(0).ToString, dr(1).ToString,
dr(2).ToString)

'Catch ex As Exception
' MsgBox(ex.Message)
'End Try
cbID.Enabled = False
cbVendorname.Enabled = False
If rdneworder.Checked = True Then
Dim rowNum As Integer = DataGridView1.Rows.Add()

DataGridView1.Rows.Item(rowNum).Cells(0).Value = cbprdname.Text
DataGridView1.Rows.Item(rowNum).Cells(1).Value = txtquantity.Text
DataGridView1.Rows.Item(rowNum).Cells(2).Value = txtAvailable.Text
End If
End Sub

Private Sub btngenerate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btngenerate.Click
cbVendorname.Enabled = True
con.Close()
Dim str As String

105
For x = 0 To DataGridView1.Rows.Count - 1
'pid = DataGridView1.Rows(x).Cells(0).Value
pname = DataGridView1.Rows(x).Cells(0).Value
qty = DataGridView1.Rows(x).Cells(1).Value
availb = DataGridView1.Rows(x).Cells(2).Value
Next
str = "insert into POrder values('" & TextBox1.Text & "','" &
cbVendorname.Text & "','" & cbprdname.Text & "','" & txtAvailable.Text & "','"
& txtquantity.Text & "') "
con.Open()
cmd.CommandText = str
cmd.Connection = con
cmd.ExecuteNonQuery()
cmd.Dispose()
con.Close()
' Next
MessageBox.Show("Record Inserted In System")
End Sub

Private Sub cbVendorname_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
cbVendorname.SelectedIndexChanged
If rdneworder.Checked = True Then
Try
con.Open()
cmd.CommandText = "select from Vendor where [VendorName]='" &
cbVendorname.Text & "' "
cmd.Connection = con
con.Close()
Catch ex As Exception
End Try
End If
dr.Close()
con.Close()
End Sub

Private Sub cbprdname_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles cbprdname.SelectedIndexChanged
If rdneworder.Checked = True Then
Try
con.Open()
'cmd.CommandText = "select * from Product where Name='" &
cbprdname.Text & "' "
cmd.CommandText = "select * from Stock1 where [ProductName]='"
& cbprdname.Text & "' "
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
'cbprdname.Text = dr(0)
'txtcmp.Text = dr(3)
txtAvailable.Text = dr(2)

'cbVendorname.Text = dr(1)
'txtproductidd.Text = dr(3)

'cbprdname.Text = dr(4)
con.Close()

106
Catch ex As Exception
End Try
End If
dr.Close()
con.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
clear()
cbID.Items.Remove(cbID.SelectedItem)
DataGridView1.Rows.Clear()
End Sub

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnDelete.Click
If rdshoworder.Checked = True Then
Try
con.Open()
cmd.CommandText = "delete from [POrder] where ID='" &
cbID.Text & "'"
cmd.Connection = con
cmd.ExecuteNonQuery()
MessageBox.Show("RECORD DELETED")
con.Close()
cbVendorname.Text = ""
'txtvendid.Text = ""
' txtproductidd.Text = ""
''.Text = ""
cbprdname.Text = ""

cbID.Items.Remove(cbID.SelectedItem)
Catch ex As Exception
MessageBox.Show("No Such Record Found")
End Try
End If
ref()
End Sub

Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles GroupBox1.Enter

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
'txtproid.Enabled = True
'txtsid.Enabled = True
cbVendorname.Enabled = True
If rbrecieved.Checked = True Then
con.Close()
For x = 0 To DataGridView1.Rows.Count - 1
' pid = DataGridView1.Rows(x).Cells(0).Value
pname = DataGridView1.Rows(x).Cells(0).Value
qty = DataGridView1.Rows(x).Cells(1).Value
availb = DataGridView1.Rows(x).Cells(2).Value
con.Open()

107
avail = availb + qty
cmd.CommandText = "update Stock1 set Quantity='" & avail &
"'where [ProductName]='" & pname & "' "
cmd.Connection = con
cmd.ExecuteNonQuery()
con.Close()
'MessageBox.Show("Order Received")
Next
MessageBox.Show("Order Received")
ref()
End If

'Dim row As Integer = DataGridView1.Rows.Add()


''txtproid.Enabled = True
''txtsid.Enabled = True
'cbVendorname.Enabled = True
'If rbrecieved.Checked = True Then
' con.Close()
' 'For x = 0 To DataGridView1.Rows.Count - 1
' ' pid = DataGridView1.Rows(x).Cells(0).Value
' pname = DataGridView1.Rows(row).Cells(0).Value
' qty = DataGridView1.Rows(row).Cells(1).Value
' availb = DataGridView1.Rows(row).Cells(2).Value
' con.Open()
' avail = availb + qty
' cmd.CommandText = "update Stock set Quantity='" & avail & "'where
[ProductName]='" & pname & "' "
' cmd.Connection = con
' cmd.ExecuteNonQuery()
' con.Close()
' MessageBox.Show("Order Received")
' 'Next
' ref()
'End If
''Dim row As Integer = DataGridView1.Rows.Add()
' ''txtproid.Enabled = True
' ''txtsid.Enabled = True
''cbVendorname.Enabled = True
''If rbrecieved.Checked = True Then
'' con.Close()
'' 'For x = 0 To DataGridView1.Rows.Count - 1
'' ' pid = DataGridView1.Rows(x).Cells(0).Value
'' pname = DataGridView1.Rows(row).Cells(0).Value
'' qty = DataGridView1.Rows(row).Cells(1).Value
'' availb = DataGridView1.Rows(row).Cells(2).Value

'' 'Next
'' ref()
''End If

End Sub

Private Sub cbID_SelectedIndexChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles cbID.SelectedIndexChanged
If rdneworder.Checked = False Then

108
Try
con.Open()
cmd.CommandText = "select * from POrder where [ID]='" &
cbID.Text & "' "
cmd.Connection = con
dr = cmd.ExecuteReader
dr.Read()
cbID.Text = dr(0)
cbVendorname.Text = dr(1).ToString()
'cbprdname.Text = dr(2).ToString()
'txtquantity.Text = dr(3)
'txtAvailable.Text = dr(4)
'txtcmp.Text = dr(3)
'dtp1.Text = dr(6)
dr.Close()
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message.ToString())

End Try
End If
DataGridView1.Rows.Clear()
con.Open()
Try

cmd.CommandText = "select [ProductName],Quantity,Availabilty from


POrder where [ID]='" & cbID.SelectedItem & "'"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
DataGridView1.Rows.Add(dr(0).ToString, dr(1).ToString,
dr(2).ToString)
End While
dr.Close()
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try

'If rdneworder.Checked = False Then


' Try
' con.Open()
' cmd.CommandText = "select * from POrder where [ID]='" &
cbID.Text & "' "
' cmd.Connection = con
' dr = cmd.ExecuteReader
' dr.Read()
' cbID.Text = dr(0)
' cbVendorname.Text = dr(1)
' cbprdname.Text = dr(2)
' txtquantity.Text = dr(3)
' 'txtAvailable.Text = dr(4)
' 'txtcmp.Text = dr(3)
' 'dtp1.Text = dr(6)

109
' dr.Close()
' con.Close()
' Catch ex As Exception
' MessageBox.Show(ex.Message)
' End Try

' con.Close()
' Try
' con.Open()
' cmd.CommandText = "select Quantity from Stock1 where
[ProductName]='" & cbprdname.Text.Trim() & "' "
' cmd.Connection = con
' dr = cmd.ExecuteReader
' dr.Read()
' txtAvailable.Text = dr(0)
' 'txtcmp.Text = dr(3)
' 'dtp1.Text = dr(6)
' dr.Close()
' con.Close()
' Catch ex As Exception
' MessageBox.Show(ex.Message)
' End Try
' con.Close()
'End If
'dr.Close()
'con.Close()
'DataGridView1.Rows.Clear()

End Sub

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnUpdate.Click
Try
con.Open()
pname = cbprdname.Text.Trim()
availb = Val(txtAvailable.Text)
qty = Val(txtquantity.Text)
avail = availb + qty

cmd.CommandText = "update Stock1 set Quantity=" & avail & " where
[ProductName]='" & pname & "' "
cmd.Connection = con
cmd.ExecuteNonQuery()
con.Close()
MessageBox.Show("Order Received")
Catch ex As Exception
MessageBox.Show(ex.Message)
con.Close()
End Try

End Sub
End Class

110
Report :-
Imports System.Data.SqlClient
Public Class Report
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New mydatabaseDataSet7
Dim dr As SqlDataReader
Private Sub btnbill_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnbill.Click
con.Close()
Select Case ComboBox1.SelectedItem
Case "Stock"
Dim rpt As New RStock
con.Open()
Try
cmd.CommandText = "select * from Stock1"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "Stock1")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "SaleBill"
'PrintBill.Show()
Dim rpt As New RSaleBill
con.Open()
Try
cmd.CommandText = "select * from SaleBill"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "SaleBill")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "POrder"
'PrintBill.Show()
Dim rpt As New RPOrder
con.Open()
Try
cmd.CommandText = "select * from POrder"
cmd.Connection = con

111
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "POrder")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "Customer"
'PrintBill.Show()
Dim rpt As New RCustomer
con.Open()
Try
cmd.CommandText = "select * from Customer"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "Customer")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "Vendor"
'PrintBill.Show()
Dim rpt As New RVendor
con.Open()
Try
cmd.CommandText = "select * from Vendor"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "Vendor")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "Employee"
'PrintBill.Show()
Dim rpt As New REmployee
con.Open()
Try
cmd.CommandText = "select * from Employee"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "Employee")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()

112
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Case "Product"
'PrintBill.Show()
Dim rpt As New RProduct
con.Open()
Try
cmd.CommandText = "select * from Product"
cmd.Connection = con
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "Product")
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Select
End Sub

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CrystalReportViewer1.Load
con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files (x86)\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
'con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
'con.ConnectionString = "Data
Source=.\sqlexpress;AttachDbFilename=C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\mydatabase.mdf;Integrated Security=True"
'con.ConnectionString = "Data Source=.\sqlexpress;Initial
Catalog=mydatabase;Integrated Security=True;User Instance=False"
End Sub
End Class

SCREEN LAYOUT:-
Login Form:

113
MDI Form:

Customer Form:

114
Bill :-

Order:-

115
Report
Report of Pet Stock

116
Reference Bibliography

 Murach’s Visual Basic 2008

 Mastering Visual Basic 2008

 Complete Reference VB.Net

Referred Websites

https://www.thenewboston.com
http://www.msdn.microsoft.com

Hardware/Software Requirement
HARDWARE REQUIREMENT

 PROCESSOR : Dual Core 2 & Above.

 RAM : 1 GB &Above.

 HARD DISK SPACE : 40 GB & above.

 PRINTER : Inkjet/Laser Printer

117
 MONITOR : Color

SOFTWARE REQUIRMENT

 OPERATING SYSTEM : Windows 7 and Above

 VISUAL BASIC .NET VERSION : 2008 Express Edition.

.NET FRAMEWORK VERSION : 3.5 or above

118

You might also like