shop management

Upload: aparnajanwalkar

Post on 08-Apr-2018

238 views

Category:

Documents


2 download

TRANSCRIPT

  • 8/7/2019 shop management

    1/99

    A

    PROJECT REPORT

    ON

    SHOP MANAGEMENT SYSTEM

    BY

    Tejas Ambekar

    SUBMITED TO

    UNIVERSITY OF PUNE AT

    JSPMs ENIAC INSTITUTE OF COMPUTER APPLICATION WAGHOLI, PUNE.

    ( 2010-2011)

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

    Wagholi Pune

    (2010-2011)

    JSPMS ENIAC INSTITUTE OF COMPUTER APPLICATION

  • 8/7/2019 shop management

    2/99

    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 ChoudharyMrs.Sarika Sharma

  • 8/7/2019 shop management

    3/99

  • 8/7/2019 shop management

    4/99

    Int r oduc t io n

    SHOP MANAGEMENT SYSTEM is a small systemmade for a small shops. The system keeps record of all the enteredproduct, 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

  • 8/7/2019 shop management

    5/99

    Sys t em Requi r eme nt s

    Hardware Requirements

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

    Software requirements

    1. Visual studio 20082. Visual Basic .NET 2.03. Microsoft Office

    Backend

    1. Ms-Access

  • 8/7/2019 shop management

    6/99

    Scope of Sys t em .

    The main aim of this system is to simplify the Shop data management.

    As the system comprises of various forms, its 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.

  • 8/7/2019 shop management

    7/99

    Feasibili t y St ud y

    The feasibility study involves three main phases such as Technicalfeasibility, 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 andthis measure of the cost effectiveness of a project. This is often called acost-benefit Analysis. The software and hardware required for thissystem are easily available now a day. No additional Cost will beincurred 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.

  • 8/7/2019 shop management

    8/99

    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 users need and the

    desired operation is done.

  • 8/7/2019 shop management

    9/99

    SYSTEM D IGRAMTREE DIGRAM

    LOGIN

    Serial no.

    Product Details CompanyDetails

    Customer Details Report

    Customer Name

    Customer ID

    Email ID

    Customer .

    ProductID

    Company ID

    Company Name

    Address

    Contact No.

    Email ID

    Type

    Address

    TransactionRe ort

    Customer Report

    Bill Report

    ProductName

    Product

    Quantity

  • 8/7/2019 shop management

    10/99

    U SE CASE DIGRAM

    User Lo in

    User Update Product Details..

    Product Information

    View Customer Details

    Update Customer Details

    View Company Details

    User Insert Product Details.

    Update Company Details

    Customer

    Purchase Product

    Bill

    Administrator

  • 8/7/2019 shop management

    11/99

    Entity Relationship Diagram

    Customer

    Bill

    1

    M

    Product

    Final BillCompany

    M

    1

    1

    1

    M

    M

  • 8/7/2019 shop management

    12/99

  • 8/7/2019 shop management

    13/99

    1st Level Fragments

    1.0

    P repare master

    ile

    A min

    ompany,pro tDetails

    stomer stomer etails

    M anagementP rovi e Details

    P ro t

    ompany

    stomer

    Save the pro t etails

    Store ompanyprofile

    Store stomer etails

    2 .0Pu r hase

    A min

    Req u est for pro uc t

    Or er ispat c he

    P ro uc t

    c ompany

    inal ill

    pro uc t etails

    Store transa c tion

    generate bill

    3 .0Sear c hpro uc t

    u stomer

    P ro uc t

    c ompany

    Sear c h for pro uc t

    get res u lt

    req u est pro uc t etails

    show list

    show etails

    4 .0Sales

    req u est for pro uc t

    Dispat c h pro uc t

    P ro uc t

    ill

    ompany profile

    pro uc t list

    prepare invoi c e

    generate invoi c e

    5 .0prepare final

    report

    M anagement

    a cc ept etaile report

  • 8/7/2019 shop management

    14/99

  • 8/7/2019 shop management

    15/99

    Class Diagram

  • 8/7/2019 shop management

    16/99

    Object Diagram

    P:Product

    ProductId:P01Product Name:PenDrive

    P:Product

    ProductId:P01Product Name:PenDrive

    F:Final Bill

    Serial No.: S01Product: PenDriveRate: 300

    B: Bill

    TransId: 1ProductName: PenDriveRate: 300

    P:Product

    ProductId:P01Product Name:PenDrive

    Co: Company

    CompId: C101CompName:Kingstone

    Cu:Customer

    CustId: C201CustName: Tejas

  • 8/7/2019 shop management

    17/99

  • 8/7/2019 shop management

    18/99

    cu t r rcr duct

    r u t f r r duct

    Bill r t d

    r duct di tc d

    cl i ic

    B

    CA

  • 8/7/2019 shop management

    19/99

    Sequence Diagram For Sales

    sea rc ()

    Pr duct

    Sa les

    iss u esa leo rd e r

    di spa tcp r o duct

    s to r e tr ansa cti ond e ta ils

    Shopd a tabase

    tr ansa cti onc omp le te d

    Ad m in

  • 8/7/2019 shop management

    20/99

  • 8/7/2019 shop management

    21/99

    Component Diagram

    Event Trigger source Activity Response Destination

    Create theProductrecord

    Record theproduct

    Admin Save theproduct

    Display theproduct

    Admin

    Maintainstock update

    Add newrecord of product withold product

    Admin Save theproductupdate theproduct

    Display thetotal productavailable

    Admin

    Customer

    place order

    Product

    inquiry

    Customer Lookup

    product

    Product detail

    generation

    Customer

    Createcustomerbill

    Updatecustomeraccount

    Admin Create thecustomerpayment

    Display thepayment

    Admin

    Maintaincustomerbill

    Updatewhole totalaccount of customer

    Admin Update theCustomeraccount

    Display thetotal customeraccount

    Admin

    Createdealer Bill

    Update thedealeraccount

    Manager Update thedealeraccount

    Display thedealer account

    Manager

    MaintainDealer bill

    Dealerpayment

    Manager UpdateDealerpayment

    Display thedealer payment

    Manager

    ProductPurchaseorder

    Productorder

    Manager Purchaseproductorder

    Display orderReport

    Manager

  • 8/7/2019 shop management

    22/99

    Admin

    En uir

    Customer

    Shop

    Order

    Bill

    Report

    Customer

    Dealer

    Customer

    Com an

  • 8/7/2019 shop management

    23/99

    Collabo r a t io n Diag r am

    1 .Fin d use r 2 .U pda t e U se r

    1:Fp=Fi n d(P r oduc t) Pu r chase P r oduc t

    2:(p r oduc t, Fp )

    1 .1 Fp=Fi n d(P r oduc t) 1 .2Fp=Fi n d(p )

    WindowsApp.User Interface

    User Validator

    User DB

    2.1 ValidateUser

    1.1 LookUpUser

    2.1 LookUser

    Company

    :Stock

    :Product qty:Product qua

    :Product Price

  • 8/7/2019 shop management

    24/99

    1:Fp=Fi n d P r oduc t (p r oduc t)

    Sale P r oduc t

    2:(P r oduc t, Fp )

    1 .1 Fp=Fi n d(P r oduc t) 2 .1Fp=Fi n d(p )

    Customer

    :Stock

    :Product qty:Product qua

    :Product Price

  • 8/7/2019 shop management

    25/99

    Scr ee n sho t s

    Logi n Fo r m:

    Mai n Fo r m :

  • 8/7/2019 shop management

    26/99

    C

  • 8/7/2019 shop management

    27/99

    Cust ome

    rE

    nt ryFo

    rm:

  • 8/7/2019 shop management

    28/99

    P r oduc t Ent ry Fo r m :

  • 8/7/2019 shop management

    29/99

    Shop P r oduc t Selec t io n Fo r m :

  • 8/7/2019 shop management

    30/99

    Compa n y Ent ry Fo r m :

  • 8/7/2019 shop management

    31/99

    Da t abase Desig n Logi n :

    User_id TextPassword Text

    Cus t ome r :

    Cust_id TextCust_name TextCont_no TextEmail_id TextCust_id Text

    P r oduc t :

    Prod_id TextProd_name TextSerial_no TextProd_comp TextProd_qty Number Prod_dt Date/TimeProd_prize Number

  • 8/7/2019 shop management

    32/99

    Compa n y :

    Comp_id Text

    Comp_name TextCmp_add TextContact_no Number Fax_no Number Email_id TextComp_type Text

    Bill :

    Cust_id TextCust_name TextTrans_id Number Date Date/timeItemname TextItemmcomp TextItemserial TextItemid TextItemqty Number Itenrate Number Rmqty Number

    Itemdisc Number Totalprize Number

  • 8/7/2019 shop management

    33/99

    Con clusio n This software fulfills for the requirement of Product purchase. This

    software is used to conclude that1. 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 byembedding 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.

  • 8/7/2019 shop management

    34/99

    Limi t a t io n of t he p r ojec t

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

    2. Notable to print bill.

    3. Could not Connect To Internet.

  • 8/7/2019 shop management

    35/99

    Fu t u r e E n ha n ceme nt

    1. In future this windows application will provide online order system. In which user can be able to make order. The transactionof 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.

  • 8/7/2019 shop management

    36/99

  • 8/7/2019 shop management

    37/99

    Source Code

  • 8/7/2019 shop management

    38/99

    1. Login Form

    Public Class loginformDim cn As New OleDb.OleDbConnectionDim cmd As New OleDb.OleDbCommand

    Dim str As StringDim oledbdr As OleDb.OleDbDataReaderDim count As IntegerPrivate Sub Form1_Load(ByVal sender As System.Object,

    ByVal e As System.EventArgs) Handles MyBase.Loadcn = New

    OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Documents andSettings\darshana\Desktop\pro\Shop\shopproject\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()

    Elsestr = "select * from login where user_id='" &

    usertxt.Text & "' and password='" & passtxt.Text & "' "cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReader()

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

    Dim i As Integeri = 0While oledbdr.Read()

    usertxt.Text = oledbdr("user_id")passtxt.Text = oledbdr("password")

    i = i + 1

  • 8/7/2019 shop management

    39/99

    End WhileIf i = 0 Then

    MsgBox("Sorry U Have Not User.....!")Else

    shopmain.Show()

    Me.Visible = Falseusertxt.Text = ""passtxt.Text = ""

    End IfEnd If

    cn.Close()

    count = count + 1

    If count > 2 ThenMsgBox("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 shopmainPrivate Sub shopmain_Load(ByVal sender As System.Object,

    ByVal e As System.EventArgs) Handles MyBase.LoadDateTimePicker1.Enabled = False'Label8.Text = loginform.usertxt.Text

    End Sub

  • 8/7/2019 shop management

    40/99

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

    EndMe.Close()

    End Sub

    Private Sub backbtn_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles backbtn.Click

    Me.Close()loginform.Visible = Trueloginform.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(ByValsender As System.Object, ByVal e As System.EventArgs) HandlesProductDetailsToolStripMenuItem.Click

    product.Show()Me.Visible = False

  • 8/7/2019 shop management

    41/99

    End Sub

    Private Sub CustomerDetailsToolStripMenuItem_Click(ByValsender As System.Object, ByVal e As System.EventArgs) Handles

    CustomerDetailsToolStripMenuItem.Clickcustomer.Show()Me.Visible = False

    End Sub

    Private Sub CompanyDetailsToolStripMenuItem_Click(ByValsender As System.Object, ByVal e As System.EventArgs) HandlesCompanyDetailsToolStripMenuItem.Click

    company.Show()Me.Visible = False

    End Sub

    Private Sub BillDetailsToolStripMenuItem_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs) HandlesBillDetailsToolStripMenuItem.Click

    purchase.Show()Me.Visible = False

    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesExitToolStripMenuItem.Click

    Me.Close()loginform.Enabled = Trueloginform.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 AsSystem.Object, ByVal e As System.EventArgs) Handlesfinalbillbtn.Click

    finalcrystal.Show()End Sub

  • 8/7/2019 shop management

    42/99

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

    As System.EventArgs) Handles btn.ClickForm2.Show()custidtxt.Text = ""

    End SubEnd Class

    3. Company Form

    Public Class company

    Dim cn As New OleDb.OleDbConnectionDim cmd As New OleDb.OleDbCommandDim oledbdr As OleDb.OleDbDataReaderDim da As New OleDb.OleDbDataAdapter

    Dim ds As New DataSetPrivate 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 removeit, as needed.

    Me.CompanyTableAdapter2.Fill(Me.ShopdatabaseDataSet10.company)'TODO: This line of code loads data into the

    'ShopdatabaseDataSet9.company' table. You can move, or removeit, as needed.

    'Me.CompanyTableAdapter1.Fill(Me.ShopdatabaseDataSet9.company)'TODO: This line of code loads data into the

    'ShopdatabaseDataSet2.company' table. You can move, or removeit, as needed.

    'Me.CompanyTableAdapter.Fill(Me.ShopdatabaseDataSet2.company)cn = New

    OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Documents and Settings\darshana\Desktop\pro\Shop\shopproject\shopdatabase.mdb")

    oldradio.Checked = True

    AddToolStripMenuItem.Enabled = FalseSearchToolStripMenuItem.Enabled = TrueSaveToolStripMenuItem.Enabled = TrueDeleteToolStripMenuItem.Enabled = TrueUpdateToolStripMenuItem.Enabled = True

  • 8/7/2019 shop management

    43/99

    SelectToolStripMenuItem.Enabled = True

    End Sub

    Private Sub addbtn_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles addbtn.Clickadd1()

    End Sub

    Private Sub newradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesnewradio.CheckedChanged

    If newradio.Enabled = True Thennew1()SearchToolStripMenuItem.Enabled = False

    End IfEnd 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.Clickselect1()

    End Sub

    Private Sub exitbtn_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles exitbtn.Click

    exit1()

  • 8/7/2019 shop management

    44/99

    End Sub

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

    delete1()

    End SubPrivate Sub updtbtn_Click(ByVal sender As System.Object,

    ByVal e As System.EventArgs) Handles updtbtn.Clickupdate1()

    End Sub

    Private Sub oldradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesoldradio.CheckedChanged

    If oldradio.Enabled = True Thencompid.Enabled = Truecompname.Enabled = Falsecompadd.Enabled = Falsecompno.Enabled = Falsecompfaxno.Enabled = Falsecompeid.Enabled = Falsecomptype.Enabled = Falsesearchbtn.Enabled = Trueaddbtn.Enabled = Falserstbtn.Enabled = Trueupdtbtn.Enabled = Truedltbtn.Enabled = Truesavebtn.Enabled = Trueselectbtn.Enabled = True

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

    AddToolStripMenuItem.Enabled = False

    SearchToolStripMenuItem.Enabled = TrueSaveToolStripMenuItem.Enabled = TrueDeleteToolStripMenuItem.Enabled = TrueUpdateToolStripMenuItem.Enabled = TrueSelectToolStripMenuItem.Enabled = True

    End If

  • 8/7/2019 shop management

    45/99

    End Sub

    Private Sub NewToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles

    NewToolStripMenuItem.Clicknew1()newradio.Checked = True

    End Sub

    Private Sub SaveToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSaveToolStripMenuItem.Click

    save1()End Sub

    Private Sub SelectToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSelectToolStripMenuItem.Click

    select1()End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesExitToolStripMenuItem.Click

    exit1()End Sub

    Private Sub ResetToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesResetToolStripMenuItem.Click

    reset1()End Sub

    Private Sub UpdateToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesUpdateToolStripMenuItem.Click

    update1()End Sub

    Private Sub AddToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesAddToolStripMenuItem.Click

    add1()End Sub

  • 8/7/2019 shop management

    46/99

    Private Sub SearchToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSearchToolStripMenuItem.Click

    search1()End Sub

    Private Sub DeleteToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesDeleteToolStripMenuItem.Click

    delete1()End Sub

    Private Sub ShowToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesShowToolStripMenuItem.Click

    refresh1()End Sub

    Sub add1()

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

    End If

    If compname.Text = "" ThenMsgBox("Please Fill The Company Name

    Field......!!!")compname.Text = ""compname.Focus()Return

    End If

    If compadd.Text = "" Then

    MsgBox("Please Fill The Company AddressField.....!!!")compadd.Text = ""compadd.Focus()Return

    End If

    If compno.Text = "" Then

  • 8/7/2019 shop management

    47/99

    MsgBox("Please Fill The Company NumberField.....!!!")

    compno.Text = ""compno.Focus()Return

    End IfIf compfaxno.Text = "" Then

    MsgBox("Please Fill The Company Fax NumberField....!!!")

    compfaxno.Text = ""compfaxno.Focus()Return

    End If

    If compeid.Text = "" ThenMsgBox("Please Fill The Company Email-ID

    Field....!!!!")compeid.Text = ""compeid.Focus()Return

    End If

    If compeid.Text.IndexOf("@")

  • 8/7/2019 shop management

    48/99

    cn.Open()Dim i As Integer = cmd.ExecuteNonQuerycn.Close()MsgBox("Successfully Added....!!!!")

    Else MsgBox("company no and fax no should contain numberonly...!!!")

    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 = Truecompadd.Enabled = Truecompno.Enabled = Truecompfaxno.Enabled = Truecompeid.Enabled = Truecomptype.Enabled = Truesearchbtn.Enabled = Falseaddbtn.Enabled = True

  • 8/7/2019 shop management

    49/99

    rstbtn.Enabled = Trueupdtbtn.Enabled = Falsesavebtn.Enabled = Falsedltbtn.Enabled = Falseselectbtn.Enabled = False

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

    SaveToolStripMenuItem.Enabled = FalseDeleteToolStripMenuItem.Enabled = FalseUpdateToolStripMenuItem.Enabled = FalseSelectToolStripMenuItem.Enabled = FalseAddToolStripMenuItem.Enabled = True

    End Sub

    Sub search1()

    cn.Open()Dim str As StringIf compid.Text = "" Then

    MsgBox("Please Enter Company ID")Else

    str = "select * from company where comp_id= '" &compid.Text & "'"

    cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReadercompid.Text = ""compname.Text = ""compadd.Text = ""

    compno.Text = ""compfaxno.Text = ""compeid.Text = ""comptype.Text = ""Dim i As Stringi = 0While oledbdr.Read()

    compid.Text = oledbdr("comp_id")

  • 8/7/2019 shop management

    50/99

    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 + 1End WhileIf i = 0 Then

    MsgBox("No Record Found....!!!!")

    End IfEnd Ifcn.Close()

    End Sub

    Sub delete1()

    TryDim i As Integercn.Open()Dim str As StringIf compid.Text = "" Then

    MsgBox("Please Enter Customer Id....!!!")Else

    str = "select * from company where comp_id='" &compid.Text & "'"

    cmd.CommandText = strcmd.Connection = cnoledbdr = cmd.ExecuteReader

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

    compeid.Text = ""comptype.Text = ""

    i = 0While oledbdr.Read

    i = i + 1

  • 8/7/2019 shop management

    51/99

    End While

    End Ifcn.Close()

    If i = 0 ThenMsgBox("No Record found....!!!")

    Elsecn.Open()

    cmd.CommandText = " delete from company wherecomp_id='" & compid.Text & " '"

    cmd.CommandType = CommandType.Textcmd.Connection = cn

    Dim ii As Integer = cmd.ExecuteNonQuery

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

    End If

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Trycompid.Text = ""

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

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

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

  • 8/7/2019 shop management

    52/99

    End Sub

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

    cn) ds = New DataSetda.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 ExceptionMsgBox("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 = Truecompname.Enabled = Truecompadd.Enabled = Truecompno.Enabled = True

  • 8/7/2019 shop management

    53/99

    compfaxno.Enabled = Truecompeid.Enabled = Truecomptype.Enabled = True

    End Sub

    Sub save1()Try

    If compid.Text = "" ThenMsgBox("Please Fill The Company ID Field...!!!!

    ")compid.Text = ""compid.Focus()

    Elsecn.Open()Dim str As Stringstr = "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 = strMsgBox(str)cmd.CommandType = CommandType.Textcmd.Connection = cn'Dim oledbdr As Integer = OleDb.OleDbDataReaderDim ii As Integer = cmd.ExecuteNonQuerycn.Close()MsgBox("Successfully Updated" & ii)

    End IfCatch 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 = ""

  • 8/7/2019 shop management

    54/99

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

    oldradio.Checked = TrueEnd 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 AsSystem.Object, ByVal e As System.EventArgs) Handlescompid.TextChanged

    End SubEnd Class

    4. Bill Form

    Public Class bill

    Dim cmd As New OleDb.OleDbCommandDim cn As New OleDb.OleDbConnectionDim da As New OleDb.OleDbDataAdapterDim ds As New DataSet()Dim oledbdr As OleDb.OleDbDataReader

    Private Sub bill_Load(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles MyBase.Load

    cn = NewOleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data

  • 8/7/2019 shop management

    55/99

    Source=C:\Documents and Settings\darshana\Desktop\pro\Shop\shopproject\shopdatabase.mdb")

    'TODO: This line of code loads data into the

    'ShopdatabaseDataSet8.finalbill' table. You can move, or removeit, as needed.

    Me.FinalbillTableAdapter.Fill(Me.ShopdatabaseDataSet8.finalbill)'TODO: This line of code loads data into the

    'ShopdatabaseDataSet6.finalbill' table. You can move, or removeit, as needed.

    custid.Text = purchase.custidtxt.Texttransid.Text = purchase.transtxt.Textcustname.Text = purchase.custnametxt.Textdttxt.Text = purchase.dt1txt.Text

    custid.Enabled = Falsetransid.Enabled = Falsecustname.Enabled = Falsedttxt.Enabled = False

    Try

    Me.FinalbillTableAdapter.FillBy(Me.ShopdatabaseDataSet8.finalbill, transid.Text)

    Catch ex As System.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)

    End Try

    Trycn.Open()Dim str As StringDim gt As Double = 0str = "select totalprize from bill where

    trans_id='" & transid.Text & "'"' MsgBox(str)cmd.CommandText = str

    cmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read

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

  • 8/7/2019 shop management

    56/99

    End Whilegttextbox.Text = gt

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Try

    cn.Close()totalamt.Text = gttextbox.Text

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

    End Sub

    Private Sub FillByToolStripButton_Click_1(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesFillByToolStripButton.Click

    Try

    Me.FinalbillTableAdapter.FillBy(Me.ShopdatabaseDataSet8.finalbill, TrancidToolStripTextBox.Text)

    Catch ex As System.ExceptionSystem.Windows.Forms.MessageBox.Show(ex.Message)

    End Try

    End Sub

    Private Sub disctxt_TextChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesdisctxt.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()

  • 8/7/2019 shop management

    57/99

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

    purchase.newradio.Checked = Falsepurchase.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 AsSystem.Object, ByVal e AsSystem.Windows.Forms.DataGridViewCellEventArgs) HandlesDataGridView1.CellContentClick

    End SubEnd Class

    5. Customer Form

    Public Class customer

    Dim oledbdr As OleDb.OleDbDataReaderDim cn As New OleDb.OleDbConnectionDim cmd As New OleDb.OleDbCommandDim da As New OleDb.OleDbDataAdapterDim 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 removeit, as needed.

    Me.CustomerTableAdapter.Fill(Me.ShopdatabaseDataSet1.customer)cn = New

    OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Documents and Settings\darshana\Desktop\pro\Shop\shopproject\shopdatabase.mdb")

    oldradio4.Checked = TrueAddToolStripMenuItem.Enabled = FalseSearchToolStripMenuItem.Enabled = True

  • 8/7/2019 shop management

    58/99

    DeleteToolStripMenuItem.Enabled = TrueSaveToolStripMenuItem.Enabled = TrueSelectToolStripMenuItem.Enabled = TrueUpdateToolStripMenuItem.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 AsSystem.Object, ByVal e As System.EventArgs) Handlesnewradio3.CheckedChanged

    If newradio3.Checked = True Thennew1()AddToolStripMenuItem.Enabled = TrueUpdateToolStripMenuItem.Enabled = FalseSearchToolStripMenuItem.Enabled = FalseDeleteToolStripMenuItem.Enabled = FalseSaveToolStripMenuItem.Enabled = FalseSelectToolStripMenuItem.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

  • 8/7/2019 shop management

    59/99

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

    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 AsSystem.Object, ByVal e As System.EventArgs) Handlesoldradio4.CheckedChanged

    If oldradio4.Enabled = True Thencustid.Enabled = Truecustname.Enabled = Falsecustno.Enabled = Falsecusteid.Enabled = Falsecustadd.Enabled = Falsesearchbtn.Enabled = Trueaddbtn.Enabled = Falsedltbtn.Enabled = Truerstbtn.Enabled = Trueupdtbtn.Enabled = Truesavebtn.Enabled = Trueselectbtn.Enabled = True

    custid.Text = ""

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

    End If

  • 8/7/2019 shop management

    60/99

    custid.ReadOnly = Falsecustid.Text = ""

    End Sub

    'fuction defination' add function defination

    Sub add()Try

    If custname.Text = "" ThenMsgBox("Please Fill The NAME Field.....!!!")custname.Text = ""custname.Focus()Return

    End If

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

    End If

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

    End If

    If custeid.Text.IndexOf("@")

  • 8/7/2019 shop management

    61/99

    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.Textcmd.Connection = cncn.Open()Dim i As Integer = cmd.ExecuteNonQuerycn.Close()MsgBox("Successfully Added.....!!!" & i)

    Else

    MsgBox("Contact Number Should Be NumberOnly.....!!!")

    custno.Text = ""custno.Focus()Return

    End If

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Try

    da = New OleDb.OleDbDataAdapter("select * fromcustomer", 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 = ""

  • 8/7/2019 shop management

    62/99

    custadd.Text = ""newradio3.Checked = Falsecustid.Text = ""oldradio4.Checked = Falseaddbtn.Enabled = False

    End Sub

    'search function defination

    Sub search()

    cn.Open()Dim str As StringIf custid.Text = "" Then

    MsgBox("Please Enter Customer Id ")Else

    str = "select * from customer where cust_id='" &custid.Text & "'"

    cmd.CommandText = strcmd.Connection = cnoledbdr = cmd.ExecuteReadercustid.Text = ""custname.Text = ""custno.Text = ""custeid.Text = ""custadd.Text = ""Dim i As Integeri = 0While 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 WhileIf i = 0 Then

    MsgBox("No Record found ")End If

    End If

  • 8/7/2019 shop management

    63/99

    cn.Close()

    End Sub

    'new function defination

    Sub new1()custid.Enabled = Truecustname.Enabled = Truecustno.Enabled = Truecusteid.Enabled = Truecustadd.Enabled = Truesearchbtn.Enabled = Falseaddbtn.Enabled = Truedltbtn.Enabled = Falserstbtn.Enabled = Trueupdtbtn.Enabled = Falsesavebtn.Enabled = Falseselectbtn.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

  • 8/7/2019 shop management

    64/99

    cn.Open()Dim str As StringIf custid.Text = "" Then

    MsgBox("Please Enter Customer Id...!!! ")Else

    str = "select * from customer where cust_id='" &custid.Text & "'"

    cmd.CommandText = strcmd.Connection = cnoledbdr = cmd.ExecuteReader

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

    i = 0While oledbdr.Read

    i = i + 1

    End While

    End Ifcn.Close()

    If i = 0 ThenMsgBox("No Record found....!!!! ")

    Elsecn.Open()

    cmd.CommandText = " delete from customer wherecust_id='" & custid.Text & " '"

    cmd.CommandType = CommandType.Textcmd.Connection = cn

    Dim ii As Integer = cmd.ExecuteNonQuery

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

    End If

    Catch ex As ExceptionMessageBox.Show(ex.Message)

  • 8/7/2019 shop management

    65/99

    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 = Truecustname.Enabled = Truecustno.Enabled = Truecusteid.Enabled = Truecustadd.Enabled = True

    End Sub

    'refresh function defination

    Sub refresh1()

    da = New OleDb.OleDbDataAdapter("select * fromcustomer", 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()

  • 8/7/2019 shop management

    66/99

  • 8/7/2019 shop management

    67/99

    cmd.CommandType = CommandType.Textcmd.Connection = cn'Dim oledbdr As Integer = OleDb.OleDbDataReaderDim ii As Integer = cmd.ExecuteNonQuerycn.Close()

    MsgBox("Successfully Updated" & ii)End If

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Try

    da = New OleDb.OleDbDataAdapter("select * fromcustomer", 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 AsSystem.Object, ByVal e As System.EventArgs) HandlesNewToolStripMenuItem.Click

    new1()newradio3.Checked = TrueEnd Sub

    Private Sub SaveToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSaveToolStripMenuItem.Click

    save()

  • 8/7/2019 shop management

    68/99

    End Sub

    Private Sub ResetToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles

    ResetToolStripMenuItem.Clickreset()oldradio4.Checked = True

    End Sub

    Private Sub UpdateToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesUpdateToolStripMenuItem.Click

    update1()End Sub

    Private Sub AddToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesAddToolStripMenuItem.Click

    add()End Sub

    Private Sub DeleteToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesDeleteToolStripMenuItem.Click

    delete()End Sub

    Private Sub SearchToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSearchToolStripMenuItem.Click

    search()End Sub

    Private Sub ShowToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesShowToolStripMenuItem.Click

    Refresh()End Sub

    Private Sub SelectToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSelectToolStripMenuItem.Click

    select1()End Sub

  • 8/7/2019 shop management

    69/99

    Private Sub ExitToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesExitToolStripMenuItem.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, ByVale As System.EventArgs) Handles MyBase.LoadDim rpcl As New CrystalReport1Me.CrystalReportViewer1.ReportSource = rpcl

    End Sub

    Private Sub CrystalReportViewer1_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub CrystalReportViewer1_Load_1(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesCrystalReportViewer1.Load

    End SubEnd Class

    7. Final Crystal Form

    Public Class finalcrystal

    Private Sub Form2_Load(ByVal sender As System.Object, ByVale As System.EventArgs) Handles MyBase.LoadDim rpcl As New CrystalReport2Me.CrystalReportViewer1.ReportSource = rpcl

    End Sub

    End Class

  • 8/7/2019 shop management

    70/99

  • 8/7/2019 shop management

    71/99

    Private Sub addbtn_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles addbtn.Click

    add()

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

  • 8/7/2019 shop management

    72/99

    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 = Trueshopmain.Show()

    End Sub

    Private Sub NewToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesNewToolStripMenuItem.Click

    newq()End Sub

    Private Sub SaveToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSaveToolStripMenuItem.Click

    save()End Sub

    Private Sub SelectToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSelectToolStripMenuItem.Click

    select1()End Sub

    Private Sub ExitToolStripMenuItem_Click_1(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesExitToolStripMenuItem.Click

    shopmain.Show()Me.Hide()

    End Sub

    Private Sub ResetToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles

    ResetToolStripMenuItem.Clickreset()End Sub

    Private Sub ShowToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesShowToolStripMenuItem.Click

    show1()

  • 8/7/2019 shop management

    73/99

    End Sub

    Private Sub UpdateToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesUpdateToolStripMenuItem.Click

    update1()End Sub

    Private Sub DeleteToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesDeleteToolStripMenuItem.Click

    delete()End Sub

    Private Sub AddToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesAddToolStripMenuItem.Click

    add()End Sub

    Private Sub SearchToolStripMenuItem_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesSearchToolStripMenuItem.Click

    search()End Sub

    Private Sub newradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesnewradio.CheckedChanged

    If newradio.Checked = True Thennewq()

    End IfEnd Sub

    Private Sub oldradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesoldradio.CheckedChanged

    If oldradio.Enabled = True Thenprodid.Enabled = True

    prodname.Enabled = Falseserialtxt.Enabled = Falseprodcompcombo.Enabled = Falseprodqty.Enabled = Falseproddt.Enabled = Falseaddbtn.Enabled = Falserstbtn.Enabled = Truedltbtn.Enabled = True

  • 8/7/2019 shop management

    74/99

    updtbtn.Enabled = Truesavebtn.Enabled = Truesearchbtn.Enabled = Trueprodprize.Enabled = Falseselectbtn.Enabled = True

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

    DeleteToolStripMenuItem.Enabled = TrueSearchToolStripMenuItem.Enabled = TrueUpdateToolStripMenuItem.Enabled = TrueShowToolStripMenuItem.Enabled = True

    SaveToolStripMenuItem.Enabled = TrueSelectToolStripMenuItem.Enabled = True

    End IfEnd Sub

    ' Function Declaration

    'SHOWSub 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 = Trueprodname.Enabled = Trueserialtxt.Enabled = Trueprodcompcombo.Enabled = Trueprodqty.Enabled = Trueproddt.Enabled = Trueaddbtn.Enabled = True

  • 8/7/2019 shop management

    75/99

    rstbtn.Enabled = Truedltbtn.Enabled = Falseupdtbtn.Enabled = Falsesearchbtn.Enabled = Falseprodprize.Enabled = True

    selectbtn.Enabled = Falsesavebtn.Enabled = Falsenewradio.Checked = TrueAddToolStripMenuItem.Enabled = True

    DeleteToolStripMenuItem.Enabled = FalseSearchToolStripMenuItem.Enabled = FalseUpdateToolStripMenuItem.Enabled = FalseSaveToolStripMenuItem.Enabled = FalseSelectToolStripMenuItem.Enabled = FalseShowToolStripMenuItem.Enabled = False

    End Sub

    'SAVESub save()

    TryIf prodid.Text = "" Then

    MsgBox("Please Fill The Customer ID Field...!!!!")

    prodid.Text = ""prodid.Focus()

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

    cn.Open()Dim str As Stringstr = "update product set prod_name = '" &

    prodname.Text & "', serial_no= '" & serialtxt.Text & "',prod_comp = '" & prodcompcombo.Text & "', prod_qty = " &prodqty.Text & " ,prod_prize=" & prodprize.Text & " whereprod_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.ExecuteNonQuerycn.Close()MsgBox("Successfully Updated" & ii)

    Else

  • 8/7/2019 shop management

    76/99

    MsgBox("Please Quantity and Prize FieldShould be numbers Only.....!!!!")

    prodqty.Text = ""prodqty.Focus()prodprize.Text = ""

    prodprize.Focus()End IfEnd If

    Catch ex As ExceptionMessageBox.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

    'RESETSub reset()

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

    End Sub

    'UPDATESub update1()

    prodid.Enabled = Falseprodname.Enabled = Trueserialtxt.Enabled = Trueprodcompcombo.Enabled = Trueprodqty.Enabled = True

    proddt.Enabled = Trueprodprize.Enabled = TrueEnd Sub

    'ADDSub add()

    TryIf prodid.Text = "" Then

  • 8/7/2019 shop management

    77/99

    MsgBox("Please Fill The Product IDField.....!!!")

    prodid.Text = ""prodid.Focus()Return

    End If

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

    End If

    If serialtxt.Text = "" ThenMsgBox("Please Fill Serial Number

    Field.....!!!")serialtxt.Text = ""serialtxt.Focus()Return

    End If

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

    End If

    If prodqty.Text = "" ThenMsgBox("Please Fill Product Quantity

    Field.....!!!")prodqty.Text = ""prodqty.Focus()Return

    End If

    If proddt.Text = "" ThenMsgBox("Please Select Manufacturing Date

    Field.....!!!")proddt.Text = ""proddt.Focus()Return

    End If

  • 8/7/2019 shop management

    78/99

    If prodprize.Text = "" Then

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

    ReturnEnd 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.Textcmd.Connection = cncn.Open()Dim i As Integer = cmd.ExecuteNonQuerycn.Close()MsgBox("Successfully Added.....!!!" & i)

    Else

    MsgBox("Product Quantity And Prize Should BeNumber Only.....!!!")

    prodprize.Text = ""prodprize.Focus()prodqty.Text = ""prodqty.Focus()Return

    End If

    Catch ex As ExceptionMessageBox.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

  • 8/7/2019 shop management

    79/99

    'DELETESub delete()

    TryDim i As Integer

    cn.Open()Dim str As StringIf prodid.Text = "" Then

    MsgBox("Please Enter Product Id ")Else

    str = "select * from product where prod_id='" &prodid.Text & "'"

    cmd.CommandText = strcmd.Connection = cnoledbdr = cmd.ExecuteReaderprodname.Text = ""serialtxt.Text = ""prodcompcombo.Text = ""prodqty.Text = ""proddt.Text = ""prodprize.Text = ""

    i = 0While oledbdr.Read

    i = i + 1

    End While

    End Ifcn.Close()

    If i = 0 ThenMsgBox("No Record found ")

    Elsecn.Open()cmd.CommandText = " delete from product where

    prod_id='" & prodid.Text & " '"cmd.CommandType = CommandType.Textcmd.Connection = cnDim ii As Integer = cmd.ExecuteNonQuerycn.Close()MsgBox("Successfully Record Deleted:- " & ii)

    End IfCatch ex As Exception

  • 8/7/2019 shop management

    80/99

    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

    'SEARCHSub search()

    cn.Open()Dim str As StringIf prodid.Text = "" Then

    MsgBox("Please Enter Customer Id ")Else

    str = "select * from product where prod_id='" &prodid.Text & "' "

    cmd.CommandText = strcmd.Connection = cnoledbdr = cmd.ExecuteReaderprodid.Text = ""prodname.Text = ""serialtxt.Text = ""prodcompcombo.Text = ""prodqty.Text = ""proddt.Text = ""prodprize.Text = ""

    Dim i As Stringi = 0While 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

  • 8/7/2019 shop management

    81/99

    End WhileIf i = 0 Then

    MsgBox("No Record found ")

    ElseEnd If

    End Ifcn.Close()

    End Sub

    'SELECTSub select1()

    Tryprodid.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 theSEARCH button")

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

    prodprize.Text = ""

    End Tryprodid.Enabled = Falseprodname.Enabled = Falseserialtxt.Enabled = Falseprodcompcombo.Enabled = False

  • 8/7/2019 shop management

    82/99

    prodqty.Enabled = Falseproddt.Enabled = Falseprodprize.Enabled = False

    End Sub

    End Class

    9. Purchase Form

    Public Class purchaseDim cmd As New OleDb.OleDbCommandDim cn As New OleDb.OleDbConnectionDim oledbdr As OleDb.OleDbDataReaderDim da As New OleDb.OleDbDataAdapter

    Dim ds As New DataSetDim sum As Double

    Private Sub newradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesnewradio.CheckedChanged

    transtxt.Items.Clear()transtxt.Enabled = FalseDim 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 = Trueitemidtxt.Enabled = Trueavqty.Enabled = Truermqty.Enabled = Trueitemnamecombo.Enabled = Trueitemratetxt.Enabled = Trueitemdisccombo.Enabled = Truetotalprizetxt.Enabled = Trueitemcompcombo.Enabled = Trueitemqtytxt.Enabled = Trueitemserialcombo.Enabled = Trueshowbtn.Enabled = Falseaddbtn.Enabled = Truemorebtn.Enabled = Truegobillbtn.Enabled = True

  • 8/7/2019 shop management

    83/99

    End Sub

    Private Sub prevradio_CheckedChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles

    prevradio.CheckedChangedtranstxt.Enabled = Truetranstxt.Enabled = Truetranstxt.Text = ""showbtn.Enabled = Trueaddbtn.Enabled = Falsemorebtn.Enabled = Falsegobillbtn.Enabled = True

    Trycn.Open()

    Dim str As String

    str = "select distinct trans_id from bill wherecust_id='" & custidtxt.Text & "' AND cust_name='" &custnametxt.Text & "' "

    ' MsgBox(str)cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReadertranstxt.Items.Clear()While oledbdr.Read()

    transtxt.Items.Add(oledbdr("trans_id"))End While

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Trycn.Close()

    End Sub

    Private Sub addbtn_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles addbtn.Click

    If itemnamecombo.Text = "" ThenMsgBox("Please Select Item NAME Field.....!!!!")itemnamecombo.Text = ""

  • 8/7/2019 shop management

    84/99

    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 = "" ThenMsgBox("Please Select The Serial No. Field....!!!!

    ")itemserialcombo.Text = ""itemserialcombo.Focus()Return

    End If

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

    End If

    Try

    If IsNumeric(itemqtytxt.Text) Thencn.Open()Dim str As Stringstr = "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 = strcmd.CommandType = CommandType.Textcmd.Connection = cn

    Dim i As Integer = cmd.ExecuteNonQuerycn.Close()

  • 8/7/2019 shop management

    85/99

  • 8/7/2019 shop management

    86/99

  • 8/7/2019 shop management

    87/99

    Private Sub Orderselection_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    dt1txt.Text = System.DateTimeOffset.Now.Date

    cn = NewOleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Documents and Settings\darshana\Desktop\pro\Shop\shopproject\shopdatabase.mdb")

    transtxt.Enabled = False

    Trycn.Open()Dim str As Stringstr = "select * from customer"cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReadercustidtxt.Text = ""custnametxt.Text = ""While oledbdr.Read

    custidtxt.Items.Add(oledbdr("cust_id"))custnametxt.Items.Add(oledbdr("cust_name"))

    End WhileCatch ex As Exception

    MessageBox.Show(ex.Message)End Trycn.Close()

    Trycn.Open()

    Dim str As Stringstr = "select distinct prod_name from product"cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read

    itemnamecombo.Items.Add(oledbdr("prod_name"))

  • 8/7/2019 shop management

    88/99

    End WhileCatch ex As Exception

    MessageBox.Show(ex.Message)End Trycn.Close()

    End SubPrivate Sub itemnamecombo_SelectedIndexChanged(ByVal sender

    As System.Object, ByVal e As System.EventArgs) Handlesitemnamecombo.SelectedIndexChanged

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

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

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

    Trycn.Open()Dim str As Stringstr = "select distinct prod_comp from product where

    prod_name='" & itemnamecombo.Text & "'"cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read

    itemcompcombo.Items.Add(oledbdr("prod_comp"))End While

    Catch ex As ExceptionMessageBox.Show(ex.Message)

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

  • 8/7/2019 shop management

    89/99

    End Sub

    Private Sub itemcompcombo_SelectedIndexChanged(ByVal senderAs System.Object, ByVal e As System.EventArgs) Handles

    itemcompcombo.SelectedIndexChangeditemserialcombo.Text = ""itemserialcombo.Items.Clear()Try

    cn.Open()Dim str As Stringstr = "select distinct serial_no from product where

    prod_comp='" & itemcompcombo.Text & "' and prod_name='" &itemnamecombo.Text & "'"

    'MsgBox(str)cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read

    itemserialcombo.Items.Add(oledbdr("serial_no"))End While

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Tryoledbdr.Close()cn.Close()

    End Sub

    Private Sub itemserialcombo_SelectedIndexChanged(ByValsender As System.Object, ByVal e As System.EventArgs) Handlesitemserialcombo.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 = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read

  • 8/7/2019 shop management

    90/99

    itemidtxt.Text = oledbdr("prod_id")itemratetxt.Text = oledbdr("prod_prize")avqty.Text = oledbdr("prod_qty")

    End WhileCatch ex As Exception

    MessageBox.Show(ex.Message)End Trycn.Close()

    End Sub

    Private Sub itemqtytxt_TextChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlesitemqtytxt.TextChanged

    Dim min As Doublemin = Val(avqty.Text) - Val(itemqtytxt.Text)rmqty.Text = minIf Val(rmqty.Text) < 0 Then

    MsgBox("Stock is Less Than U Required Plz Report To'Admin' ")

    itemqtytxt.Text = ""itemqtytxt.Focus()

    End IfDim a As Integer = Val(itemqtytxt.Text) *

    Val(itemratetxt.Text)totalprizetxt.Text = a - (a * Val(itemdisccombo.Text) /

    100)End Sub

    Private Sub itemdisccombo_SelectedIndexChanged(ByVal senderAs System.Object, ByVal e As System.EventArgs) Handlesitemdisccombo.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 AsSystem.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub custidtxt_TextChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs)

    End Sub

  • 8/7/2019 shop management

    91/99

    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 = Trueitemidtxt.Enabled = Trueitemcompcombo.Enabled = Trueitemqtytxt.Enabled = Trueitemserialcombo.Enabled = Trueavqty.Enabled = Truermqty.Enabled = Trueitemnamecombo.Enabled = Trueitemratetxt.Enabled = Trueitemdisccombo.Enabled = Truetotalprizetxt.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 finalbillwhere trancid='" & transtxt.Text & "' ", cn)

    ds = New DataSet()da.Fill(ds)

    bill.DataGridView1.DataSource = ds.Tables(0)bill.DataGridView1.Refresh()bill.Show()

    newradio.Checked = Falseprevradio.Checked = False

  • 8/7/2019 shop management

    92/99

  • 8/7/2019 shop management

    93/99

    bill.Show()

    'bill.dttxt.Text

    Try

    cn.Open()Dim str As Stringstr = "select date from bill where trans_id='" &

    transtxt.Text & "' "cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReaderWhile oledbdr.Read()

    bill.dttxt.Text = oledbdr("date")

    End WhileCatch ex As Exception

    MessageBox.Show(ex.Message)

    End Trycn.Close()'bill.grtotaltxt.Text = grtotal.Text

    End Sub

    Private Sub custidtxt_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlescustidtxt.SelectedIndexChanged

    Trycn.Open()Dim str As Stringstr = "select cust_name from customer where

    cust_id='" & custidtxt.Text & "'"cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cn

    oledbdr = cmd.ExecuteReadercustnametxt.Text = ""While oledbdr.Read

    custnametxt.SelectedText = oledbdr("cust_name")End While

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Try

  • 8/7/2019 shop management

    94/99

    cn.Close()

    If custidtxt.Text = "" ThenMsgBox("please Enter the Customer ID")custidtxt.Text = ""

    custidtxt.Focus()newradio.Enabled = Falseprevradio.Enabled = False

    Elsenewradio.Checked = Truenewradio.Enabled = Trueprevradio.Enabled = Truecustnametxt.Enabled = False

    End If

    sum = 0

    End Sub

    Private Sub custnametxt_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handlescustnametxt.SelectedIndexChanged

    Trycn.Open()Dim str As Stringstr = "select cust_id from customer where

    cust_name='" & custnametxt.Text & "'"cmd.CommandText = strcmd.CommandType = CommandType.Textcmd.Connection = cnoledbdr = cmd.ExecuteReadercustidtxt.Text = ""While oledbdr.Read

    custidtxt.SelectedText = oledbdr("cust_id")End While

    Catch ex As ExceptionMessageBox.Show(ex.Message)

    End Try

    cn.Close()

    If custnametxt.Text = "" ThenMsgBox("please Enter the Customer Name")

  • 8/7/2019 shop management

    95/99

    custidtxt.Text = ""custidtxt.Focus()newradio.Enabled = Falseprevradio.Enabled = False

    Else

    newradio.Checked = Truenewradio.Enabled = Trueprevradio.Enabled = Truecustidtxt.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 = Falseprevradio.Checked = Falsecustidtxt.Text = ""custnametxt.Text = ""custnametxt.Enabled = Truetranstxt.Text = ""custidtxt.Enabled = True

    itemserialcombo.Enabled = Falseitemidtxt.Enabled = Falseavqty.Enabled = Falsermqty.Enabled = Falseitemnamecombo.Enabled = Falseitemratetxt.Enabled = Falseitemdisccombo.Enabled = Falsetotalprizetxt.Enabled = Falseitemcompcombo.Enabled = Falseitemqtytxt.Enabled = Falseshowbtn.Enabled = Falseaddbtn.Enabled = False

    morebtn.Enabled = Falsegobillbtn.Enabled = Falsenewradio.Enabled = Falseprevradio.Enabled = False

    End SubEnd Class

  • 8/7/2019 shop management

    96/99

    Reports

    1. Customer Report

  • 8/7/2019 shop management

    97/99

  • 8/7/2019 shop management

    98/99

    2. Transaction Report

  • 8/7/2019 shop management

    99/99

    3 Bill Report