You are on page 1of 57

CERTIFICATE

Roll No. : __________ Exam Seat No. : _____________

This is to certify that Shri./Kum.______________________________________

of _______________ class has satisfactorily completed _______________ project

on _________________________________________________ for the partial

Fulfillment of the degree ________________________________ as Prescribed by

University of Mumbai for the academic year 20___ - 20___.

Project Guide External Examiner


Date: / / Date: / /

College Seal Head of the Department


Date: / /

2
2
INDEX

Sr.No. Table Of Contents Page No.


1 Acknowlegement 4
2 Introduction to Project 5
3 Description of the Current System 6
4 Limitations of the Current System 7
5 Proposed System 8
6 Advantages of Proposed Syatem 9
7 Feasibility Study 10
8 Requirements 12
9 Advantages of SQL 2005 13
10 Advantages of VB.NET 14
11 Gnatt Chart 15
12 Event Table 16
13 Class Diagram 17
14 Use Case Diagram 18
15 Sequence Diagram 19
16 State Chart Diagram 20
17 CRUD Table 21
18 Database Relationships 22
19 Database Description 23
20 Menu Tree 29
21 Screen Shots 30
22 Sample Code 39
23 Reports 47
24 Report Code 50
25 Implementation 52
26 Future Scope 53
27 Conclusion 54
28 Bibliography 55
*

2
ACKNOWLEDGEMENT

It is always confusing as to how to acknowledge people who have


always been a constant support to me. But still I have made an attempt
towards it.

I am very thankful to my project guide and our Head of Department of


Computer Science Mr. Rajesh Gaikwad .He has always been a constant
support to all of us. He has always been guiding us with her valuable
ideas and directions. Without his support it wouldn’t have been possible
to complete the Project in the stipulated time.He has always been there
for me at any time.

I am also very thankful to the Ms. Jagruti Churi and other teachers of
our Department for their unprecedented support.

Last but not the least; I would like to thank all my friends who have
given me their support. Also, I would like o thank my parents for
believing my abilities

2
INTRODUCTION TO THE PROJECT

Sales And Purchase System is software designed for the


automation of the work of Arein Computers. It is the outcome
of the constant interation of the member of the firm and myself.

Following are few characteistics of the Sales and Purchase


System:

1. Referential Integrity of relational Database is followed.


2. Use of shortcuts to access different process is provide for
the user having Computer Knowledge.
3. User-friendly prompts are provide for user.
4. Attractive and catchy Graphical Interfaces are used for
User Interaction.
5. Data Reports allows generation of repots dynamically with
desired query.
6. Strong and Concrete Security System Controls are used.
7. Easy Navigation is provided for maintaing proper flow of
sysytem.

2
DESCRIPTION OF THE CURRENT SYSTEM

 At Present, the staff carries out all the work manually. All the data
and records are stored manually in the files.

 At the end of the day all the sales and purchase records entries are
made manually.

 Big and large registers are maintained for every transaction. All the
details have to be maintained minutely and have to be taken care of
manual errors.

 Customer and supplier validations are done manually.

 Generation of bills, reports, invoice have to be done manually. In


short we can say that a lot of paper work is to be maintained for
every transaction.

2
LIMITATION OF CURRENT SYSTEM

 Sales and Purchase Details: Maintaining all the details like sales
and purchase is a very tedious job.

 Excess paper work : For maintaining of records lot of paper gets


wasted

 Searching is very difficult: searching for details about


particular Customer, Supplier, Product etc is tedious.

 Time Consuming: Due to manual entry it takes lot of time


to record the data.

 Misplacement of records: Since records are stored in


registers so there is high risk of misplacement of records.

 Manual Errors: While maintaining records error is bound


to arise.

 Improper product Info: As all the products information is


maintained via templates, so when customer enquiries for a
product so it becomes a tedious job to convey a customer.
So because of these errors there is a chance of financial loss
to the Company.

2
PROPOSED SYSTEM

 The proposed system will be computerized system , which


will maintain the record of entire system used for the data
entry of the various customer as well the generation of the
bills, reports etc.

 The software uses Microsoft Dot Net as the front-end as it is


user friendly and easy to use. It uses SQL server 2005 as
backend, to store the various confirmations in the system.

2
ADVANTAGES OF PROPOSED SYSTEM

 GUI : The proposed system provides better graphical user


interface.

 Search: Searching product,Sales,Supplier details becomes


comparatively easy.

 Increase work Speed: Due to automation of some part of the


system work speed will increase.

 Less Paperwork: For the proposed system less paper work is


required.

 Reduce Error: Due to computerized there are less


possibilities of error.

 Economical: Due to minimal errors and work dalay proposed


system can be economically to the company.

2
FEASIBILITY STUDY

To switch over the current manual system to the proposed


computerized system some factors must be taken under
considerationThey Are:-
Technical Feasibility:_
It is possible with the current technical support and
hardware development intranet the industry to fulfill defined
objectives and proposed activities. Microsoft dot net can be used
as Front-End and SQL server 2005 as Backend to apply
programming. And to provide better GUI with Security.
Operational Feasibility:-
It was found that was sufficient support for the
proposed project from management and users without any
Reluctance from either of them. The management and the staff
are willing to use and support the proposed system.

2
Economical Feasibility:-
With consideration of the following factors the
proposed system economical feasible:
-Start-up Cost
-Salary of analyst and programmers
-Salary of operating System
-Cost of installation and maintenance

Result of Feasibility study:-


On the three levels (technical, operational and economical) the
proposed system is feasible. It provides more benefits as
compared to the manual system.

2
REQUIREMENTS

 Hardware Requirements:

 Platform-Window 98, 2000, windowXP.


 512 MB RAM
 Processor-Pentium 3,Pentium4

 Software Requirements:

 Microsoft SQL server 2000


 Microsoft Visual Studio 2005

2
BACK END:
Advantages of SQL 2005
SQL-2000 is both a n easy to understand and comprehensive tool for
managing the data.

1. Vender Independence.
2. Portability across Computer System.
3. Relational foundation.
4. High-Level English like structure.
5. Programmatic Database Access.
6. Multiple views of data.
7. Complete database language.
8. Dynamic Data definition.
9. Client/Server architecture.

SQL also provides the Primary and foreign key concept which
Play a vital role during creation of database tables.
Primary key specifies that each values in a column of the table should be unique.
A column in on table whose values matches with the primary key in one table is
called as primary key.

2
FRONT END:

Advantage of using VB.net


VB.net is the latest product of .net framework. It allows you to develop the
windows applications easily and quickly.
VB.net provides a graphical environment for creation of forms and controlling
various events, i.e event handling with respect to the actions performed by the user
that becomes a building block of the application.
VB.net provides with the various tool that are more productive. We can use those
tools together to create complete application.VB.net is an event driven
programming language which supports many elements of the object oriented
programming language. There are no longer procedural and don’t follow sequential
flow.
The users can press keys and click on various buttons and boxes on the forms and
add records to the form and save the details to the database just by clicking save
buttons on the form. Each user action cause an event to occur, which in turn
triggers an integrated development environment in which one can develop, run, test
and debug the application.

2
GNATT CHART

Phase July Aug Sept Oct Nov Dec


Planning

Analysis

Design

Coding

Implemen
tation
& test

2
EVENT TABLE

Name Trigger Source Activity Response Destination


Newly Add the Customer Store Unique Customer
Customer Customer Customer Cutomer Id
added details details generated

Customer Product Customer Check Product Customer


inquiry. For Inquiry Product Availability
the Product Availability Details
Availability

Create New Customer Customer Create new Store & Management


order places order order and confirm order
details

Customer Delivery Management Store Customer Customer


order Customer payment payment
payment details details store
order bill & generate bill

Newly Add Management Store Unique Supplier


Supplier supplier Supplier Supplier Id
added info details generated

Purchased Stock Management Generate Purchase Supplier


order insufficient purchase invoice
placed invoice generated

Enter new Supplier Management Store new Stock details System


stock delivery stock details updated and
purchase confirmed
order

Reports View the Management Generate Reports Management


generation report report generated

Class Diagram

2
CustomerDetails CustomerOrder Bill
Customername Orderid Orderid
Address 1 1..* Productid Date
Station 1. Quantity 1..* Vatamount
Phonenumber Amount Totalamount
Emailid Date Paidamt
Balamt
Add() , Add() , Add() ,
Update() Update() Update()
Delete(), Delete(), Delete(),
1..*
Search() Search() Search
1..*
StockUpdate ProductDetails PurchaseOrder
Productid Product Name Orderid
Productid
Quantity Product Brand Quantity
1 1 1..* 1.. Amount
Date

Add() , Add() , Add() ,

Customer
Update() Update() Update()
Delete(), Delete(),
Search() 1..*
Search()

1..*

SupplierDetails 1..
Suppliername
Address
Station
Phonenumber
Emailid

Add() ,
Update()
Delete(),
Search()

Use Case Diagram

2
Customer

Customer

Regitration of Customer
Product Enquiry

Product Details

Places Sales Order

Confirm Sales Order

Request for Bill Customer

Manager Gives Bill

Supplier

Check Stock

Registraion of Supplier

Place Purchase Order

Gives Purchase Confirm

Supplier
Update Stock details
Manager

Sequence Diagram

2
Customer Manager Supplier
Product Inquiry

Product details

Place Order

Order confirmation

Payment

Bill

Place Order

Order Confirmation

Update the Stock

State Chart Diagram

2
. New
Customer
Register Product details
Product
Inquiry Gives Order
Order
Processing

Gives

Order

Update Quantity
Order
Processing

Confirmation

NO

Yes

Bill
generation

. Check the
Stock Check the quantity less
Place the
Order
Update the
Stock

CRUD TABLE

2
Form\ Login Customer Supplier Product Product Stock Customer CustDetail Purchas Purch Bill
e
DBase details details Name Brand Update Order Order Details
Order

Login RD

frmCustomer CRU
details

frmSupplier CRU
details

frmPrduct CRUD CRUD C


details

frmStock CRU
update

frmcustomer RU CRUD CRUD


order

frmpurchase CRUD CRUD


order

frmBill CRUD

C: Create new details R: Read exisiting details


U: Update exisiting details D:Delete exisiting details

Database Relationship

2
Database Description

2
The database used SQL 2005 includes database tables for
manipulating information.

1) Table Name: LoginDetail

This table is used to store user Login Details.

Field Name Data Type Length Key


UserID nvarchar 80
Password nvarchar 80

2) Table Name: - Mastercustomer

This table contains all the details of the Customerdetails


Form.

Field Name Data Type Length Key


customerid int 80 PK
customername nvarchar 50
address nvarchar 50
station nvarchar 50
phonenumber nvarchar 50
emailid nvarchar 50
status int 5

2
3) Table Name: - ProductName

This table contains all the Name of the Productdetails

Field Name Data Type Length Key


productid int 50 PK
productname nvarchar 50
status int 5

4) Table Name: - ProductBrand

This table contains all the brand of the Productdetails

Field Name Data Type Length Key


productid int 50 FK
productbrand nvarchar 50
status int 5

5)Table Name: - CustomerOrder

This table contains all the Order of the Customerorder

Field Name Data Type Length Key


orderid int 50 PK
customerid int 50 FK
amount int 502
date datetime
6)Table Name: - CustomerdetailOrder

This table contains all the Orderdetail of the Customerorder

Field Name Data Type Length Key


orderid int 50 PK
productid int 50 FK
quantity int 50
rate int 50

7) Table Name: -
PurchaseOrder
Field Name Data Type Length Key
purchaseorderid int 50 PK
supplierid int 50 FK
amount int 50
date datetime
This table contains all the Order of the Purchaseorder

8)Table Name: - PurchasedetailOrder

2
Field Name Data Type Length Key
purchaseorderid int 50 PK
productid int 50 FK
quantity int 50
rate int 50
This table contains all the Orderdetail of the Purchaseorder

9)Table Name: - Stockupdate

This table contains all the Quantity of the Stockupdate

Field Name Data Type Length Key


productid int 50 FK
quantity int 50
rate int 50

10)Table Name: - Billdetails

This table contains all the bills of the Bill

Field Name Data Type Length Key


billid int 50 PK
orderid int 50 FK
vatamount nvarchar 50
totalamount nvarchar 50
paidamt nvarchar 50
balamt nvarchar 50
date datetime

2
11)Table Name: - cashdetails

This table contains all the cash of the Bill

Field Name Data Type Length Key


billid int 50 FK
rs1000 int 50
rs500 int 50
rs100 int 50
rs50 int 50
rs10 int 50
rs5 int 50

12)Table Name: - chequedetails

This table contains all the cheque of the Bill

Field Name Data Type Length Key


billid int 50 FK
chequeno nvarchar 50
bankname nvarchar 50
branch nvarchar 50
totalamount int 50
date datetime

2
2) Table Name: - MasterSupplier

This table contains all the details of the Supplierdetails


Form.

Field Name Data Type Length Key


supplierid int 80 PK
ame nvarchar 50
address nvarchar 50
station nvarchar 50
phonenumber nvarchar 50
emailid nvarchar 50
status int 5

2
Menu Tree

Master Transaction Reports Utilites AboutUs

Customer Customer Summery Notepad


Master Order
Calculator
Supplier Purchase Sales
Master Order Purchase
Product
Product Stock Customer
Master Update

Bill Details
Customer

Stock

2
Report

Sales
Report

Purchase
Report

Screen Shot
Splash screen:

Login From:

2
Arein Mdiform:

2
Customerdetails:

2
SupplierDetails:

2
ProductDetails:

2
CustomerOrder:

2
PurchaseOrder:

2
StockUpdate:

2
Bill:

2
Sample Code:

2
LoginForm:
Public Class login
Dim sel As New DataView
Dim gridDataset As New DataSet
Dim f As New Functions

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


System.EventArgs) Handles btnlogin.Click
If (Me.txtuser.Text <> "" And Me.pswdtext.Text <> "") Then

sel = f.selectData("username,password", "login", "where


username='" & Me.txtuser.Text & "'")
If (sel.Count > 0) Then
If (sel.Item(0).Row.Item(1) = Me.pswdtext.Text) Then
areincomputer.Show()
Me.Visible = False
Else
MessageBox.Show("Enter the valid username and password",
"Loginfaild", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Enter the valid username and password",
"Loginfaild", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Enter the username and password", "Loginfaild",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If

End Sub

End Class

Customerdetails:

2
Imports WindowsApplication1.areincomputer
Public Class customerdetail
Dim sel As New DataView
Dim gridDataset As New DataSet
Dim f As New Functions
Dim ser As Integer = 0
Dim id As New DataView
Private Sub BindGrid()
sel = f.selectData("*", "mastercustomer", "where status =1 order by
customerid")
dgvcustomer.DataSource = sel
Me.dgvcustomer.Columns.RemoveAt(6)
' Me.cbocustid.Enabled = False
Me.btndelete.Enabled = False
Me.btnupdate.Enabled = False
End Sub
Public Function checkBlank(ByVal contrl As Control) As Boolean

If contrl.Text = "" Then


MsgBox(Mid(contrl.Name, 4) + " Can Not Left Blank")
changeColor(contrl, Color.Pink)
contrl.Focus()
checkBlank = False
Else
changeColor(contrl, Color.White)
checkBlank = True
End If

End Function
Public Sub changeColor(ByVal contrl As Control, ByVal col As Color)
contrl.BackColor = col
End Sub
Private Sub clear()
Me.txtcboid.Text = ""
Me.txtcboid.ReadOnly = True
Me.txtaddress.Text = ""
Me.cbostation.DataBindings.Clear()
'Me.cbostation.Text = "Select the catogories"
Me.txtemailid.Text = ""
Me.txtname.Text = ""
Me.txtphone.Text = ""
Me.txtsearchname.Text = ""
'Me.cbostation.Items.Clear()
Me.cbosearch.Text = "Select the catogories"
Me.btndelete.Enabled = False
Me.btnupdate.Enabled = False
Me.btnadd.Enabled = True
Me.btnsearch.Enabled = True
End Sub

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


System.EventArgs) Handles btnadd.Click
Dim field As String
Dim value, str As String
Dim dacu As New DataView

2
Me.btnadd.BackColor = Color.Lavender
Me.btndelete.Enabled = False
Me.btnupdate.Enabled = False
Dim erMsg As String
Dim upck, cuid As Integer
'If (Me.cbostation.SelectedItem <> -1) Then
' MessageBox.Show("Please select the Station", "station error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
'End If

'Me.checkBlank(txtaddress)
'Me.checkBlank(txtemailid)
'Me.checkBlank(txtname)
'Me.checkBlank(txtphone)
'Me.checkBlank(cbostation)
If (Me.checkBlank(txtaddress) = False Or Me.checkBlank(txtemailid) =
False Or Me.checkBlank(txtname) = False Or Me.checkBlank(txtphone) = False Or
Me.checkBlank(cbostation) = False) Then
upck = 1
End If

If (txtaddress.Text <> "" And Me.txtemailid.Text <> "" And


txtname.Text <> " " And txtphone.Text <> "" And cbostation.Text <> "") Then

erMsg = f.validateData(Me.txtname.Text, "singleName", "Please


enter the string value")

If (erMsg <> "") Then


MessageBox.Show(erMsg)
Me.txtname.Text = ""
upck = 1
End If

erMsg = f.validateData(Me.txtemailid.Text, "email", "Please enter


the correct emailId")

If (erMsg <> "") Then


MessageBox.Show(erMsg)
Me.txtemailid.Text = ""
upck = 1
End If

erMsg = f.validateData(Me.txtphone.Text, "isMobileNo", "Please


enter the correct Phone Number")

If (erMsg <> "") Then


MessageBox.Show(erMsg)
Me.txtphone.Text = ""
upck = 1
End If
End If

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


As System.EventArgs) Handles txtsearchname.TextChanged
If (Me.cbosearch.SelectedIndex <> -1) Then
If (Me.cbosearch.SelectedIndex = 0) Then
Dim msgerr As String

2
msgerr = f.validateData(Me.txtsearchname.Text, "isNumeric",
"Sorry,Only numbers are allow")
If (msgerr <> "") Then
MessageBox.Show(msgerr)
Me.txtsearchname.Text = ""
End If
End If
If (Me.cbosearch.SelectedIndex = 1) Then
Dim msgerr As String
msgerr = f.validateData(Me.txtsearchname.Text, "singleName",
"Sorry,Only character are allow")
If (msgerr <> "") Then
MessageBox.Show(msgerr)
Me.txtsearchname.Text = ""
End If
End If
If (Me.cbosearch.SelectedIndex = 2) Then
Dim msgerr As String
msgerr = f.validateData(Me.txtsearchname.Text, "singleName",
"Sorry,Only character are allow")
If (msgerr <> "") Then
MessageBox.Show(msgerr)
Me.txtsearchname.Text = ""
End If
End If
End If
End Sub
If (txtaddress.Text <> "" Or Me.txtemailid.Text <> "" Or txtname.Text <> ""
Or txtphone.Text <> "" Or cbostation.Text <> "") Then
Dim dub As New DataView
dub = f.selectData("*", "mastercustomer", "where customername='" &
Me.txtname.Text & "'and address='" & Me.txtaddress.Text & "'and station='" &
Me.cbostation.Text & "'and phonenumber='" & Me.txtphone.Text & "'and emailid
='" & Me.txtemailid.Text & "'")
If (dub.Count > 0) Then
upck = 1
MessageBox.Show("customer Information is already present .",
"Info", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.txtaddress.Text = ""
Me.cbostation.Text = ""
Me.txtemailid.Text = ""
Me.txtname.Text = ""
Me.txtphone.Text = ""
End If
Private Sub cbosearch_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles cbosearch.SelectedIndexChanged
Me.txtsearchname.Clear()
End Sub
End Class

CustomerOrder:
Public Class customer_order

2
Dim f As New Functions
Dim dat As DataView
Dim da As Date
Dim tqnt As Integer

Private Sub bindgrid()


Dim sel, sil As New DataView
Dim tbname As String
Dim qur As String

tbname = "customerorder"
qur = "order by customerorder.orderid"
sel = f.selectData("*", tbname, qur)
Me.dgvorder.DataSource = sel
'Me.dgvorder.ForeColor = Color.Black

End Sub
Public Function checkBlank(ByVal contrl As Control) As Boolean

If contrl.Text = "" Then


MsgBox(Mid(contrl.Name, 4) + " Can Not Left Blank")
changeColor(contrl, Color.Pink)
contrl.Focus()
checkBlank = False
Else
changeColor(contrl, Color.White)
checkBlank = True
End If

End Function
Private Sub bindpro()
Dim filed As String
Dim tabe As String
Dim quer As String
Dim sil As New DataView

filed =
"customerorder.orderid,customerdetailorder.productid,quantity,rate"
tabe = " customerorder,customerdetailorder"
quer = "where customerorder.orderid=customerdetailorder.orderid order
by customerorder.orderid"
sil = f.selectData(filed, tabe, quer)

End Sub
Private Sub btnproadd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnproadd.Click
Dim amount As Long
Dim total As Long = 0
Dim qun As New DataView
Dim check, con As Integer
Dim bol As Integer = 1

If (Me.btnproadd.Text = "Add") Then

2
If (Me.cboproductid.Text <> "" And Me.txtname.Text <> "" And
Me.txtbrand.Text <> "" And Me.txtqunty.Text <> "" And Me.txtrate.Text <> "")
Then
'check quantity
qun = f.selectData("quantity", "stockupdate", "where
productid=" & Me.cboproductid.Text)
If (qun.Count > 0) Then
check = qun.Item(0).Row.Item(0)
If ((Me.txtqunty.Text) < check) Then
'amount calculation
While (con < Me.lstproductid.Items.Count)
If (Me.cboproductid.Text =
Me.lstproductid.Items.Item(con)) Then
bol = 0
Me.cboproductid.Text = ""
Me.txtname.Text = ""
Me.txtqunty.Text = ""
Me.txtrate.Text = ""
Me.txtcmrate.Clear()
Me.txtstqn.Clear()
MessageBox.Show("The Product Entry is already
present", "Product Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
bol = 1
End If
con += 1

End While

If (bol = 1) Then
If (Me.cboproductid.Text <> "" And Me.txtname.Text
<> "" And Me.txtbrand.Text <> "" And Me.txtqunty.Text <> "" And
Me.txtrate.Text <> "") Then

Me.lstproductid.Items.Add(Me.cboproductid.Text)
Me.lstproductname.Items.Add(Me.txtname.Text)
Me.lstproductbrand.Items.Add(Me.txtbrand.Text)

Me.lstproductquntity.Items.Add(Me.txtqunty.Text)
Me.lstproductrate.Items.Add(Me.txtrate.Text)
Me.clear1()
Me.txtrate.Text = ""
Me.txtqunty.Text = ""
Else
MessageBox.Show("Please Select the Id of
Product to be added")
End If
End If

While total < Me.lstproductrate.Items.Count


amount = amount +
Me.lstproductquntity.Items.Item(total) * Me.lstproductrate.Items.Item(total)
total += 1
Me.txtamount.Text = amount
End While
Else

2
MessageBox.Show("Quantity should be less than" &
check, "Quantity warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Me.txtqunty.Clear()
Me.txtqunty.Focus()
End If
Else
MessageBox.Show("Sorry,No Quantity is available", "Error
Message", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.txtqunty.Text = ""
Me.txtrate.Text = ""
Me.cboproductid.Text = ""
End If
End If
'check of product in listbox
If (Me.lstproductid.Items.Count <> 0) Then
Me.btnremve.Enabled = True
End If
Me.btnproadd.Enabled = False

Else

'product update codeing


Dim val As String
Dim str2 As String
Dim qn, rt As Long
Dim da, de, upqn As New DataView
Dim co, qnup, lstqn As Integer
If (Me.txtname.Text <> "" And Me.txtrate.Text <> "" And
Me.txtqunty.Text <> "") Then
qun = f.selectData("quantity", "stockupdate", "where
productid=" & Me.cboproductid.Text)
If (qun.Count > 0) Then
check = qun.Item(0).Row.Item(0)
tqnt += check
End If
val = " quantity=" & Me.txtqunty.Text & ",rate='" &
Me.txtrate.Text & "'"
f.updateData("customerdetailorder", val, "where productid=" &
Me.cboproductid.Text & " and orderid=" & Me.txtorderid.Text)
'upqn = f.selectData("quantity", "stockupdate", "where
productid='" & Me.cboproductid.Text & "'")
lstqn = txtqunty.Text
If (tqnt > lstqn) Then
qnup = tqnt - lstqn
f.updateData("stockupdate", "quantity='" & qnup & "'",
"where productid='" & Me.cboproductid.Text & "'")
'display in productdetail grid
Me.dgvprodetail.Enabled = True
dat = f.selectData("*", "customerdetailorder", "where
orderid=" & Me.txtorderid.Text & "order by orderid")
Me.dgvprodetail.DataSource = dat
Me.dgvprodetail.ForeColor = Color.Black
qn = 0
rt = 0

2
de = f.selectData("*", "customerdetailorder", "where
orderid=" & Me.txtorderid.Text & "order by orderid")
Me.dgvprodetail.DataSource = de
Me.dgvprodetail.ForeColor = Color.Black
'update of amount
While (co < de.Count)
qn = de.Item(co).Row.Item(2)
rt += de.Item(co).Row.Item(3) * qn
co += 1
End While
Me.txtamount.Text = rt
f.updateData("customerorder", " amount=" &
Me.txtamount.Text, "where orderid=" & Me.txtorderid.Text)
str2 = MessageBox.Show("customerorder value Information is
updated.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information)
bindgrid()
Me.lstproductname.Items.Clear()
Me.lstproductid.Items.Clear()
Me.lstproductquntity.Items.Clear()
Me.lstproductrate.Items.Clear()
Me.lstproductbrand.Items.Clear()
Me.txtqunty.Text = ""
Me.txtrate.Text = ""
Me.cboproductid.Text = ""
Me.txtname.Text = ""
Me.txtbrand.Text = ""
Me.btnproadd.Enabled = False

Else
MessageBox.Show("Quantity should be less than" & check,
"Quantity warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Me.txtqunty.Clear()
Me.txtrate.Text = ""
Me.txtqunty.Focus()
Me.txtname.Text = ""
Me.txtbrand.Text = ""
End If
End If
End If
End Sub
Private Sub txtserch_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtserch.TextChanged
If (Me.cboserch.SelectedIndex <> -1) Then
If (Me.cboserch.SelectedIndex = 0 Or Me.cboserch.SelectedIndex =
1) Then Dim msgerr As String
msgerr = f.validateData(Me.txtserch.Text, "isNumeric",
"Sorry,Only numbers are allow")
If (msgerr <> "") Then
MessageBox.Show(msgerr)
Me.txtserch.Text = ""
End If
End If
End Sub
End Class

Reports:

2
2
2
2
ReportCode:

Sales Report:
Public Class salesreport
Inherits System.Windows.Forms.Form
Private Sub btnreport_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnreport.Click
If (dp1.Text < dp2.Text) Then

Dim ObjReportRpt As
CrystalDecisions.CrystalReports.Engine.ReportDocument = New
CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ObjReportViewer As reportviewer = New reportviewer
Try
Dim ds As New DataSet
Dim f As New Functions
ds =
f.selectGridData("orderid,customerorder.customerid,amount,mastercustomer.custo
mername,date", "customerorder,mastercustomer", "where date between'" &
Me.dp1.Text & "' and '" & Me.dp2.Text & "'and
mastercustomer.customerid=customerorder.customerid")
ObjReportRpt = New crystal2
ObjReportRpt.Database.Tables(0).SetDataSource(ds.Tables(0))
ObjReportViewer.CrystalReportViewer1.ReportSource =
ObjReportRpt
'ObjReportRpt.DataDefinition.FormulaFields("Name").Text = "'"
& Now.Date.ToString & "'"
ObjReportViewer.ShowInTaskbar = True
ObjReportViewer.Show()
ObjReportViewer.Focus()

Catch ex As Exception
End Try
Else
MessageBox.Show("Please enter the proper date,From date should be
less than To date")
End If
End Sub
End Class

2
Customer details:
Dim ObjReportRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument =
New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ObjReportViewer As reportviewer = New reportviewer
Try
Dim ds As New DataSet
Dim f As New Functions
ds = f.selectGridData("*", "mastercustomer", "where status=1")
ObjReportRpt = New Customer
ObjReportRpt.Database.Tables(0).SetDataSource(ds.Tables(0))
ObjReportViewer.CrystalReportViewer1.ReportSource = ObjReportRpt
'ObjReportRpt.DataDefinition.FormulaFields("Name").Text = "'" &
Now.Date.ToString & "'"
ObjReportViewer.ShowInTaskbar = True
ObjReportViewer.Show()
ObjReportViewer.Focus()
'ObjReportRpt = New report2
'ObjReportViewer.ReportViewerControl.ReportSource = ObjReportRpt
'ObjReportRpt.DataDefinition.FormulaFields("Name").Text = "'" &
Now.Date.ToString & "'"
'ObjReportViewer.ShowInTaskbar = True
'ObjReportViewer.Show()
'ObjReportViewer.Focus()
Catch ex As Exception
End Try

2
Implementation:

 First install the vb.net 2005 .

 Install your project.

 Install SQL server 2000.

 Restore your database.

Run your project

2
Future Scope:
 Improvement in some form designing.

 More reports generation.

 Billing processes.

2
Conclusion:
The project named as “Sales And Purchase” by now is familiar
to all. We had a great pleasure in developing this project. It is the
hard work and focus that had made this come out possible. It was a
great experience working with the “AreinComputers”.

In this project, we have discussed about the existing system


of the company’s working system & had found many drawbacks. On
the basis of those drawbacks we have proposed our system which
has been discussed in this project.

We had a hand on experience of operating the various


features of the software tools, which made us aware of the wide
future scope. The use of VB.NET provided us with the various
functions that gave us great ease and convenience in developing the
project. Working with SQL has made us to know database
operations practically very well

2
Bibliography
 Programming with Visual Basic 6.0
By, Francesco Balena.

 System Analysis and Design In a changing World.


By, Satzinger, Jackson & Burd.

 Mastering Visual Basic 6.0


By,Evangelos Petroutsos.

2
2

You might also like