Shop Management
Shop Management
Shop Management
PROJECT REPORT
ON
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)
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.
4 Database Design
6 Future Enhancement
Introduction
Hardware Requirements
1. Pentium 4 processor
2. Windows XP/2000
3. 512 MB RAM
Software requirements
Backend
1. Ms-Access
Scope of System.
The main aim of this system is to simplify the Shop data management.
All work is done by single person, so one trained person can do the
entire job.
Feasibility Study
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
Type
USE CASE DIGRAM
User Login
Product Information
Purchase Product
Bill
Entity Relationship Diagram
Customer
1
Product
Bill
M
1
M 1
Company
Final Bill
Context Level
Diagram
Shop
Management
Admin
System
P rodu ct dispatched
Retreive details
Management
product details
Product
Request for product
Company profile
Admin Order dispatched 2.0 company
Purchase Store transaction
request product
Search for product details
Product
3.0 show list
Customer get result
Search
product show details
company
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
Admin Login
Wrong user
No
A
Yes
Create
company,product,
customer details
No cancel order
Yes
B
B
customer search
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
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
2:(Product,Fp)
:Stock
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
Books:
Programming in Visual Basic .NET
Web Sites :
www.wikipedia.com
www.projectrefference.com
www.google.com
Source Code
1. Login Form
End Sub
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
End Class
2. MDI Form
product.Show()
product.oldradio.Checked = True
Me.Visible = False
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
3. Company Form
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
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
Sub add1()
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
Else
MsgBox("company no and fax no should contain number
only...!!!")
compno.Text = ""
compno.Focus()
compfaxno.Text = ""
compfaxno.Focus()
Return
End If
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
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()
cn.Close()
MsgBox("Successfully Record Deleted...!!!")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
compid.Text = ""
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
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
End Sub
End Sub
End Class
4. Bill Form
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
End Sub
Me.FinalbillTableAdapter.FillBy(Me.ShopdatabaseDataSet8.finalbill
, TrancidToolStripTextBox.Text)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
End Sub
End Sub
purchase.custidtxt.Text = ""
purchase.custnametxt.Text = ""
purchase.transtxt.Text = ""
purchase.newradio.Checked = False
purchase.prevradio.Checked = False
End Sub
End Sub
End Class
5. Customer Form
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
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 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
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
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
Sub search()
cn.Open()
Dim str As String
If custid.Text = "" Then
MsgBox("Please Enter Customer Id ")
Else
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
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
End Sub
Sub delete()
Try
Dim i As Integer
cn.Open()
Dim str As String
If custid.Text = "" Then
MsgBox("Please Enter Customer Id...!!! ")
Else
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()
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
Sub update1()
custid.Enabled = True
custname.Enabled = True
custno.Enabled = True
custeid.Enabled = True
custadd.Enabled = True
End Sub
Sub refresh1()
End Sub
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
End Try
custid.Enabled = False
custname.Enabled = False
custno.Enabled = False
custeid.Enabled = False
custadd.Enabled = False
End Sub
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
End Sub
Sub exit1()
Me.Hide()
shopmain.Show()
'shopmain.Show()
End Sub
End Sub
End Sub
End Sub
End Class
7. Final Crystal Form
End Class
8. Product Form
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
delete()
End Sub
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
'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
'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
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
'DELETE
Sub delete()
Try
Dim i As Integer
cn.Open()
Dim str As String
If prodid.Text = "" Then
MsgBox("Please Enter Product Id ")
Else
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
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
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
Try
cn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
End Sub
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
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
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
End Sub
End Sub
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
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
'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
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()
sum = 0
End Sub
'sum = 0
End Sub
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