Vous êtes sur la page 1sur 119

SNDT Womens

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
(Project Guide)
PRINCIPAL

MRS.MORE RESHMA
(H.O.D)
EXTERNAL
2

EXAMINER

Index
Table of Contents
Sr. No
1.

1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
2.

Phase Name
Preliminary Investigation

Acknowledgement
Organizational Overview
Current System
Limitations Of the system
Scope of proposed system
Advantage of proposed system
Feasibility Study
Gantt Chart
System Analysis

2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
3.

Fact Finding Techniques


Event Table
Use Case
Activity Diagram
Class Diagram
Object Diagram
Sequence Diagram
Collaboration Diagram
System Design

3.1
3.2
3.3
3.4
4.

Derived Tables from entities and relationships


Deployment Diagram
Component Diagram
System Flow Chart
System Coding

4.1
4.2
4.3
4.4
4.5
4.6
4.7

Menu Tree
Test Cases, Test Data, Test Result
Program Descriptor
Code
Screen Layout
Hardware & Software requirement
References & Bibliography

Page No.
4
5
6
7
7
7
8
9
11
12
13
14
18
24
32
35
41
52
57
58
63
64
65
66
67
68
81
88
113
116
117

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

Yours 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
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.

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.
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.

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.
10

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.
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 firms 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


of
Completion

Remark

11

Preliminary Investigation
A Organizational
Overview
B Limitations of current
System advantages of
proposed system
C Feasibility Study
System Analysis
A Fact finding
B Even Table
C Use Case Diagram
D Activity Diagram
E Class Diagram
F Object Diagram
G Sequence/Collaboration
Diagram
System Design
A Derive Tables from
entities and relationships
B Component Diagram
C Package Diagram

20th June

D Deployment Diagram

12th Jan

15th Jan

Form/Report Layouts

25th June
30th June
5th July
25th Nov
30th Nov
5th Dec
10th Dec
15th Dec
20th Dec
3rd Jan
5th Jan
8th Jan

System Coding
A Design database(tables
with attributes &
constraints)
B Coding

20th Jan

25th Feb

C Test cases and


Validations
Soft Copy Submission

System Implementation

5th March

7
8

Project Review
Project Report
Submission

20th Feb

1st March
7th March
10th March

12

13

Phase - 2
System Analysis

Fact finding technique


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

2) How do you Maintain records?


By Keeping Registers.
14

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.

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

New
client
details
Searching
client
details
Updating
client
details

Admin

Create new
client record

Admin

Admin

Search for
client details

New client
record is
addad
Display
client
details
Client
record is
updated

Client
record is

Admin

2
3

Add new
client
record
Search
client
records
Update
client
record

Admin

i.
ii.

Delete
client

Deleting
client

Admin

i.

Search for
client
details
Update
client
record
Search for
client

Admin
Admin

15

record

details

Add new
vendor
record

New
vendor
details

Admin

Search
vendor
records
Update
vendor
record

Searching
vendor
details
Updating
vendor
details

Admin

Delete
vendor
record

Deleting
vendor
details

Admin

Add new
employee
record

New
employee
details

Admin

10

Search
employee
records
Update
employee
record

Searching
employee
details
Updating
employee
details

Admin

11

Admin

Admin

details
ii. Delete
client
details
Create new
vendor record
Search for
vendor details
i.

Search for
vendor
details
ii. Update
vendor
record
i. Search for
vendor
details
ii. Delete
vendor
details
Create new
employee record

deleted

New
vendor
record is
addad
Display
vendor
details
Vendor
record is
updated

Admin

Vendor
record is
deleted

Admin

New
employee
record is
added
Search for
Display
employee details employee
details
i. Search for Employee
employee record is
details
updated
ii. Update
employee
record

Admin
Admin

Admin

Admin
Admin

16

12

Delete
employee
record

Deleting
employee
details

Admin

13

Add new
pet record

New pet
details

Admin

14

Search pet
records
Update pet
record

Searching
pet details
Updating
pet details

Admin

16

Delete pet
record

Deleting
pet details

Admin

17

Add new
purchase
product
record

New
purchase
details

Admin

18

Search
purchase
product
records
Update
purchase
record

Searching
purchase
product
details
Updating
purchase
product
details

Admin

Delete
purchase
product

Deleting
purchase
product

Admin

15

19

20

Admin

Admin

i.

Search for
employee
details
ii. Delete
employee
details
Create new pet
record
Search for pet
details
i. Search for
pet details
ii. Update pet
record
i. Search for
pet details
ii. Delete pet
details
Create new
purchase
products record

Employee
record is
deleted

Admin

New pet
Admin
record is
added
Display pet Admin
details
Pet record Admin
is updated
Pet record
is deleted

New
purchase
product
record is
added
Search for
Display
purchase product purchase
details
product
details
i. Search for Purchase
purchase
product
product
record is
details
updated
ii. Update
purchase
product
record
i. Search for Purchase
purchase
product
product
record is

Admin

Admin

Admin

Admin

Admin

17

record

details

21

Add new
stock

New stock
details

Admin

22

Search
stock
records
Update
stock
record

Searching
stock
details
Updating
stock
details

Admin

24

Delete
stock
record

Deleting
stock
details

Admin

25

Add new
order
record
Search
order
records
Update
order
record

New order
details

Admin

Searching
order
details
Updating
order
details

Admin

23

26
27

Admin

Admin

details
deleted
ii. Delete
purchase
product
details
Create new stock New stock
record
record is
added
Search for stock Display
details
stock
details
i. Look up
Stock
product
record is
availabilit updated
y
ii. Search for
stock
details
iii. Update
stock
Record
i Search for Stock
stock
record is
details
deleted
ii Delete
stock
details
Create new order New order
record
record is
added
Search for order Order
details
record is
searched
i Search for Order
order
record is
details
updated
ii Update
order
record

Admin
Admin
Admin

Admin

Admin
Admin
Admin

18

28

Delete
order
record

Deleting
order
details

Admin

29
30

Generate
bill
Search bill

31

Update bill

Generating Admin
bill
Search old Admin
bill
Change
Admin
bill details

Search for
order
details
ii Delete
order
details
Generate bill/
Calculate bill
Search for bill
i
ii

Order
record is
deleted

Admin

Bill
generated
Bill found

Admin

search bill Bill


update bill updated

Admin
Admin

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
Cust_name:varchar
cust_adds:varchar
contact_no:numeric

supp_id:numeric
supp_name:varchar
supp_adds:varchar
contact_no:numeric

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

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

Employee

Product

emp_id:numeric
emp_name:varchar
emp_adds:varchar
contact_no:numeric

prod_id:numeric
prod_name:varchar
prod_type:text

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

New_prod:structure
Update():void
Delete():void

Stock

Pet

Prod_id:numeric
Prod__name:varchar
quantity:numeric
prod_weight:numeric

pet_id:numeric
pet_type:varchar
pet_color:varchar
pet_price:numeric

Update Stock():null

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

34

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
1

Employee
1

1
*

Customer
1

Pet
1

Supplier
1
*
Product
*
*
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
emp_name:Abhishek
emp_address:pune
emp__salary:5000
cont__no:922297390

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

P3:Pet
Pet_id:101
Pet_type:cat
Pet_color:Brown
Pet_price:000
37

2) One customer has one or many pet

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

C: Customer
Cust_id:1
Cust_Name: abc
Cust_Addr: chiplun
ContactNo: 258027

P2:Pet
Pet_id:102
Pet_type:cat
Pet_color:white
Pet_price:3000

P3:Pet
Pet_id:103
Pet_type:cat
Pet_color:white
Pet_price:3500

38

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_quant:10
prod_weight:8kg

prod_id:102
prod_name:cat

p3:product
prod_id:103
prod_name:cat

4) One employee has one stock

e:Employee

s:stock

emp_id:111
emp_name:Ankita
emp_address:chiplun
emp_salary:5000
cont_no:56669930

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

39

5) One employee to many customer

6) One supplier has one supplier order


o:supplier order
s:supplier
supplier_id:111
supplier_name:Amit
supplier_address:chiplun
cont_no:56669930

order_id:100
order_date:11 jan 2014
supplier_name:sachin
prod_name:pet
prod_quantity:10
prod_weight:kg

40

7) One employee to many product


p1:product
prod_id:101
prod_name:cat
prod_price:5000

e:Employee
emp_id:111
emp_name:Ankita
emp_address:chiplun
emp_salary:5000
cont_no:56669930

p2:product
prod_id:102
prod_name:cat
prod_price:4000

p3:product
prod_id:103
prod_name:cat
prod_price:4500

B:customer
8) One customer order to one customer
bill bill
o:customer order

order_id:100
order_date:11 jan 2014
customer_name:Amar
prod_name:pet
prod_quantity:10
prod_weight:kg

bill_id:101
date:11 feb 2016
customer_name:shakti
cont_no:8778447780
pet_type:cat
pet_color:black
pet_price:4000

41

9) One supplier order to many products

p1:product
prod_id:101
prod_name:cat
prod_price:4500

o:supplier order
order_id:100
order_date:11 jan 2014
supplier_name:sachin
prod_name:pet
prod_quantity:10
prod_weight:kg

p2:product
prod_id:102
prod_name:cat
prod_price:4500

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

54

Collaboration Diagrams:
1) Add customer record

2) Update customer record

3) Delete customer record

55

4) Add supplier record

5) Update supplier record

6) Delete supplier record

7) Add employee record

56

8) Update employee record

9) Delete employee record

10)

Add pet record

:User Interface
1.add pet record

:Pet
1.1 add pet()

:Admin

11)

Update pet record

1update pet record


:User Interface

1.1search pet
1.2edit pet
1.3update pet

:Pet

57

12)

Generating order

13)

putting supplier order

58

14)

Receive order

59

Phase 3
System
Design

60

Derive Table From Entities & Relationship


1) Customer Details
Field Name

Data Type

Description

Attributes

Customer Id
Customer Name

Number
Text

Hold customer Id
Hold customer name

Field size=50
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
Supplier Name

Number
Text

Hold supplier Id
Hold supplier name

Field size=50
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
61

4) Products 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

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
Order Date
Customer Name
Pet Id
Pet Name

Number
Datetime
Text
Number
Text

Hold order Id
Hold order date
Hold customer name
Hold Pet Id
Hold pet name

Field size=50
Field size=50
Field size=50
Field size=50
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


62

Field Name

Data Type

Description

Attributes

Order Id
Order Date
Supplier Name
Product Name
Product Quantity

Number
Datetime
Text
Text
Number

Hold order Id
Hold order date
Hold supplier name
Hold product name
Hold product quantity

Field size=50
Field size=50
Field size=50
Field size=50
Field size=50

Product Weight

Number

Hold product weight

Field size=50

8) Employee Details
Field Name
Data Type

Description

Attributes

Employee Id
Employee Name

Number
Text

Hold employee Id
Hold employee name

Field size=50
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

Hold bill Id
Hold date
Hold customer name
Hold contact number
Hold pet type
Hold Pet Id
Hold Pet color
Hold Pet Status
Hold Pet Price
Hold total

Field size=50
Field size=50
Field size=50
Field size=50
Field size=50
Field size=50
Field size=50
Field size=50
Field size=50
Field size=50

9) Customer Bill Details


Bill Id
Date
Customer Name
Contact Number
Pet Type
Pet Id
Pet color
Pet Status
Pet Price
Total

Number
Datetime
Text
Number
Text
Number
Text
Text
Number
Number

63

Deployment Diagram:

DB:Database

AAAAAAAAAAAAAAA
Application Server:
SysAdmin:Executable
CommonApps:
Executable

User1:Admin

Printer

64

Component Diagram

65

System Flow Chart


Add
customer

Maintain customer info


Customer

Maintain supplier info


Add
supplier

Maintain supplier order


Supplier
order
Maintain stock info
Stock

Maintain bill info


Billing

Employe
e

Product

Put
custome
r
jorder

Maintain employee info

Maintain product info

Maintain customer
order

Supplier

Supplier order

Stock

Billing

Employee

Product

Customer
order

66

order

Phase - 4
System Coding

67

Menu Tree
Customer
Supplier
Entry
Form

Employee
Product

Stock
Stationery
Management
System

Customer
Order

Order
Vendor
Order

SaleBill

Utility

Notepad
Calculator

Report

Program descriptor with naming convention


68

1) 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:
1. Login: This function gives the access to program application
2. Exit: This function close the login form.

2) Class : Customer form


Naming
Customer Id
Customer Name
Customer Address
Contact Number

Description
This naming convention is
used to stored the customer id
This naming convention is
used to stored the customer
name
This naming convention is
used to stored the customers
address
This naming convention is
used to stored the customers
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
69

3) 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
Contact Number

This naming convention is


used to stored the supplier
address
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
Pet Type
Pet Color

Pet Weight
Pet Quantity

Description
This naming convention is
used to stored the Pet type
This naming convention is
used to stored the Pet flavor
This naming convention is
used to stored the Pet weight
This naming convention is
70

Pet Price

used to stored the Pet quantity


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
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

71

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) 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
This naming convention is

Pet Quantity

72

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

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
73

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
Employee Address
Employee Salary
Contact Number

This naming convention is


used to stored the employee
address
This naming convention is
used to stored the employee
salary
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
Bill Id
Date
Customer Name

Description
This naming convention is
used to stored the order id
This naming convention is
used to stored the date
This naming convention is
used to stored the customer
74

name
This naming convention is
used to stored the contact
number
This naming convention is
used to stored the Pet type
This naming convention is
used to stored the Pet color

Contact Number
Pet Type
Pet Color

Pet Weight

This naming convention is


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

Pet Quantity
Pet Price
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
case
no

Testing
unit

Login

Assumption

Test data

Step to test

Excepted result

Actual result

Pass/F
ail

Username=text
Password=num

Username=Admin
Password=12345

Display message
welcome

Display
message
welcome

Pass

Username= Admin

Username=

1)open login
form
2)enter
username and
password
3)click ok
Step:1] ,2],3]

Display message

Display

Pass

75

module

Customer
module

Supplier
module

Pet

Password= 12345

C id=number
C name=text
Address=text
Contact no=number

S id=number
S name=text
S Address=text
Contact no=
number

Pet type=text

Password=

please enter
username

Username=12345
Password=23415

Step:1] ,2],3]

Display message
invalid login

Username=Admin
Password=

Step:1] ,2],3]

Display message
please enter
password

C id=1
C name= rohan
Address=khed
Contact
no=5690348954

1)open
customer form
2)fill all
details
3)click ok

Display message
record saved
successfully

C id= er

Step:1] ,2],3]

Display message
please enter
number

C name= 45

Step:1] ,2],3]

Display message
please enter
character

Contact no=106

Step:1] ,2],3]

Display message
at most 10 digit
are require

C id=1
C name=
Address=
Contact
no=4567890234

Step:1] ,2],3]

Display message
fill all details

s id=1
s name= rohan
S Address=khed
Contact
no=5690348954

1)open
supplier form
2)fill all
details
3)click ok

s id= er

message
please enter
username
Display
message
invalid login
Display
message
please enter
password
Display
message
record saved
successfully

Pass
Pass

Pass

Display
message
please enter
number
Display
message
please enter
character
Display
message at
most 10 digit
are require
Display
message=fill
all details

Pass

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

Step:1] ,2],3]

Display message
please enter
number

Pass

s name= 45

Step:1] ,2],3]

Display message
please enter
character

Contact no=106

Step:1] ,2],3]

Display message
at most 10 digit
are require

s id=1
s name=
Address=
Contact
no=4567890234

Step:1] ,2],3]

Display message
fill all details

Display
message
please enter
number
Display
message
please enter
character
Display
message at
most 10 digit
are require
Display
message=fill
all details

Pet type=veg

1)open Pet

Display message

Display

Pass

Pass

Pass

Pass

Pass

Pass

Pass

76

module

Product
module

Stock
module

Pet color=text
Pet weight=num
Pet status=num
Pet price=num

p id=number
p name=text

P id=number
P name=text
P status=number
P weight=number

Pet color=white
Pet weight=10
Pet status=available
Pet price=3000
Pet type= 2

form
2)fill all
details
3)click ok
Step:1] ,2],3]

record saved
successfully

message
record saved
successfully

Display message
please enter
character

Pass

Pet color= 45

Step:1] ,2],3]

Display message
please enter
character

Pet weight=abc

Step:1] ,2],3]

Display message
please enter
number

Pet status=65

Step:1] ,2],3]

Display message
please enter
character

Pet price=fghg

Step:1] ,2],3]

Display message
please enter
number

Pet type=cvvv
Pet color=abc
Pet weight=
Pet status=
Pet price=
p id=1
p name= abc

Step:1] ,2],3]

Display message
fill all details

Display
message
please enter
character
Display
message
please enter
character
Display
message
please enter
number
Display
message
please enter
number
Display
message
please enter
number
Display
message=fill
all details

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

p id= er

1)open
product form
2)fill all
details
3)click ok
Step:1] ,2],3]

Display message
please enter
number

Pass

P name= 45

Step:1] ,2],3]

Display message
please enter
character

p id=1
p name=

Step:1] ,2],3]

Display message
fill all details

p id=1
p name=avbc
p status= 60
P weight=10

Display message
record saved
successfully

P id= er

1)open stock
form
2)fill all
details
3)click ok
Step:1] ,2],3]

Display
message
please enter
number
Display
message
please enter
character
Display
message=fill
all details
Display
message
record saved
successfully

Pass

P name= 45

Step:1] ,2],3]

Display message
please enter
character

P status=a

Step:1] ,2],3]

Display message
please enter
number

Display
message
please enter
number
Display
message
please enter
character
Display
message
please enter

Display message
please enter
number

Pass

Pass

Pass

Pass

Pass

Pass

Pass
Pass

Pass

Pass

77

number

Cust
Order
module

Supp
Order
module

O id=number
O date=date
Cust name=text
Pet type= text
Pet status= number
Pet color=text
Pet weight=number

O id=number
O date=date
Supp name=text
Prod name= text
Prod status=
number
prod

P weight=a

Step:1] ,2],3]

Display message
please enter
number

Display
message
please enter
number
Display
message=fill
all details

Pass

P id=1
P name=
P status=70
P weight=

Step:1] ,2],3]

Display message
fill all details

O id=1
O date=14/11/2012
Cust name=pooja
Pet type= cat
Pet status= available
Pet color=black
Pet weight=5
O id= ret

1]open order
form
2]fill all
information
3]click ok

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

Step:1] ,2],3]

Display message
please enter
number

Pass

O date= 14/3/

Step:1], 2],3]

Display message
please enter
year

Cust name= 134

Step:1] ,2],3]

Display message
please enter
character

Pet type=h67h

Step:1] ,2],3]

Display message
please enter
character

Pet status=566

Step:1] ,2],3]

Display message
please enter
character

Pet color= 143

Step:1] ,2],3]

Display message
please enter
character

Pet weight=tyre

Step:1] ,2],3]

Display message
please enter
number

O id=1
O date=
Cust name=pooja
Pet type= cat
Pet status= 1
Pet color=black
Pet weight=
O id=1
O date=14/11/2012
Supp name=suraj
Prod name= dalada
Prod status= 100
Prod weight=5

Step:1], 2],3]

Display message
fill all
information

Display
message
please enter
number
Display
message
please enter
year
Display
message
please enter
character
Display
message
please enter
character
Display
message
please enter
number
Display
message
please enter
character
Display
message
please enter
number
Display
message fill all
information

1]open order
form
2]fill all
information
3]click ok

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

Pass

78

Pass

Pass

Pass

Pass

Pass

Pass

Pass

weight=number

Employee
module

E id=
number
E name=text
E Address=text
E salary=number
contact no=
number

O id= ret

Step:1] ,2],3]

Display message
please enter
number

Display
message
please enter
number
Display
message
please enter
year
Display
message
please enter
character
Display
message
please enter
character
Display
message
please enter
number
Display
message
please enter
number
Display
message fill all
information

Pass

O date= 14/3/

Step:1], 2],3]

Display message
please enter
year

Supp name= 134

Step:1] ,2],3]

Display message
please enter
character

Prod name=h67h

Step:1] ,2],3]

Display message
please enter
character

Prod status=lmn

Step:1] ,2],3]

Display message
please enter
number

Prod weight=pnv

Step:1] ,2],3]

Display message
please enter
number

O id=1
O date=14/11/2012
Supp name=
Prod name= dalada
Prod status=
Prod weight=5
e id=1
e name= rohan
E Address=khed
E salary=5000
Contact
no=5690348954

Step:1], 2],3]

Display message
fill all
information

1)open
employee
form
2)fill all
details
3)click ok

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

E id= er

Step:1] ,2],3]

Display message
please enter
number

Pass

E name= 45

Step:1] ,2],3]

Display message
please enter
character

E salary=tyg

Step:1] ,2],3]

Display message
enter number

Display
message
please enter
number
Display
message
please enter
character
Display
message enter
number

Contact no=106

Step:1] ,2],3]

Display message
at most 10 digit
are require

Pass

e id=1
e name=
e Address=
e salary=4000
contact no=

Step:1] ,2],3]

Display message
fill all details

Display
message at
most 10 digit
are require
Display
message=fill
all details

Pass

Pass

Pass

Pass

Pass

Pass

Pass

Pass

Pass

79

10

Billing
module

Bill id=number

Date=date
Cust name=text
Contact
no.=number
Pet type=text
Pet color=text
Pet status=number
Pet weight=number

Bill id= 101


Date=15/5/1014
Cust name=nitish
Contact
no.=number
Pet type=cat
Pet color=whiite
Pet status=avalabl
Pet weight=8
Pet price=5000
Total=5000
C id= op

1] open billing
form
2] fill all
details
3]click ok

Display message
record saved
successfully

Display
message
record saved
successfully

Pass

Step:1] ,2],3]

Display message
please enter
number

Pass

Date=/2/2015

Step:1] ,2],3]

Display message
please enter
day

Cust name= 45

Step:1] ,2],3]

Display message
please enter
character

Pet type=459

Step:1], 2],3]

Display message
please enter
character

Pet color=n87

Step:1], 2],3]

Display message
please enter
character

Pet status=jk

Step:1], 2],3]

Display message
please enter
number

Pet weight=ab

Step:1], 2],3]

Display message
please enter
number

Pet price=ahg

Step:1], 2],3]

Display message
please enter
number

Total =nhj890

Step:1], 2],3]

Display message
please enter
number

Bill id= 101


Date=15/5/1014
Cust name=nitish
Contact
no.=8552992587
Pet type=
Pet color= bhj
Pet status=
Pet weight=5
Pet price=300
Total=1500

Step:1], 2],3]

Display message
please fill all
information

Display
message
please enter
number
Display
message
please enter
day
Display
message
please enter
character
Display
message
please enter
character
Display
message
please enter
character
Display
message
please enter
number
Display
message
please enter
number
Display
message
please enter
number
Display
message
please enter
number
Display
message
please fill all
information

Pass

Pass

Pass

Pass

Pass

Pass

Pass

Pass

Pass

80

Program descriptor with naming convention


11)

class : login form


81

Naming
Username

Password

Login form is to hold all information about login.


Description
This naming convention is used to
stored the username
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
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 customers address
Contact Number
This naming convention is used
to stored the customers 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
82

Supplier Name

This naming convention is used


to stored the supplier name

Supplier Address

This naming convention is used


to stored the supplier address
This naming convention is used
to stored the Contact Number

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


Pet form is hold all information about Pet.

Naming
Pet Type
Pet Color

Pet Weight
Pet Status
Pet Price

Description
This naming convention is used
to stored the Pet type
This naming convention is used
to stored the Pet color
This naming convention is used
to stored the Pet weight
This naming convention is used
to stored the Pet status
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

83

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

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

84

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
Pet Status

This naming convention is used


to stored the Pet weight
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
Order Id

Description
This naming convention is used
to stored the order id
85

Order Date
Supplier Name
Product Name
Product Status

Product Weight

This naming convention is used


to stored the order date
This naming convention is used
to stored the supplier name
This naming convention is used
to stored the product name
This naming convention is used
to stored the product status
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.


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
Employee Salary
Contact Number

This naming convention is used


to stored the employee address
This naming convention is used
to stored the employee salary
This naming convention is used
to stored the Contact No.

Function:
1) add: this function add the employee record
86

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
Bill Id
Date
Customer Name
Pet Type
Pet Color

Pet Weight
Pet Status
Pet Price
Total

Description
This naming convention is used
to stored the order id
This naming convention is used
to stored the date
This naming convention is used
to stored the customer name
This naming convention is used
to stored the Pet type
This naming convention is used
to stored the Pet flavour
This naming convention is used
to stored the Pet weight
This naming convention is used
to stored the Pet status
This naming convention is used
to stored the Pet price
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:88

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)
'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

89

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
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

90

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)
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

91

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()
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

92

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

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

93

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
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()

94

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()
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

95

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
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

96

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)
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 :97

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)
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)

98

'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
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

99

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()
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

100

'
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
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

101

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
'
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

102

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"
' 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

103

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
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()

104

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]"
'
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

105

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
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()

106

cmd.CommandText = "select
cbVendorname.Text & "' "
cmd.Connection = con
con.Close()
Catch ex As Exception
End Try
End If
dr.Close()
con.Close()
End Sub

from Vendor where [VendorName]='" &

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()
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()

107

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()
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

108

'
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
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

109

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)
'
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()

110

'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

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")

111

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
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)

112

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()
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

113

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:

MDI Form:

114

Customer Form:

Bill :-

115

Order:-

Report
116

Report of Pet Stock

Reference Bibliography
Murachs Visual Basic 2008
Mastering Visual Basic 2008
Complete Reference VB.Net
Referred Websites

117

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

MONITOR

Color

SOFTWARE REQUIRMENT
OPERATING SYSTEM
Above

VISUAL BASIC .NET VERSION


Edition.
.NET FRAMEWORK VERSION

Windows 7 and

2008 Express

3.5 or above

118

119

Vous aimerez peut-être aussi