Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Shop Management

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 98

A

PROJECT REPORT

ON

‘SHOP MANAGEMENT SYSTEM’

BY
Tejas Ambekar

SUBMITED TO
“UNIVERSITY OF PUNE”
AT
JSPM’s ENIAC INSTITUTE OF COMPUTER APPLICATION
WAGHOLI, PUNE.

( 2010-2011)

J.S.P.M.
ENIAC Institute of computer application,
Wagholi Pune

(2010-2011)

JSPM’S ENIAC INSTITUTE OF COMPUTER APPLICATION


Certificate

This is to certify that Mr. Sumit R. Khakre & Mr. Rohan V. Jaware are
students of ENIAC Institute of Computer Application has successfully completed
Project in ‘SHOP MANAGEMENT SYSTEM’ which was carried out in partial
fulfillment for the Degree of MCA of Pune University under the guidance of
Mr. Dinkar Gore.

During there Project they were found to be sincere and hardworking and we
wish them All the Best for there further academics and career.

Project Guide HOD Director


Mr. Dinkar Gore Mr.Vishal Choudhary Mrs.Sarika Sharma
TABLE OF CONTENT

Sr. Topics Page


No No.
.
1 Introduction of the System

2 Hardware & software Requirements

3 Screen shots & Reports

4 Database Design

5 Limitations of Current System

6 Future Enhancement
Introduction

‘SHOP MANAGEMENT SYSTEM’ is a small system


made for a small shops. The system keeps record of all the entered
product, customer, and company entry

This application has been designed for following purpose:

1. To keep record of newly added product , customer , company.

2. To update all the information about the product , customer,


company

3. Generate a bill for the Customer.

4. Search all the information about Customer , product, company

5. Delete a particular record

6. Edit the records


System Requirements

Hardware Requirements

1. Pentium 4 processor
2. Windows XP/2000
3. 512 MB RAM

Software requirements

1. Visual studio 2008


2. Visual Basic .NET 2.0
3. Microsoft Office

Backend
1. Ms-Access
Scope of System.
The main aim of this system is to simplify the Shop data management.

 As the system comprises of various forms, it’s very easy to handle


operation related to treading company.

 Due to computerization, it is very easy to search the data of all


available product, company and customer.

 This system is very timesaving & easy.

 All work is done by single person, so one trained person can do the
entire job.
Feasibility Study

The feasibility study involves three main phases such as Technical


feasibility, Behavioral feasibility and Economical feasibility.

Technical feasibility:
The technical feasibility always focuses on the existing computer
hardware & software and personnel. This also includes the need for
more hardware or software or personnel and the possibility of installing
such facility. For example, if the current computer is operating at 80
percent capacity an arbitrary ceiling then running another application
could overload the system or require additional hardware. This involves
financial consideration to accommodate technical enhancement. If the
budget is a serious constraint, then the project id judged not feasibility.

Economical feasibility:
It is also important that our system should be economically feasible and
this measure of the cost effectiveness of a project. This is often called a
cost-benefit Analysis. The software and hardware required for this
system are easily available now a day. No additional Cost will be
incurred for expensive software or hardware.
The system will also reduce lots of paper work.
Chances of errors is very minimum, and provide consistent information.
This will lead to better output and will save lots of money.
Behavioral feasibility:
People are inherently resistant to change and computers have been known to
facilitate changes. An estimate should be made of how strong a reaction the user
staff is likely to have toward the development of a computerized system. It is
common knowledge that the computer installations have something to do with
turnover, transfer, retraining and changes in employee job status. Therefore, it is
understandable that the introduction of a candidate system requires special effort to
educate, sell and train the staff on new ways of conducting business.

Operational Feasibility:-
Operational feasibility measure how well a solution will work
on every Operation. It is also a measure of how people feel about
System Project. Industries among at office automation to achieve
Paperless concept which are achieved through Computerization
which will cut down manual working of employee of home
appliance service center .The proposed system is operationally
feasible because it works according to yhe user’s need and the
desired operation is done.
SYSTEM DIGRAM
TREE DIGRAM

LOGIN

Customer Product Details Company Report


Details
Details

Customer Product Company ID Transaction


ID ID Report

Customer Customer Report


Name Product Company Name
Name

Customer Bill Report


No. Address
Serial no.
Email ID
Contact No.
Product
Address Quantity
Email ID

Type
USE CASE DIGRAM

User Login

User Insert Product Details.

User Update Product Details..

Product Information

View Customer Details

Update Customer Details Customer


Administrator

View Company Details

Update Company Details

Purchase Product

Bill
Entity Relationship Diagram

Customer

1
Product
Bill
M
1

M 1
Company
Final Bill
Context Level
Diagram

Request for the product Store/update customers ,

Customer product & company details

Shop

Management
Admin
System

P rodu ct dispatched
Retreive details

Rules & Regulations Accept Reports

Management

1st Level Fragments


Company,product Save the product
Details details
Admin Product
1.0 Store Company
Customer details profile
company
Customer Prepare master
Store Customer
File
Provide Details details
Management Customer

product details
Product
Request for product
Company profile
Admin Order dispatched 2.0 company
Purchase Store transaction

generate bill Final Bill

request product
Search for product details
Product
3.0 show list
Customer get result
Search
product show details
company

request for product product list


Product
prepare invoice
4.0
Dispatch product Sales
generate invoice Bill

accept detailed
report
Management 5.0
prepare final
report

Package Diagram
User Interface

Customer Registration

Clark

Database

Customer

Product
Report Processing

Report
Bill
Type
Report No.
Date

Order
Class Diagram
Object Diagram
P:Product

ProductId: P01
Product Name: PenDrive

F:Final Bill B: Bill

Serial No.: S01 TransId: 1


Product: PenDrive ProductName: PenDrive
Rate: 300 Rate: 300

Co: Company Cu:Customer


CompId: C101 CustId: C201
CompName:Kingstone CustName: Tejas
Activity Diagram

Admin Login
Wrong user

No

A
Yes

Create
company,product,
customer details

Update master details

Admin place purchase


order

Product and company


details verification

No cancel order

Yes

bill generated & order C


dispatched

B
B

customer search
product

request for product

Bill generated

product dispatched

A close invoice C
Sequence Diagram For Sales

Product

Shop
Admin database
<<create>>
search() Sales

store transaction
details
issue
saleorder
transaction
dispatch completed
product

<<destroy>>
Sequence Diagram For Purchase

Product

Shop
Customer database
<<create>>
search() Purchase

store order
details
issue
order
transaction
dispatch completed
product

<<destroy>>

Event Table
Event Trigger source Activity Respons Destinatio
e n
Create the Record the Admin Save the Display the Admin
Product product product product
record

Maintain Add new Admin Save the Display the Admin


stock record of product total product
update product update the available
with old product
product
Customer Product Customer Lookup Product detail Customer
place order inquiry product generation

Create Update Admin Create the Display the Admin


customer customer customer payment
bill account payment

Maintain Update Admin Update the Display the Admin


customer whole total Customer total customer
bill account of account account
customer

Create Update the Manager Update the Display the Manager


dealer Bill dealer dealer dealer account
account account

Maintain Dealer Manager Update Display the Manager


Dealer bill payment Dealer dealer
payment payment

Product Product Manager Purchase Display order Manager


Purchase order product Report
order order

Component Diagram
Customer

Enquiry Shop

Customer Order
Admin

Dealer
Customer
Bill
Company

Report
Collaboration Diagram

2.1 Validate
1.Find user User User Validator
2.Update User
Windows App.
User Interface
1.1 LookUpUser

User DB
2.1 LookUser

1:Fp=Find(Product)
Purchase Product Company

2:(product,Fp)
:Stock

1.1 Fp=Find(Product) 1.2Fp=Find(p)

:Product qty :Product Price


:Product qua
1:Fp=Find Product(product)

Sale Product Customer

2:(Product,Fp)
:Stock

1.1 Fp=Find(Product) 2.1Fp=Find(p)

:Product qty :Product Price


:Product qua
Screen shots

Login Form:
Main Form :

C
Customer Entry Form:
Product Entry Form :
Shop Product Selection Form :
Company Entry Form :
Database Design
Login :

User_id Text
Password Text

Customer :

Cust_id Text
Cust_name Text
Cont_no Text
Email_id Text
Cust_id Text

Product :

Prod_id Text
Prod_name Text
Serial_no Text
Prod_comp Text
Prod_qty Number
Prod_dt Date/Time
Prod_prize Number
Company :

Comp_id Text
Comp_name Text
Cmp_add Text
Contact_no Number
Fax_no Number
Email_id Text
Comp_type Text

Bill :

Cust_id Text
Cust_name Text
Trans_id Number
Date Date/time
Itemname Text
Itemmcomp Text
Itemserial Text
Itemid Text
Itemqty Number
Itenrate Number
Rmqty Number
Itemdisc Number
Totalprize Number
Conclusion
This software fulfills for the requirement of Product purchase.
This software is used to conclude that
1. This information about product, customer and company
easily and quickly obtained.
2. Billing process is very fast.
3. The system is also useful for keeping personal information of
customer and company.
4. The information is given by the system in the forms of the
report is timely and accurate.
5. The transformation of information is very easy that we can go
any form at any record at any time.
The data in the system can be backed up directly on the access.
This project is developed to nurture the needs of a user in a Shopping by
embedding all the tasks of transactions taking place in a Shopping
management.
Future version of this software will still be much enhanced than the
current version 1.0.Thus the ‘Shop System’ is developed and executed
successfully.
Limitation of the project

1. Searching only by using id not able to search by using name.

2. Not able to print bill.

3. Could not Connect To Internet.


Future Enhancement

1. In future this windows application will provide online order


system. In which user can be able to make order. The transaction
of money will be done through online system via credit card or
debit card.

2. There would be facilities to have user feedback and requirements.

3. In future we will provide the online accessories.


Bibliography

Books:
 Programming in Visual Basic .NET

 Exploring Visual Basic .NET

Web Sites :

 www.wikipedia.com

 www.projectrefference.com

 www.google.com
Source Code
1. Login Form

Public Class loginform


Dim cn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim str As String
Dim oledbdr As OleDb.OleDbDataReader
Dim count As Integer
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and
Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")
count = 0

End Sub

Private Sub okbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles okbtn.Click

cn.Open()
If usertxt.Text = "" Then
MsgBox("Please enter valid user id")
usertxt.Focus()
Else
str = "select * from login where user_id='" &
usertxt.Text & "' and password='" & passtxt.Text & "' "
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader()

usertxt.Text = ""
passtxt.Text = ""

Dim i As Integer
i = 0
While oledbdr.Read()
usertxt.Text = oledbdr("user_id")
passtxt.Text = oledbdr("password")

i = i + 1
End While
If i = 0 Then
MsgBox("Sorry U Have Not User.....!")
Else
shopmain.Show()
Me.Visible = False
usertxt.Text = ""
passtxt.Text = ""
End If
End If

cn.Close()

count = count + 1

If count > 2 Then


MsgBox("Sorry U Have Not Permission To Login
Please Contact To Administrator")
Me.Close()
End If
'Me.Close()
End Sub

Private Sub cancelbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles cancelbtn.Click
Me.Close()
shopmain.Close()
customer.Close()
company.Close()
product.Close()
purchase.Close()
bill.Close()
End Sub

End Class

2. MDI Form

Public Class shopmain


Private Sub shopmain_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
DateTimePicker1.Enabled = False
'Label8.Text = loginform.usertxt.Text
End Sub
Private Sub productbtn_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles productbtn.Click

product.Show()
product.oldradio.Checked = True
Me.Visible = False

End Sub

Private Sub companybtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles companybtn.Click
company.Show()
Me.Visible = False
End Sub

Private Sub customerbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles customerbtn.Click
customer.Show()
Me.Visible = False
End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
End
Me.Close()

End Sub

Private Sub backbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles backbtn.Click
Me.Close()
loginform.Visible = True
loginform.Show()
End Sub

Private Sub billbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles billbtn.Click
purchase.Show()
Me.Visible = False

End Sub

Private Sub ProductDetailsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
ProductDetailsToolStripMenuItem.Click
product.Show()
Me.Visible = False
End Sub

Private Sub CustomerDetailsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
CustomerDetailsToolStripMenuItem.Click
customer.Show()
Me.Visible = False

End Sub

Private Sub CompanyDetailsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
CompanyDetailsToolStripMenuItem.Click
company.Show()
Me.Visible = False

End Sub

Private Sub BillDetailsToolStripMenuItem_Click(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
BillDetailsToolStripMenuItem.Click
purchase.Show()
Me.Visible = False

End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
Me.Close()
loginform.Enabled = True
loginform.Show()

End Sub

Private Sub custbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles custbtn.Click
Form1.Show()

End Sub

Private Sub finalbillbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles finalbillbtn.Click
finalcrystal.Show()
End Sub
Private Sub btn_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btn.Click
Form2.Show()
custidtxt.Text = ""
End Sub
End Class

3. Company Form

Public Class company

Dim cn As New OleDb.OleDbConnection


Dim cmd As New OleDb.OleDbCommand
Dim oledbdr As OleDb.OleDbDataReader
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet

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


e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'ShopdatabaseDataSet10.company' table. You can move, or remove
it, as needed.

Me.CompanyTableAdapter2.Fill(Me.ShopdatabaseDataSet10.company)
'TODO: This line of code loads data into the
'ShopdatabaseDataSet9.company' table. You can move, or remove it,
as needed.

'Me.CompanyTableAdapter1.Fill(Me.ShopdatabaseDataSet9.company)
'TODO: This line of code loads data into the
'ShopdatabaseDataSet2.company' table. You can move, or remove it,
as needed.

'Me.CompanyTableAdapter.Fill(Me.ShopdatabaseDataSet2.company)
cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")

oldradio.Checked = True

AddToolStripMenuItem.Enabled = False
SearchToolStripMenuItem.Enabled = True
SaveToolStripMenuItem.Enabled = True
DeleteToolStripMenuItem.Enabled = True
UpdateToolStripMenuItem.Enabled = True
SelectToolStripMenuItem.Enabled = True
End Sub

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


e As System.EventArgs) Handles addbtn.Click
add1()
End Sub

Private Sub newradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
newradio.CheckedChanged
If newradio.Enabled = True Then
new1()
SearchToolStripMenuItem.Enabled = False
End If
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles savebtn.Click
save1()
End Sub

Private Sub searchbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles searchbtn.Click
search1()
End Sub

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


e As System.EventArgs) Handles rstbtn.Click
reset1()
End Sub

Private Sub showbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles showbtn.Click
refresh1()
End Sub

Private Sub selectbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles selectbtn.Click
select1()
End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
exit1()
End Sub
Private Sub dltbtn_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles dltbtn.Click
delete1()
End Sub

Private Sub updtbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles updtbtn.Click
update1()
End Sub

Private Sub oldradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
oldradio.CheckedChanged
If oldradio.Enabled = True Then
compid.Enabled = True
compname.Enabled = False
compadd.Enabled = False
compno.Enabled = False
compfaxno.Enabled = False
compeid.Enabled = False
comptype.Enabled = False
searchbtn.Enabled = True
addbtn.Enabled = False
rstbtn.Enabled = True
updtbtn.Enabled = True
dltbtn.Enabled = True
savebtn.Enabled = True
selectbtn.Enabled = True

compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""

AddToolStripMenuItem.Enabled = False
SearchToolStripMenuItem.Enabled = True
SaveToolStripMenuItem.Enabled = True
DeleteToolStripMenuItem.Enabled = True
UpdateToolStripMenuItem.Enabled = True
SelectToolStripMenuItem.Enabled = True

End If
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
NewToolStripMenuItem.Click
new1()
newradio.Checked = True
End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SaveToolStripMenuItem.Click
save1()
End Sub

Private Sub SelectToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SelectToolStripMenuItem.Click
select1()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
exit1()
End Sub

Private Sub ResetToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ResetToolStripMenuItem.Click
reset1()
End Sub

Private Sub UpdateToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
UpdateToolStripMenuItem.Click
update1()
End Sub

Private Sub AddToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
AddToolStripMenuItem.Click
add1()
End Sub
Private Sub SearchToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SearchToolStripMenuItem.Click
search1()
End Sub

Private Sub DeleteToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
DeleteToolStripMenuItem.Click
delete1()
End Sub

Private Sub ShowToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ShowToolStripMenuItem.Click
refresh1()
End Sub

Sub add1()

If compid.Text = "" Then


MsgBox("Please Fill The Company ID Field.....!!!!")
compid.Text = ""
compid.Focus()
Return
End If

If compname.Text = "" Then


MsgBox("Please Fill The Company Name Field......!!!")
compname.Text = ""
compname.Focus()
Return
End If

If compadd.Text = "" Then


MsgBox("Please Fill The Company Address
Field.....!!!")
compadd.Text = ""
compadd.Focus()
Return
End If

If compno.Text = "" Then


MsgBox("Please Fill The Company Number
Field.....!!!")
compno.Text = ""
compno.Focus()
Return
End If

If compfaxno.Text = "" Then


MsgBox("Please Fill The Company Fax Number
Field....!!!")
compfaxno.Text = ""
compfaxno.Focus()
Return
End If

If compeid.Text = "" Then


MsgBox("Please Fill The Company Email-ID
Field....!!!!")
compeid.Text = ""
compeid.Focus()
Return
End If

If compeid.Text.IndexOf("@") <= 0 Or
compeid.Text.IndexOf(".") <= compeid.Text.IndexOf("@") Or
compeid.Text.IndexOf(".") <= 0 Then
MsgBox("Please Fill The Proper Email-ID .....!!!!")
compeid.Text = ""
compeid.Focus()
Return

End If
If comptype.Text = "" Then
MsgBox("Please Fill The Company Type ....!!!!")
comptype.Text = ""
comptype.Focus()
Return

End If
If IsNumeric(compno.Text & compfaxno.Text) Then

cmd.CommandText = "insert into company values('" &


compid.Text & " ', '" & compname.Text & "' , '" & compadd.Text &
"' , " & compno.Text & " , " & compfaxno.Text & ",'" &
compeid.Text & "','" & comptype.Text & "')"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
cn.Open()
Dim i As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Added....!!!!")

Else
MsgBox("company no and fax no should contain number
only...!!!")
compno.Text = ""
compno.Focus()
compfaxno.Text = ""
compfaxno.Focus()
Return

End If

da = New OleDb.OleDbDataAdapter("select * from company",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""

End Sub

Sub new1()
compid.Enabled = True
compname.Enabled = True
compadd.Enabled = True
compno.Enabled = True
compfaxno.Enabled = True
compeid.Enabled = True
comptype.Enabled = True
searchbtn.Enabled = False
addbtn.Enabled = True
rstbtn.Enabled = True
updtbtn.Enabled = False
savebtn.Enabled = False
dltbtn.Enabled = False
selectbtn.Enabled = False

compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""

SaveToolStripMenuItem.Enabled = False
DeleteToolStripMenuItem.Enabled = False
UpdateToolStripMenuItem.Enabled = False
SelectToolStripMenuItem.Enabled = False
AddToolStripMenuItem.Enabled = True
End Sub

Sub search1()

cn.Open()
Dim str As String
If compid.Text = "" Then
MsgBox("Please Enter Company ID")
Else
str = "select * from company where comp_id= '" &
compid.Text & "'"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""
comptype.Text = ""
Dim i As String
i = 0
While oledbdr.Read()
compid.Text = oledbdr("comp_id")
compname.Text = oledbdr("comp_name")
compadd.Text = oledbdr("comp_add")
compno.Text = oledbdr("contact_no")
compfaxno.Text = oledbdr("fax_no")
compeid.Text = oledbdr("email_id")
comptype.Text = oledbdr("comp_type")
i = i + 1
End While
If i = 0 Then
MsgBox("No Record Found....!!!!")

End If
End If
cn.Close()

End Sub

Sub delete1()

Try
Dim i As Integer
cn.Open()
Dim str As String
If compid.Text = "" Then
MsgBox("Please Enter Customer Id....!!!")
Else

str = "select * from company where comp_id='" &


compid.Text & "'"

cmd.CommandText = str
cmd.Connection = cn
oledbdr = cmd.ExecuteReader

compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""
comptype.Text = ""

i = 0
While oledbdr.Read

i = i + 1
End While

End If
cn.Close()

If i = 0 Then
MsgBox("No Record found....!!!")
Else
cn.Open()

cmd.CommandText = " delete from company where


comp_id='" & compid.Text & " '"
cmd.CommandType = CommandType.Text
cmd.Connection = cn

Dim ii As Integer = cmd.ExecuteNonQuery

cn.Close()
MsgBox("Successfully Record Deleted...!!!")
End If

Catch ex As Exception
MessageBox.Show(ex.Message)

End Try
compid.Text = ""

da = New OleDb.OleDbDataAdapter("select * from company",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub
Sub reset1()
compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""
End Sub

Sub refresh1()
da = New OleDb.OleDbDataAdapter("select * from company",
cn)
ds = New DataSet
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()
End Sub

Sub select1()
Try
compid.Text =
DataGridView1.SelectedCells(0).Value.ToString()
compname.Text =
DataGridView1.SelectedCells(1).Value.ToString()
compadd.Text =
DataGridView1.SelectedCells(2).Value.ToString()
compno.Text =
DataGridView1.SelectedCells(3).Value.ToString()
compfaxno.Text =
DataGridView1.SelectedCells(4).Value.ToString()
compeid.Text =
DataGridView1.SelectedCells(5).Value.ToString()
comptype.Text =
DataGridView1.SelectedCells(6).Value.ToString()
Catch ex As Exception
MsgBox("Please select the complete row or Use Search
Button")
' MessageBox.Show(ex.Message)
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""
comptype.Text = ""
End Try

End Sub

Sub update1()
compid.Enabled = True
compname.Enabled = True
compadd.Enabled = True
compno.Enabled = True
compfaxno.Enabled = True
compeid.Enabled = True
comptype.Enabled = True

End Sub

Sub save1()
Try
If compid.Text = "" Then
MsgBox("Please Fill The Company ID Field...!!!!
")
compid.Text = ""
compid.Focus()
Else
cn.Open()
Dim str As String
str = "update company set comp_name = '" &
compname.Text & "', comp_add= '" & compadd.Text & "' ,
contact_no = " & compno.Text & " , fax_no = " & compfaxno.Text &
" ,email_id= '" & compeid.Text & " ', comp_type='" &
comptype.Text & "' where comp_id = '" & compid.Text & "' "
cmd.CommandText = str
MsgBox(str)
cmd.CommandType = CommandType.Text
cmd.Connection = cn
'Dim oledbdr As Integer = OleDb.OleDbDataReader
Dim ii As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Updated" & ii)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

da = New OleDb.OleDbDataAdapter("select * from company",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

compid.Text = ""
compname.Text = ""
compadd.Text = ""
compno.Text = ""
compfaxno.Text = ""
compeid.Text = ""
comptype.Text = ""

oldradio.Checked = True
End Sub

Sub exit1()
shopmain.Show()
Me.Hide()

End Sub

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


e As System.EventArgs) Handles Label1.Click

End Sub

Private Sub compid_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles compid.TextChanged

End Sub
End Class

4. Bill Form

Public Class bill

Dim cmd As New OleDb.OleDbCommand


Dim cn As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet()
Dim oledbdr As OleDb.OleDbDataReader

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


As System.EventArgs) Handles MyBase.Load

cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")
'TODO: This line of code loads data into the
'ShopdatabaseDataSet8.finalbill' table. You can move, or remove
it, as needed.

Me.FinalbillTableAdapter.Fill(Me.ShopdatabaseDataSet8.finalbill)
'TODO: This line of code loads data into the
'ShopdatabaseDataSet6.finalbill' table. You can move, or remove
it, as needed.
custid.Text = purchase.custidtxt.Text
transid.Text = purchase.transtxt.Text
custname.Text = purchase.custnametxt.Text
dttxt.Text = purchase.dt1txt.Text

custid.Enabled = False
transid.Enabled = False
custname.Enabled = False
dttxt.Enabled = False

Try

Me.FinalbillTableAdapter.FillBy(Me.ShopdatabaseDataSet8.finalbill
, transid.Text)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

Try
cn.Open()
Dim str As String
Dim gt As Double = 0
str = "select totalprize from bill where trans_id='"
& transid.Text & "'"
' MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read

gt = gt + oledbdr("totalprize")
gttextbox.Text = gt

End While
gttextbox.Text = gt
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
totalamt.Text = gttextbox.Text

Dim a As Double = Val(gttextbox.Text / 100) * 12.5


disctxt.Text = Val(a)
totalamt.Text = Val(gttextbox.Text) + a

End Sub

Private Sub FillByToolStripButton_Click_1(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
FillByToolStripButton.Click
Try

Me.FinalbillTableAdapter.FillBy(Me.ShopdatabaseDataSet8.finalbill
, TrancidToolStripTextBox.Text)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub disctxt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
disctxt.TextChanged

End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
shopmain.Show()
Me.Hide()

End Sub

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


e As System.EventArgs)
Me.Close()
purchase.Show()

purchase.custidtxt.Text = ""
purchase.custnametxt.Text = ""
purchase.transtxt.Text = ""

purchase.newradio.Checked = False
purchase.prevradio.Checked = False

End Sub

Private Sub backbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles backbtn.Click
purchase.Show()
Me.Hide()
End Sub

Private Sub DataGridView1_CellContentClick(ByVal sender As


System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick

End Sub
End Class

5. Customer Form

Public Class customer


Dim oledbdr As OleDb.OleDbDataReader
Dim cn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet()

Private Sub customer_Load(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'ShopdatabaseDataSet1.customer' table. You can move, or remove
it, as needed.

Me.CustomerTableAdapter.Fill(Me.ShopdatabaseDataSet1.customer)
cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")
oldradio4.Checked = True
AddToolStripMenuItem.Enabled = False
SearchToolStripMenuItem.Enabled = True
DeleteToolStripMenuItem.Enabled = True
SaveToolStripMenuItem.Enabled = True
SelectToolStripMenuItem.Enabled = True
UpdateToolStripMenuItem.Enabled = True
End Sub

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


e As System.EventArgs) Handles rstbtn.Click
reset()
oldradio4.Checked = True
End Sub

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


e As System.EventArgs) Handles addbtn.Click
add()
End Sub

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


e As System.EventArgs) Handles dltbtn.Click
delete()
End Sub

Private Sub searchbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles searchbtn.Click
search()
End Sub

Private Sub newradio3_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
newradio3.CheckedChanged
If newradio3.Checked = True Then
new1()
AddToolStripMenuItem.Enabled = True
UpdateToolStripMenuItem.Enabled = False
SearchToolStripMenuItem.Enabled = False
DeleteToolStripMenuItem.Enabled = False
SaveToolStripMenuItem.Enabled = False
SelectToolStripMenuItem.Enabled = False
End If
End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
exit1()
End Sub

Private Sub updtbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles updtbtn.Click
update1()
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles savebtn.Click
save()
End Sub

Private Sub selectbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles selectbtn.Click
select1()
End Sub

Private Sub showbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles showbtn.Click
Refresh()
End Sub

Private Sub oldradio4_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
oldradio4.CheckedChanged
If oldradio4.Enabled = True Then
custid.Enabled = True
custname.Enabled = False
custno.Enabled = False
custeid.Enabled = False
custadd.Enabled = False
searchbtn.Enabled = True
addbtn.Enabled = False
dltbtn.Enabled = True
rstbtn.Enabled = True
updtbtn.Enabled = True
savebtn.Enabled = True
selectbtn.Enabled = True

custid.Text = ""
custname.Text = ""
custno.Text = ""
custeid.Text = ""
custadd.Text = ""
custid.Text = ""

End If
custid.ReadOnly = False
custid.Text = ""
End Sub
'fuction defination
' add function defination

Sub add()
Try
If custname.Text = "" Then
MsgBox("Please Fill The NAME Field.....!!!")
custname.Text = ""
custname.Focus()
Return
End If

If custno.Text = "" Then


MsgBox("Please Fill No Field.....!!!")
custno.Text = ""
custno.Focus()
Return
End If

If custeid.Text = "" Then


MsgBox("Please Fill Customer ID Field.....!!!")
custeid.Text = ""
custeid.Focus()
Return
End If

If custeid.Text.IndexOf("@") <= 0 Or
custeid.Text.IndexOf(".") <= custeid.Text.IndexOf("@") Or
custeid.Text.IndexOf(".") <= 0 Then
MsgBox("Please Enter Proper valid Email-
ID.....!!!")
custeid.Text = ""
custeid.Focus()
Return
End If

If custadd.Text = "" Then


MsgBox("Please Fill Address Field.....!!!")
custadd.Text = ""
custadd.Focus()
Return
End If
If IsNumeric(custno.Text) Then

cmd.CommandText = "insert into customer values


( '" & custid.Text & "' , '" & custname.Text & "' , " &
custno.Text & " , '" & custeid.Text & "' , '" & custadd.Text &
"')"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
cn.Open()
Dim i As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Added.....!!!" & i)
Else

MsgBox("Contact Number Should Be Number


Only.....!!!")
custno.Text = ""
custno.Focus()
Return
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

da = New OleDb.OleDbDataAdapter("select * from customer",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'reset function defination

Sub reset()
custid.Text = ""
custname.Text = ""
custno.Text = ""
custeid.Text = ""
custadd.Text = ""
newradio3.Checked = False
custid.Text = ""
oldradio4.Checked = False
addbtn.Enabled = False

End Sub

'search function defination

Sub search()

cn.Open()
Dim str As String
If custid.Text = "" Then
MsgBox("Please Enter Customer Id ")
Else

str = "select * from customer where cust_id='" &


custid.Text & "'"

cmd.CommandText = str
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
custid.Text = ""
custname.Text = ""
custno.Text = ""
custeid.Text = ""
custadd.Text = ""
Dim i As Integer
i = 0
While oledbdr.Read
custid.Text = oledbdr("cust_id")
custname.Text = oledbdr("cust_name")
custno.Text = oledbdr("contact_no")
custeid.Text = oledbdr("email_id")
custadd.Text = oledbdr("cust_addr")
i = i + 1

End While
If i = 0 Then
MsgBox("No Record found ")
End If
End If

cn.Close()
End Sub

'new function defination

Sub new1()
custid.Enabled = True
custname.Enabled = True
custno.Enabled = True
custeid.Enabled = True
custadd.Enabled = True
searchbtn.Enabled = False
addbtn.Enabled = True
dltbtn.Enabled = False
rstbtn.Enabled = True
updtbtn.Enabled = False
savebtn.Enabled = False
selectbtn.Enabled = False

custid.Text = ""
custname.Text = ""
custno.Text = ""
custeid.Text = ""
custadd.Text = ""

custid.Text = ""

custid.ReadOnly = True

Dim cust As Double = System.DateTimeOffset.Now.Year &


System.DateTimeOffset.Now.DayOfYear &
System.DateTimeOffset.Now.Hour & System.DateTimeOffset.Now.Minute
& System.DateTimeOffset.Now.Second
custid.Text = cust

End Sub

' delete fuction defination

Sub delete()
Try
Dim i As Integer
cn.Open()
Dim str As String
If custid.Text = "" Then
MsgBox("Please Enter Customer Id...!!! ")
Else

str = "select * from customer where cust_id='" &


custid.Text & "'"

cmd.CommandText = str
cmd.Connection = cn
oledbdr = cmd.ExecuteReader

custname.Text = ""
custno.Text = ""
custeid.Text = ""
custadd.Text = ""

i = 0
While oledbdr.Read

i = i + 1

End While

End If
cn.Close()

If i = 0 Then
MsgBox("No Record found....!!!! ")
Else
cn.Open()

cmd.CommandText = " delete from customer where


cust_id='" & custid.Text & " '"
cmd.CommandType = CommandType.Text
cmd.Connection = cn

Dim ii As Integer = cmd.ExecuteNonQuery

cn.Close()
MsgBox("Successfully Record Deleted.....!!!! ")
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

custid.Text = ""
da = New OleDb.OleDbDataAdapter("select * from customer",
cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'update function defination

Sub update1()
custid.Enabled = True
custname.Enabled = True
custno.Enabled = True
custeid.Enabled = True
custadd.Enabled = True

End Sub

'refresh function defination

Sub refresh1()

da = New OleDb.OleDbDataAdapter("select * from customer",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'select function defination

Sub select1()
Try
custid.Text =
DataGridView1.SelectedCells(0).Value.ToString()
custname.Text =
DataGridView1.SelectedCells(1).Value.ToString()
custno.Text =
DataGridView1.SelectedCells(2).Value.ToString()
custeid.Text =
DataGridView1.SelectedCells(3).Value.ToString()
custadd.Text =
DataGridView1.SelectedCells(4).Value.ToString()

Catch ex As Exception

MsgBox("Please select the complete row or press the


SEARCH button")
custname.Text = ""
custadd.Text = ""
custno.Text = ""
custeid.Text = ""

End Try

custid.Enabled = False
custname.Enabled = False
custno.Enabled = False
custeid.Enabled = False
custadd.Enabled = False

End Sub

'save funcction defination

Sub save()
Try
If custid.Text = "" Then
MsgBox("Please Fill The Customer ID Field...!!!!
")
custid.Text = ""
custid.Focus()
Else
cn.Open()
Dim str As String
str = "update customer set cust_name = '" &
custname.Text & "', contact_no = " & custno.Text & " ,email_id =
'" & custeid.Text & "', cust_addr = '" & custadd.Text & "' where
cust_id = '" & custid.Text & "' "
cmd.CommandText = str
MsgBox(str)
cmd.CommandType = CommandType.Text
cmd.Connection = cn
'Dim oledbdr As Integer = OleDb.OleDbDataReader
Dim ii As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Updated" & ii)
End If

Catch ex As Exception
MessageBox.Show(ex.Message)

End Try

da = New OleDb.OleDbDataAdapter("select * from customer",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'Exit function defination

Sub exit1()
Me.Hide()
shopmain.Show()
'shopmain.Show()
End Sub

'Menu item declaration

Private Sub NewToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
NewToolStripMenuItem.Click
new1()
newradio3.Checked = True
End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SaveToolStripMenuItem.Click
save()
End Sub
Private Sub ResetToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ResetToolStripMenuItem.Click
reset()
oldradio4.Checked = True
End Sub

Private Sub UpdateToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
UpdateToolStripMenuItem.Click
update1()
End Sub

Private Sub AddToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
AddToolStripMenuItem.Click
add()
End Sub

Private Sub DeleteToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
DeleteToolStripMenuItem.Click
delete()
End Sub

Private Sub SearchToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SearchToolStripMenuItem.Click
search()
End Sub

Private Sub ShowToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ShowToolStripMenuItem.Click
Refresh()
End Sub

Private Sub SelectToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SelectToolStripMenuItem.Click
select1()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
exit1()
End Sub

Private Sub backbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs)
shopmain.Show()
End Sub
End Class

6. Customer Report Form

Public Class Form1

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


As System.EventArgs) Handles MyBase.Load
Dim rpcl As New CrystalReport1
Me.CrystalReportViewer1.ReportSource = rpcl

End Sub

Private Sub CrystalReportViewer1_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub CrystalReportViewer1_Load_1(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CrystalReportViewer1.Load

End Sub
End Class
7. Final Crystal Form

Public Class finalcrystal

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


As System.EventArgs) Handles MyBase.Load
Dim rpcl As New CrystalReport2
Me.CrystalReportViewer1.ReportSource = rpcl
End Sub

End Class

8. Product Form

Public Class product


Dim cn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim oledbdr As OleDb.OleDbDataReader
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet()

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


e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the
'ShopdatabaseDataSet4.product' table. You can move, or remove it,
as needed.

Me.ProductTableAdapter1.Fill(Me.ShopdatabaseDataSet4.product)
'TODO: This line of code loads data into the
'ShopdatabaseDataSet3.product' table. You can move, or remove it,
as needed.
'
Me.ProductTableAdapter.Fill(Me.ShopdatabaseDataSet3.product)
cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")

oldradio.Checked = True
AddToolStripMenuItem.Enabled = False

Try
cn.Open()
Dim str As String
str = "select comp_name from company "
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read
prodcompcombo.Items.Add(oledbdr("comp_name"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub

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


e As System.EventArgs) Handles addbtn.Click
add()
End Sub

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


e As System.EventArgs) Handles dltbtn.Click
'Dim flag As Integer
'flag = 1
'Dialog1.Show()

delete()
End Sub

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


e As System.EventArgs) Handles rstbtn.Click
reset()
End Sub

Private Sub searchbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles searchbtn.Click
search()
End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
shopmain.Show()
Me.Hide()
End Sub

Private Sub selectbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles selectbtn.Click
select1()
End Sub

Private Sub showbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles showbtn.Click
show1()
End Sub

Private Sub updtbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles updtbtn.Click
update1()
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles savebtn.Click
save()
End Sub
Private Sub backbtn_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs)
Me.Hide()
shopmain.Enabled = True
shopmain.Show()
End Sub

Private Sub NewToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
NewToolStripMenuItem.Click
newq()
End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SaveToolStripMenuItem.Click
save()
End Sub

Private Sub SelectToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SelectToolStripMenuItem.Click
select1()
End Sub

Private Sub ExitToolStripMenuItem_Click_1(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ExitToolStripMenuItem.Click
shopmain.Show()
Me.Hide()
End Sub

Private Sub ResetToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ResetToolStripMenuItem.Click
reset()
End Sub

Private Sub ShowToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
ShowToolStripMenuItem.Click
show1()
End Sub
Private Sub UpdateToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UpdateToolStripMenuItem.Click
update1()
End Sub

Private Sub DeleteToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
DeleteToolStripMenuItem.Click
delete()
End Sub

Private Sub AddToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
AddToolStripMenuItem.Click
add()
End Sub

Private Sub SearchToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
SearchToolStripMenuItem.Click
search()
End Sub

Private Sub newradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
newradio.CheckedChanged
If newradio.Checked = True Then
newq()
End If
End Sub

Private Sub oldradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
oldradio.CheckedChanged
If oldradio.Enabled = True Then
prodid.Enabled = True
prodname.Enabled = False
serialtxt.Enabled = False
prodcompcombo.Enabled = False
prodqty.Enabled = False
proddt.Enabled = False
addbtn.Enabled = False
rstbtn.Enabled = True
dltbtn.Enabled = True
updtbtn.Enabled = True
savebtn.Enabled = True
searchbtn.Enabled = True
prodprize.Enabled = False
selectbtn.Enabled = True

prodid.Text = ""
prodname.Text = ""
serialtxt.Text = ""
prodcompcombo.Text = ""
prodqty.Text = ""
proddt.Text = ""
prodprize.Text = ""

DeleteToolStripMenuItem.Enabled = True
SearchToolStripMenuItem.Enabled = True
UpdateToolStripMenuItem.Enabled = True
ShowToolStripMenuItem.Enabled = True

SaveToolStripMenuItem.Enabled = True
SelectToolStripMenuItem.Enabled = True

End If
End Sub

' Function Declaration

'SHOW
Sub show1()
da = New OleDb.OleDbDataAdapter("select * from product",
cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'NEW
Sub newq()
prodid.Enabled = True
prodname.Enabled = True
serialtxt.Enabled = True
prodcompcombo.Enabled = True
prodqty.Enabled = True
proddt.Enabled = True
addbtn.Enabled = True
rstbtn.Enabled = True
dltbtn.Enabled = False
updtbtn.Enabled = False
searchbtn.Enabled = False
prodprize.Enabled = True
selectbtn.Enabled = False
savebtn.Enabled = False
newradio.Checked = True
AddToolStripMenuItem.Enabled = True

DeleteToolStripMenuItem.Enabled = False
SearchToolStripMenuItem.Enabled = False
UpdateToolStripMenuItem.Enabled = False
SaveToolStripMenuItem.Enabled = False
SelectToolStripMenuItem.Enabled = False
ShowToolStripMenuItem.Enabled = False

End Sub

'SAVE
Sub save()
Try
If prodid.Text = "" Then
MsgBox("Please Fill The Customer ID Field...!!!!
")
prodid.Text = ""
prodid.Focus()
Else
If IsNumeric(prodqty.Text & prodprize.Text) Then
cn.Open()
Dim str As String
str = "update product set prod_name = '" &
prodname.Text & "', serial_no= '" & serialtxt.Text & "
',prod_comp = '" & prodcompcombo.Text & "', prod_qty = " &
prodqty.Text & " ,prod_prize=" & prodprize.Text & " where prod_id
= '" & prodid.Text & "' "
cmd.CommandText = str
' MsgBox(str)
cmd.CommandType = CommandType.Text
cmd.Connection = cn
'Dim oledbdr As Integer =
OleDb.OleDbDataReader
Dim ii As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Updated" & ii)
Else
MsgBox("Please Quantity and Prize Field
Should be numbers Only.....!!!!")
prodqty.Text = ""
prodqty.Focus()
prodprize.Text = ""
prodprize.Focus()
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

da = New OleDb.OleDbDataAdapter("select * from product",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()
End Sub

'RESET
Sub reset()
prodid.Text = ""
prodname.Text = ""
serialtxt.Text = ""
prodcompcombo.Text = ""
prodqty.Text = ""
proddt.Text = ""
prodprize.Text = ""
End Sub

'UPDATE
Sub update1()
prodid.Enabled = False
prodname.Enabled = True
serialtxt.Enabled = True
prodcompcombo.Enabled = True
prodqty.Enabled = True
proddt.Enabled = True
prodprize.Enabled = True
End Sub

'ADD
Sub add()
Try
If prodid.Text = "" Then
MsgBox("Please Fill The Product ID
Field.....!!!")
prodid.Text = ""
prodid.Focus()
Return
End If

If prodname.Text = "" Then


MsgBox("Please Fill Name Field.....!!!")
prodname.Text = ""
prodname.Focus()
Return
End If

If serialtxt.Text = "" Then


MsgBox("Please Fill Serial Number Field.....!!!")
serialtxt.Text = ""
serialtxt.Focus()
Return
End If

If prodcompcombo.Text = "" Then


MsgBox("Please Fill Company Name Field.....!!!")
prodcompcombo.Text = ""
prodcompcombo.Focus()
Return
End If

If prodqty.Text = "" Then


MsgBox("Please Fill Product Quantity
Field.....!!!")
prodqty.Text = ""
prodqty.Focus()
Return
End If

If proddt.Text = "" Then


MsgBox("Please Select Manufacturing Date
Field.....!!!")
proddt.Text = ""
proddt.Focus()
Return
End If

If prodprize.Text = "" Then


MsgBox("Please Product Prize Field.....!!!")
prodprize.Text = ""
prodprize.Focus()
Return
End If

If IsNumeric(prodqty.Text & prodprize.Text) Then

cmd.CommandText = "insert into product values


( '" & prodid.Text & "' , '" & prodname.Text & "' ,'" &
serialtxt.Text & "','" & prodcompcombo.Text & "' , " &
prodqty.Text & " , '" & proddt.Text & "'," & prodprize.Text & ")"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
cn.Open()
Dim i As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Added.....!!!" & i)
Else

MsgBox("Product Quantity And Prize Should Be


Number Only.....!!!")
prodprize.Text = ""
prodprize.Focus()
prodqty.Text = ""
prodqty.Focus()
Return
End If

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

da = New OleDb.OleDbDataAdapter("select * from product",


cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()
End Sub

'DELETE
Sub delete()
Try
Dim i As Integer
cn.Open()
Dim str As String
If prodid.Text = "" Then
MsgBox("Please Enter Product Id ")
Else

str = "select * from product where prod_id='" &


prodid.Text & "'"
cmd.CommandText = str
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
prodname.Text = ""
serialtxt.Text = ""
prodcompcombo.Text = ""
prodqty.Text = ""
proddt.Text = ""
prodprize.Text = ""

i = 0
While oledbdr.Read

i = i + 1

End While

End If
cn.Close()

If i = 0 Then
MsgBox("No Record found ")
Else
cn.Open()
cmd.CommandText = " delete from product where
prod_id='" & prodid.Text & " '"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
Dim ii As Integer = cmd.ExecuteNonQuery
cn.Close()
MsgBox("Successfully Record Deleted:- " & ii)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

prodid.Text = ""
da = New OleDb.OleDbDataAdapter("select * from product",
cn)
ds = New DataSet()
da.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
DataGridView1.Refresh()

End Sub

'SEARCH
Sub search()
cn.Open()
Dim str As String
If prodid.Text = "" Then
MsgBox("Please Enter Customer Id ")
Else

str = "select * from product where prod_id='" &


prodid.Text & "' "
cmd.CommandText = str
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
prodid.Text = ""
prodname.Text = ""
serialtxt.Text = ""
prodcompcombo.Text = ""
prodqty.Text = ""
proddt.Text = ""
prodprize.Text = ""

Dim i As String
i = 0
While oledbdr.Read
prodid.Text = oledbdr("prod_id")
prodname.Text = oledbdr("prod_name")
serialtxt.Text = oledbdr("serial_no")
prodcompcombo.Text = oledbdr("prod_comp")
prodqty.Text = oledbdr("prod_qty")
proddt.Text = oledbdr("prod_dt")
prodprize.Text = oledbdr("prod_prize")

i = i + 1

End While
If i = 0 Then
MsgBox("No Record found ")
Else

End If
End If
cn.Close()

End Sub

'SELECT
Sub select1()
Try
prodid.Text =
DataGridView1.SelectedCells(0).Value.ToString()
prodname.Text =
DataGridView1.SelectedCells(1).Value.ToString()
serialtxt.Text =
DataGridView1.SelectedCells(2).Value.ToString()
prodcompcombo.Text =
DataGridView1.SelectedCells(3).Value.ToString()
prodqty.Text =
DataGridView1.SelectedCells(4).Value.ToString()
proddt.Text =
DataGridView1.SelectedCells(5).Value.ToString()
prodprize.Text =
DataGridView1.SelectedCells(6).Value.ToString()
Catch ex As Exception
MsgBox("Please select the complete row or press the
SEARCH button")
prodname.Text = ""
prodcompcombo.Text = ""
serialtxt.Text = ""
prodqty.Text = ""
proddt.Text = ""
prodprize.Text = ""

End Try
prodid.Enabled = False
prodname.Enabled = False
serialtxt.Enabled = False
prodcompcombo.Enabled = False
prodqty.Enabled = False
proddt.Enabled = False
prodprize.Enabled = False
End Sub
End Class

9. Purchase Form

Public Class purchase


Dim cmd As New OleDb.OleDbCommand
Dim cn As New OleDb.OleDbConnection
Dim oledbdr As OleDb.OleDbDataReader
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet
Dim sum As Double

Private Sub newradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
newradio.CheckedChanged
transtxt.Items.Clear()
transtxt.Enabled = False
Dim tran As Double = System.DateTimeOffset.Now.Year &
System.DateTimeOffset.Now.Month &
System.DateTimeOffset.Now.DayOfYear &
System.DateTimeOffset.Now.Hour & System.DateTimeOffset.Now.Minute
& System.DateTimeOffset.Now.Second
transtxt.Text = tran

itemserialcombo.Enabled = True
itemidtxt.Enabled = True
avqty.Enabled = True
rmqty.Enabled = True
itemnamecombo.Enabled = True
itemratetxt.Enabled = True
itemdisccombo.Enabled = True
totalprizetxt.Enabled = True
itemcompcombo.Enabled = True
itemqtytxt.Enabled = True
itemserialcombo.Enabled = True
showbtn.Enabled = False
addbtn.Enabled = True
morebtn.Enabled = True
gobillbtn.Enabled = True

End Sub

Private Sub prevradio_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
prevradio.CheckedChanged
transtxt.Enabled = True
transtxt.Enabled = True
transtxt.Text = ""
showbtn.Enabled = True
addbtn.Enabled = False
morebtn.Enabled = False
gobillbtn.Enabled = True

Try
cn.Open()

Dim str As String

str = "select distinct trans_id from bill where


cust_id='" & custidtxt.Text & "' AND cust_name='" &
custnametxt.Text & "' "
' MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
transtxt.Items.Clear()
While oledbdr.Read()
transtxt.Items.Add(oledbdr("trans_id"))
End While

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub

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


e As System.EventArgs) Handles addbtn.Click

If itemnamecombo.Text = "" Then


MsgBox("Please Select Item NAME Field.....!!!!")
itemnamecombo.Text = ""
itemnamecombo.Focus()
Return
End If

If itemcompcombo.Text = "" Then


MsgBox("Please Select The Company Field....!!!! ")
itemcompcombo.Text = ""
itemcompcombo.Focus()
Return
End If

If itemserialcombo.Text = "" Then


MsgBox("Please Select The Serial No. Field....!!!! ")
itemserialcombo.Text = ""
itemserialcombo.Focus()
Return
End If

If itemqtytxt.Text = "" Then


MsgBox("Please Select Quantity Field....!!!! ")
itemqtytxt.Text = ""
itemqtytxt.Focus()
Return
End If

Try

If IsNumeric(itemqtytxt.Text) Then
cn.Open()
Dim str As String
str = "insert into bill values('" &
custidtxt.Text & "','" & custnametxt.Text & "' , '" &
transtxt.Text & "' , '" & CDate(dt1txt.Text) & "','" &
itemnamecombo.Text & "','" & itemcompcombo.Text & "','" &
itemserialcombo.Text & "','" & itemidtxt.Text & "' , " &
itemqtytxt.Text & " , " & itemratetxt.Text & ", " & rmqty.Text &
" ,'" & itemdisccombo.Text & "'," & totalprizetxt.Text & ")"
' MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn

Dim i As Integer = cmd.ExecuteNonQuery


cn.Close()
MsgBox("Successfully Added.....!!!" & i)
Else
MsgBox("Contact Number Should Be Number
Only.....!!!")
itemqtytxt.Text = ""
itemqtytxt.Focus()
Return
End If
' cn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

sum = sum + Val(totalprizetxt.Text)


grtotal.Text = sum

Try
cn.Open()
Dim str As String
str = "insert into finalbill values('" &
itemnamecombo.Text & "','" & itemcompcombo.Text & "','" &
itemidtxt.Text & "','" & itemserialcombo.Text & "','" &
itemratetxt.Text & "' , " & itemqtytxt.Text & " , '" &
totalprizetxt.Text & "','" & transtxt.Text & "')"
'MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
Dim i As Integer = cmd.ExecuteNonQuery
cn.Close()
'MsgBox("Succefully Genetared Bill")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
' End Sub

Try
' If custid.Text = "" Then
'MsgBox("Please Fill The Customer ID Field...!!!! ")
'custid.Text = ""
'custid.Focus()
'Else
cn.Open()
Dim str As String
str = "update product set prod_qty=" & rmqty.Text & "
where prod_id = '" & itemidtxt.Text & "' "
cmd.CommandText = str
'MsgBox(str)
cmd.CommandType = CommandType.Text
cmd.Connection = cn
'Dim oledbdr As Integer = OleDb.OleDbDataReader
Dim ii As Integer = cmd.ExecuteNonQuery
cn.Close()
'MsgBox("Successfully Updated" & ii)
' End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

itemcompcombo.Text = ""
itemserialcombo.Text = ""
itemidtxt.Text = ""
itemqtytxt.Text = ""
avqty.Text = ""
rmqty.Text = ""
itemnamecombo.Text = ""
itemratetxt.Text = ""
itemdisccombo.Text = ""
totalprizetxt.Text = ""
itemcompcombo.Text = ""

itemserialcombo.Enabled = True
itemidtxt.Enabled = False
itemcompcombo.Enabled = False
itemqtytxt.Enabled = False
itemserialcombo.Enabled = False
avqty.Enabled = False
rmqty.Enabled = False
itemnamecombo.Enabled = False
itemratetxt.Enabled = False
itemdisccombo.Enabled = False
totalprizetxt.Enabled = False

End Sub

Private Sub Orderselection_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

dt1txt.Text = System.DateTimeOffset.Now.Date
cn = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shop
project\shopdatabase.mdb")

transtxt.Enabled = False

Try
cn.Open()
Dim str As String
str = "select * from customer"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
custidtxt.Text = ""
custnametxt.Text = ""
While oledbdr.Read
custidtxt.Items.Add(oledbdr("cust_id"))
custnametxt.Items.Add(oledbdr("cust_name"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()

Try
cn.Open()
Dim str As String
str = "select distinct prod_name from product"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read
itemnamecombo.Items.Add(oledbdr("prod_name"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub
Private Sub itemnamecombo_SelectedIndexChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
itemnamecombo.SelectedIndexChanged

itemcompcombo.Items.Clear()
itemcompcombo.Text = ""

itemserialcombo.Items.Clear()
itemserialcombo.Text = ""

itemidtxt.Text = ""
avqty.Text = ""
rmqty.Text = ""

Try
cn.Open()
Dim str As String
str = "select distinct prod_comp from product where
prod_name='" & itemnamecombo.Text & "'"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read
itemcompcombo.Items.Add(oledbdr("prod_comp"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
oledbdr.Close()
cn.Close()
End Sub

Private Sub exitbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles exitbtn.Click
shopmain.Show()
Me.Hide()
'shopmain.Enabled = True

End Sub

Private Sub itemcompcombo_SelectedIndexChanged(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
itemcompcombo.SelectedIndexChanged
itemserialcombo.Text = ""
itemserialcombo.Items.Clear()
Try
cn.Open()
Dim str As String
str = "select distinct serial_no from product where
prod_comp='" & itemcompcombo.Text & "' and prod_name='" &
itemnamecombo.Text & "'"
'MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read
itemserialcombo.Items.Add(oledbdr("serial_no"))
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
oledbdr.Close()
cn.Close()
End Sub

Private Sub itemserialcombo_SelectedIndexChanged(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
itemserialcombo.SelectedIndexChanged
itemidtxt.Text = ""
itemratetxt.Text = ""
avqty.Text = ""
rmqty.Text = ""
Try
cn.Open()
Dim str As String
str = "select * from product where serial_no='" &
itemserialcombo.Text & "'"
' MsgBox(str)
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read
itemidtxt.Text = oledbdr("prod_id")
itemratetxt.Text = oledbdr("prod_prize")
avqty.Text = oledbdr("prod_qty")
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub

Private Sub itemqtytxt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
itemqtytxt.TextChanged
Dim min As Double
min = Val(avqty.Text) - Val(itemqtytxt.Text)
rmqty.Text = min
If Val(rmqty.Text) < 0 Then
MsgBox("Stock is Less Than U Required Plz Report To
'Admin' ")
itemqtytxt.Text = ""
itemqtytxt.Focus()
End If
Dim a As Integer = Val(itemqtytxt.Text) *
Val(itemratetxt.Text)
totalprizetxt.Text = a - (a * Val(itemdisccombo.Text) /
100)
End Sub

Private Sub itemdisccombo_SelectedIndexChanged(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
itemdisccombo.SelectedIndexChanged
'fina()
Dim a As Integer = Val(itemqtytxt.Text) *
Val(itemratetxt.Text)
totalprizetxt.Text = a - (a * Val(itemdisccombo.Text) /
100)
End Sub

Private Sub custnametxt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub custidtxt_TextChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs)
End Sub

Private Sub morebtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles morebtn.Click

itemcompcombo.Text = ""
itemserialcombo.Text = ""
itemidtxt.Text = ""
avqty.Text = ""
rmqty.Text = ""
itemnamecombo.Text = ""
itemratetxt.Text = ""
itemdisccombo.Text = ""
totalprizetxt.Text = ""
itemcompcombo.Text = ""

itemserialcombo.Enabled = True
itemidtxt.Enabled = True
itemcompcombo.Enabled = True
itemqtytxt.Enabled = True
itemserialcombo.Enabled = True
avqty.Enabled = True
rmqty.Enabled = True
itemnamecombo.Enabled = True
itemratetxt.Enabled = True
itemdisccombo.Enabled = True
totalprizetxt.Enabled = True

End Sub

Private Sub gobillbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles gobillbtn.Click
da = New OleDb.OleDbDataAdapter("SELECT * FROM finalbill
where trancid='" & transtxt.Text & "' ", cn)
ds = New DataSet()
da.Fill(ds)
bill.DataGridView1.DataSource = ds.Tables(0)
bill.DataGridView1.Refresh()
bill.Show()

newradio.Checked = False
prevradio.Checked = False
custidtxt.Text = ""
custnametxt.Text = ""
custnametxt.Enabled = True
transtxt.Text = ""
custidtxt.Enabled = True
itemserialcombo.Enabled = False
itemidtxt.Enabled = False
avqty.Enabled = False
rmqty.Enabled = False
itemnamecombo.Enabled = False
itemratetxt.Enabled = False
itemdisccombo.Enabled = False
totalprizetxt.Enabled = False
itemcompcombo.Enabled = False
itemqtytxt.Enabled = False

showbtn.Enabled = False

addbtn.Enabled = False
morebtn.Enabled = False
gobillbtn.Enabled = False

newradio.Enabled = False
prevradio.Enabled = False

grtotal.Text = ""
'bill.grtotaltxt.Text = grtotal.Text

End Sub

Private Sub showbtn_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles showbtn.Click

da = New OleDb.OleDbDataAdapter("SELECT * FROM finalbill


where trancid='" & transtxt.Text & "' ", cn)
ds = New DataSet()
da.Fill(ds)
bill.DataGridView1.DataSource = ds.Tables(0)
bill.DataGridView1.Refresh()
bill.Show()

'bill.dttxt.Text

Try
cn.Open()
Dim str As String
str = "select date from bill where trans_id='" &
transtxt.Text & "' "
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
While oledbdr.Read()
bill.dttxt.Text = oledbdr("date")

End While
Catch ex As Exception
MessageBox.Show(ex.Message)

End Try
cn.Close()
'bill.grtotaltxt.Text = grtotal.Text

End Sub

Private Sub custidtxt_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
custidtxt.SelectedIndexChanged

Try
cn.Open()
Dim str As String
str = "select cust_name from customer where
cust_id='" & custidtxt.Text & "'"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
custnametxt.Text = ""
While oledbdr.Read
custnametxt.SelectedText = oledbdr("cust_name")
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()

If custidtxt.Text = "" Then


MsgBox("please Enter the Customer ID")
custidtxt.Text = ""
custidtxt.Focus()
newradio.Enabled = False
prevradio.Enabled = False
Else
newradio.Checked = True
newradio.Enabled = True
prevradio.Enabled = True
custnametxt.Enabled = False
End If

sum = 0

End Sub

Private Sub custnametxt_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
custnametxt.SelectedIndexChanged
Try
cn.Open()
Dim str As String
str = "select cust_id from customer where
cust_name='" & custnametxt.Text & "'"
cmd.CommandText = str
cmd.CommandType = CommandType.Text
cmd.Connection = cn
oledbdr = cmd.ExecuteReader
custidtxt.Text = ""
While oledbdr.Read
custidtxt.SelectedText = oledbdr("cust_id")
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()

If custnametxt.Text = "" Then


MsgBox("please Enter the Customer Name")
custidtxt.Text = ""
custidtxt.Focus()
newradio.Enabled = False
prevradio.Enabled = False
Else
newradio.Checked = True
newradio.Enabled = True
prevradio.Enabled = True
custidtxt.Enabled = False
End If

'sum = 0

End Sub

Private Sub Button1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Button1.Click
newradio.Checked = False
prevradio.Checked = False
custidtxt.Text = ""
custnametxt.Text = ""
custnametxt.Enabled = True
transtxt.Text = ""
custidtxt.Enabled = True

itemserialcombo.Enabled = False
itemidtxt.Enabled = False
avqty.Enabled = False
rmqty.Enabled = False
itemnamecombo.Enabled = False
itemratetxt.Enabled = False
itemdisccombo.Enabled = False
totalprizetxt.Enabled = False
itemcompcombo.Enabled = False
itemqtytxt.Enabled = False
showbtn.Enabled = False
addbtn.Enabled = False
morebtn.Enabled = False
gobillbtn.Enabled = False
newradio.Enabled = False
prevradio.Enabled = False
End Sub
End Class
Reports

1. Customer Report
2. Transaction Report
3 Bill Report

You might also like