Top Banner

of 66

Prjt Report

Apr 07, 2018

Download

Documents

Achu Vinayan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/4/2019 Prjt Report

    1/66

    1. INTRODUCTION:

    This project, GAS AGENCY, include supplying of gas to various customers, to maintain the reorderlevel of the gas cylinders, and to standardize theprice of the gas cylinders.

    To get a cylinder the customer must beregistered with the gas agency. The details of thevarious customers are maintained. The cylindertype could be commercial or domestic. Thetransactions carried out by the agency are also

    recorded. The stock that is available with the gasagency is also recorded, if any defects found incommercial or domestic are also recorded andreturned.

    A master price list also maintained. This showsthe different price for the commercial and domesticcylinders.

    There are various reports have been generatedsuch as customer report, daily report, weeklyreport, date wise report and stock report.

    This project has automated the operations of agas agency completely.

    1

  • 8/4/2019 Prjt Report

    2/66

    2. SYSTEM ENVIRONMENT:

    a). HARDWARE ENVIRONMENT.

    b). SOFTWARE ENVIRONMENT.

    2

  • 8/4/2019 Prjt Report

    3/66

    a). HARDWARE ENVIRONMENT:

    Processor : PIII800MHzPROCESSOR

    RAM : 256 MB

    Hard Disk : 20.4 GB

    Floppy Drive : 1.44 MB

    Key Board : 104 Keys

    3

  • 8/4/2019 Prjt Report

    4/66

    b).SOFTWARE ENVIRONMENT:

    Operating System : WINDOWS ME

    Front End : Visual Basic 6.0

    Back End : MS-ACCESS 7.0

    4

  • 8/4/2019 Prjt Report

    5/66

    LANGUAGE DESCRIPTION

    a). About Visual Basic Language

    Visual Basic was developed from the BASICprogramminglanguage. In 1970s Microsoft got its start bydeveloping ROM based interpreted Basic for theearly microprocessor based computer. In1982,Microsoft QuickBasic revolutionized Basicand legitimized as a serious developmentlanguage for MS-DOS environment. Later on,Microsoft Corporation created the enhanced

    version of BASIC called Visual Basic for Windows.Visual Basic 6.0 :

    Visual Basic 6.0 allows creating ObjectOriented Application. When Visual Basic originallydeveloped, it allowed to the programmer to createprograms using pre-defined objects, forms andcontrols. It uses some of the Windows 95 Controls.Visual Basic 6.0 can be used to develop bothstandalone systems and Client Server Basedsystems.

    Visual Basic 6.0 comes in three categories

    Standard Edition

    5

  • 8/4/2019 Prjt Report

    6/66

    Professional Edition Enterprise Edition

    Features of Visual Basic 6.0:-

    Visual Basic 6.0 profoundly concentrates onthe Internet development features, ActiveXtechnology, enhanced controls, and enhancedfeatures of existing control, client/server, and newlanguage features development.

    Native Code:-

    A Visual Basic project is compiled to nativecode for faster execution. Profiles native codeusing new native code compiler option, and debugnative code using the Visual C++ environment.

    Wizards:-

    The application Wizard is new and the Setup

    Wizard has been enhanced to enable creating adependency file for a standard project. In theprofessional Edition, the Active X control InterfaceWizard, Active X Document Migration Wizard, DataForm Wizard, and property page Wizard are new.The Setup Wizard has been enhanced to supportdistribution via the Internet. The installation of

    6

  • 8/4/2019 Prjt Report

    7/66

    remote server components using Distributed COM(DCOM) and Remote Automation is an addedfeature. The ability to create dependency files forprojects and components created with Visual Basic.

    Extensibility Model:-

    The new model allows to programmaticallyextending the development environment andcontrol projects, events, code, and Visual elements.

    Declare, Raise, and Handle Events:-

    Objects provided by the components can raiseevents that can be handled in other applications, orby our objects, using with Events variables, Eventsprovide a simple alternative to asynchronouscallbacks.

    Create Active X document:

    ActiveX document s can be created that booststhe Visual Basic application to the Internet BrowserWindows. The data control, DAO or MicrosoftAccess, you can create that is virtually databaseindependent, because jet automatically performsall syntax and data manipulation translations.

    7

  • 8/4/2019 Prjt Report

    8/66

    b). MS-Access:

    When we create a Microsoft Access database,we create one file that contains the data and tablestructures as well as the queries, forms, reportsand other objects that make up the database.

    Protecting information can be an importantpart of developing a Microsoft Access database. Bysecuring your database, you can control what auser, is a group of users, can do with databaseobjects. Microsoft Access security made up of several pieces that must be in place before securityis account information with the work group and

    8

  • 8/4/2019 Prjt Report

    9/66

    permissions assignment in the database (.mdb) fileMicrosoft Access Version 7 system databaseincludes several internal security enhancements.

    Encrypting a database makes it indecipherableby a utility program or word processor. Encryptinga database compacts the database file and makes itindecipherable by a utility program or wordprocessor. Decrypting a database reverses itindecipherable in order to protect it fromunauthorized viewing or use.

    3. SYSTEM ANALYSIS:

    a). System Definition

    This operations of a gas agency has to beautomated completely.

    9

  • 8/4/2019 Prjt Report

    10/66

    This project, GAS AGENCY, include supplying of gas to various customers, to maintain the reorderlevel of the gas cylinders, and to standardize theprice of the gas cylinders.

    To get a cylinder the customer must beregistered with the gas agency. The details of thevarious customers are maintained. The cylindertype could be commercial or domestic. Thetransactions carried out by the agency are alsorecorded. The stock that is available with the gasagency is also recorded, if any defects found in

    commercial or domestic are also recorded andreturned.

    A master price list also maintained. This showsthe different price for the commercial and domesticcylinders.

    There are various reports have been generatedsuch as customer report, daily report, weeklyreport, date wise report and stock report.

    b). Existing System:

    The operations in the gas agency were done bymanually. There were lots of problems to maintainthe operations manually. When they wantedproduce the reports like billing, daily transactions itwas very difficult to tackle the situations. Thenthey decided to automate their operation.

    10

  • 8/4/2019 Prjt Report

    11/66

    c). Proposed System.

    The system automates the operations of a gasagency. The system was designed in such a waythat it is useful to any gas agency rather than for aparticular agency.

    This system would maintain the customer and stock details. Acustomer must be registered with the gas agency in order to get the gascylinder. All the details of the customer are maintained in the database.

    The cylinder type could be commercial or domestic. The transactionscarried out by the agency are also recorded. The stock that is availablewith the gas agency is also recorded, if any defects found in commercialor domestic are also recorded and returned.

    There are various reports generated such ascustomer report, daily report, weekly report, datewise report and stock report.

    11

  • 8/4/2019 Prjt Report

    12/66

    4. SYSTEM DESIGN:

    a).CONTEXT ANALYSIS DIAGRAM

    12

    Purchase goods

    Salegoods

    Gasagenc

    y

  • 8/4/2019 Prjt Report

    13/66

    b). DATAFLOW DIAGRAMS:Entry:

    Cust Mast

    Stock

    13

    vendor

    Stock Entry

    Customer entry

  • 8/4/2019 Prjt Report

    14/66

    Transaction: Cust Mast

    Transaction

    14

    Book

    DeliveryTransaction

  • 8/4/2019 Prjt Report

    15/66

    Stock

    c). DATA BASE DESIGN

    TABLE NAME BILL

    FIELD NAME DATA TYPE DATASIZE

    BILLNO LONG 4CON_NO LONG 4BILL_DATE DATE/TIME 8

    15

    Return

  • 8/4/2019 Prjt Report

    16/66

  • 8/4/2019 Prjt Report

    17/66

    CURR_STOCK_DOMES

    LONG 4

    STOCK_REC_COMM LONG 4

    STOCK_REC_DOMES LONG 4DEFECTS_COMM LONG 4DEFECTS_DOMES LONG 4

    TABLE NAME TRANSACTION

    FIELD NAME DATA TYPE DATASIZE

    CONS_NO LONG 4CYLN_TYPE TEXT 4BOOKING_DATE DATE/TIME 8RELEASED_FLAG TEXT 5RELEASED_DATE DATE/TIME 8NO_CYLN INTEGER 2

    5. SYSTEM IMPLEMENTATION

    17

  • 8/4/2019 Prjt Report

    18/66

    a).About the project:

    To enter into the project, give the correctpassword else it gives the INVALID PASSWORD.

    The main form contains the following menus,MainTransactionReportsExit

    Main menu:

    The main menu having the following items,

    Customer entry.Stock entry.

    Customer entry form allows to add, delete,modify the customer details. In this form one canview the customers, who are registered with theagency.

    Stock entry form allows to enter the stock details, that is the stock received and automaticallyupdated in the database. The form shows thecurrent stock. If the current stock comes at thereorder level, it cannot deliver the goods. Thedefects items also maintained in the database andalso returned.

    Transaction menu:

    It contains the following items,BookingDelivery.Returns.

    18

  • 8/4/2019 Prjt Report

    19/66

    In the booking form, one can book for the gas.If the customer is already booked, it will not allowto book again.

    In the delivery form, the releasing date ischecked with the database. If the releasing date ismatches with the current date as well as releasedflag, then delivery is possible and released flag ismade as yes.

    In the returns menu, the defective items are

    returned and parallel reduction in the database.

    Report menu:

    This menu contains the following items,Customer report.Daily transaction report.Date wise report.Weekly report.Stock report.

    In the customer report, it will produce all thedetails of the customer.

    In the daily transaction report, it produce thebooking and delivered good, on that day and totalis maintained.

    In the date wise report, the report is producedwith particular date. Weekly report produces theweekly transactions and stock report produces thetotal stocks available.

    19

  • 8/4/2019 Prjt Report

    20/66

    b). Coding:

    Main menu:Private Sub book_Click()Form4.ShowEnd Sub

    Private Sub cr_Click()DataReport1.ShowEnd Sub

    Private Sub cust_Click()

    Form2.ShowEnd Sub

    Private Sub dat_Click()Form9.ShowEnd Sub

    Private Sub day_Click()Form8.Show

    End SubPrivate Sub deli_Click()Form5.ShowEnd Sub

    Private Sub exit_Click()

    20

  • 8/4/2019 Prjt Report

    21/66

  • 8/4/2019 Prjt Report

    22/66

    EndEnd Sub

    Private Sub Timer1_Timer()i = i - 20Label4.Move iIf (i < -4390) Then i = 9850Label6.Caption = Time$Label8.Caption = Format(Date$, "dd/mm/yy")End Sub

    Private Sub txtpas_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    SendKeys "{TAB}"End If End Sub

    Customer Entry :

    Dim db As Database, rs, rs1 As RecordsetDim custno As Integer

    Private Sub Command1_Click()clearText1.Visible = TrueText2.Visible = TrueText3.Visible = TrueText4.Visible = TrueText5.Visible = TrueText6.Visible = TrueText7.Visible = TrueIf rs.RecordCount = 0 Then

    custno = 1000Text1.Text = custno

    Elsers.MoveLastcustno = rs(0) + 1Text1.Text = custno

    End If Text2.SetFocusText6.Text = Format(Date$, "dd/mm/yyyy")disabCommand4.Enabled = True

    22

  • 8/4/2019 Prjt Report

    23/66

    rs.AddNewEnd Sub

    Private Sub Command10_Click()rs.MoveLastloadEnd Sub

    Private Sub Command11_Click()rs.MovePreviousIf rs.BOF = True Then

    MsgBox "THIS IS THE FIRST RECORD"rs.MoveFirst

    Else

    loadEnd If End Sub

    Private Sub Command2_Click()storers.UpdateMsgBox "RECORD HAS BEEN SAVED"clearCommand1.Enabled = Trueenab

    Command4.Enabled = FalseCommand2.Enabled = FalseSet rs = db.OpenRecordset("CUSTMAST")Text1.Visible = FalseText2.Visible = FalseText3.Visible = FalseText4.Visible = FalseText5.Visible = FalseText6.Visible = FalseText7.Visible = FalseEnd Sub

    Private Sub Command3_Click()Unload MeMDIForm1.Enabled = TrueEnd Sub

    Private Sub Command4_Click()If Text1.Text " " Then

    23

  • 8/4/2019 Prjt Report

    24/66

    clearCommand1.Enabled = Trueenab

    Command2.Enabled = FalseEnd If Text1.Visible = FalseText2.Visible = FalseText3.Visible = FalseText4.Visible = FalseText5.Visible = FalseText6.Visible = FalseText7.Visible = FalseEnd Sub

    Private Sub Command5_Click()cno = InputBox("ENTER THE CUNSUMER NUMBER")Set rs = db.OpenRecordset("select * from CUSTMAST whereCons_no=" & cno)If rs.RecordCount = 0 Then

    MsgBox "INVALID CONSUMER NUMBER"Else

    loadText2.SetFocusCommand2.Enabled = TrueCommand4.Enabled = True

    rs.EditEnd If End Sub

    Private Sub Command6_Click()clearcno = InputBox("ENTER THE CONSUMER NUMBER TODELETE")If (cno = True) Then

    Set rs = db.OpenRecordset("select * from CUSTMASTwhere Cons_no=" & cno)

    ElseGoTo ABC

    End If If rs.RecordCount = 0 Then

    MsgBox "INVALID CONSUMER NUMBER"Else

    rs.DeleteMsgBox "THE RECORD HAS BEEN DELETED"

    24

  • 8/4/2019 Prjt Report

    25/66

    clearEnd If ABC:

    Set rs = db.OpenRecordset("CUSTMAST")End Sub

    Private Sub Command8_Click()

    If rs.RecordCount = 0 ThenMsgBox "NO RECORDS IN THE TABLE"

    Elsers.MoveFirstIf rs.EOF = True Then

    MsgBox "NO MORE RECORDS IN THE TABLE"

    ElseloadEnd If

    End If Text1.Visible = TrueText2.Visible = TrueText3.Visible = TrueText4.Visible = TrueText5.Visible = TrueText6.Visible = TrueText7.Visible = True

    End Sub

    Private Sub Command9_Click()rs.MoveNextIf rs.EOF = True Then

    MsgBox "NO MORE RECORDS IN THE TABLE"rs.MoveLast

    Elseload

    End If

    End Sub

    Private Sub Form_Load()Set db = OpenDatabase("c:\program files\microsoft visualstudio\Vb98\gasagency.mdb")Set rs = db.OpenRecordset("CUSTMAST")Text1.Visible = FalseText2.Visible = False

    25

  • 8/4/2019 Prjt Report

    26/66

    Text3.Visible = FalseText4.Visible = FalseText5.Visible = False

    Text6.Visible = FalseText7.Visible = FalseIf rs.RecordCount = 0 Then

    disabEnd If Command2.Enabled = FalseEnd Sub

    Public Sub clear()Text1.Text = " "Text2.Text = " "

    Text3.Text = " "Text4.Text = " "Text5.Text = " "Text6.Text = " "Text7.Text = " "End Sub

    Public Sub store()rs(0) = Text1.Textrs(1) = Text2.Textrs(2) = Text3.Text

    rs(3) = val(Text4.Text)rs(4) = val(Text5.Text)rs(5) = Format(Date$, "dd/mm/yyyy")rs(6) = Text7.TextEnd Sub

    Private Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    SendKeys "{TAB}"End If

    End Sub

    Private Sub Text4_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    If Text4.Text = " " ThenMsgBox "ENTER SOME DATA"Text4.SetFocus

    ElseIf (val(Text4.Text) = 0) Then

    26

  • 8/4/2019 Prjt Report

    27/66

    MsgBox "ENTER INTEGER VALUE"Text4.Text = " "Text4.SetFocus

    ElseIf Text4.Text > 999999 ThenMsgBox "ENTER 6 DIGIT CODE ONLY"Text4.Text = " "Text4.SetFocus

    ElseIf Text4.Text < 100000 ThenMsgBox "ENTER 6 DIGIT CODE"Text4.Text = " "Text4.SetFocus

    ElseSendKeys "{TAB}"

    End If

    End If End Sub

    Private Sub Text4_LostFocus()If Text4.Text = " " Then

    MsgBox "ENTER SOME DATA"Text4.SetFocus

    ElseIf (val(Text4.Text) = 0) ThenMsgBox "ENTER INTEGER VALUE"Text4.Text = " "Text4.SetFocus

    ElseIf Text4.Text > 999999 ThenMsgBox "ENTER 6 DIGIT CODE ONLY"Text4.Text = " "Text4.SetFocus

    ElseIf Text4.Text < 100000 ThenMsgBox "ENTER 6 DIGIT CODE"Text4.Text = " "Text4.SetFocus

    ElseText5.SetFocus

    End If

    End Sub

    Private Sub Text5_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    If Text5.Text = " " ThenMsgBox "ENTER SOME DATA"Text5.SetFocus

    ElseIf (val(Text5.Text) = 0) Then

    27

  • 8/4/2019 Prjt Report

    28/66

    MsgBox "ENTER INTEGER VALUE"Text5.Text = " "Text5.SetFocus

    ElseIf Text5.Text > 9999999 ThenMsgBox "ENTER 7 DIGIT NUMBER ONLY"Text5.Text = " "Text5.SetFocus

    ElseIf Text5.Text < 1000000 ThenMsgBox "ENTER 7 DIGIT NUMBER"Text5.Text = " "Text5.SetFocus

    ElseSendKeys "{TAB}"

    End If

    End If End Sub

    Private Sub Text7_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    SendKeys "{TAB}"End If End Sub

    Private Sub Text7_LostFocus()Dim cyl As String

    cyl = Text7.TextSelect Case cylCase "c" To "d"

    Text7.Text = cylCommand2.Enabled = TrueCommand2.SetFocus

    Case "C" To "D"Text7.Text = cylCommand2.Enabled = TrueCommand2.SetFocus

    Case Else

    MsgBox "INVALID CYLINDER TYPE"Text7.Text = ""Text7.SetFocus

    End SelectIf (val(Text5.Text) = 0) Then

    MsgBox "ENTER PHONE NUMBER AS INTEGER VALUE"Text5.Text = " "Text5.SetFocus

    28

  • 8/4/2019 Prjt Report

    29/66

    ElseIf Text5.Text > 9999999 ThenMsgBox "7 DIGIT PHONE NUMBER ONLY"Text5.Text = " "

    Text5.SetFocusElseIf Text5.Text < 1000000 ThenMsgBox "7 DIGIT PHONE NUMBER"Text5.Text = " "Text5.SetFocus

    End If End Sub

    Private Sub Timer1_Timer()Label4.Caption = Time$Label2.Caption = Format(Date$, "dd/mm/yyyy")

    End Sub

    Public Sub load()Text1.Text = rs(0)Text2.Text = rs(1)Text3.Text = rs(2)Text4.Text = rs(3)Text5.Text = rs(4)Text6.Text = rs(5)Text7.Text = rs(6)End Sub

    Public Sub enab()Command2.Enabled = TrueCommand4.Enabled = TrueCommand5.Enabled = TrueCommand6.Enabled = TrueCommand8.Enabled = TrueCommand9.Enabled = TrueCommand10.Enabled = TrueCommand11.Enabled = TrueEnd Sub

    Public Sub disab()Command2.Enabled = FalseCommand4.Enabled = FalseCommand5.Enabled = FalseCommand6.Enabled = FalseCommand8.Enabled = FalseCommand9.Enabled = False

    29

  • 8/4/2019 Prjt Report

    30/66

    Command10.Enabled = FalseCommand11.Enabled = FalseEnd Sub

    Stock Entry:

    Dim db As Database, rs As RecordsetDim ccomst, cdomst As Long

    Private Sub Command1_Click()Text3.Visible = FalseText4.Visible = FalseText5.Visible = FalseText6.Visible = FalseCommand4.Enabled = TrueCommand1.Enabled = FalseCommand4.SetFocusEnd Sub

    Private Sub Command2_Click()Text1.Text = rs(0) + val(Text3.Text) - val(Text5.Text)Text2.Text = rs(1) + val(Text4.Text) - val(Text6.Text)storers.UpdateMsgBox "RECORD HAS BEEN SAVED"clearCommand4.Enabled = TrueCommand2.Enabled = FalseCommand1.Enabled = FalseText3.Visible = FalseText4.Visible = FalseText5.Visible = FalseText6.Visible = FalseEnd Sub

    Private Sub Command3_Click()MDIForm1.Enabled = TrueUnload MeEnd Sub

    Private Sub Command4_Click()Text3.Visible = TrueText4.Visible = True

    30

  • 8/4/2019 Prjt Report

    31/66

    Text5.Visible = TrueText6.Visible = TrueIf rs.RecordCount = 0 Then

    rs.AddNewElsers.Editclear

    End If Text3.SetFocusCommand4.Enabled = FalseCommand1.Enabled = TrueEnd Sub

    Private Sub Form_Load()

    Set db = OpenDatabase("c:\program files\microsoft visualstudio\VB98\gasagency.mdb")Set rs = db.OpenRecordset("select * from STOCK")If rs.RecordCount 0 Then

    rs.MoveLastText1.Text = rs(0)Text2.Text = rs(1)

    ElseclearText1.Text = 0Text2.Text = 0

    End If Text3.Visible = FalseText4.Visible = FalseText5.Visible = FalseText6.Visible = FalseCommand1.Enabled = FalseCommand2.Enabled = FalseEnd Sub

    Public Sub clear()Text3.Text = " "

    Text4.Text = " "Text5.Text = " "Text6.Text = " "End Sub

    Public Sub store()rs(0) = Text1.Textrs(1) = Text2.Text

    31

  • 8/4/2019 Prjt Report

    32/66

    rs(2) = Text3.Textrs(3) = Text4.Textrs(4) = Text5.Text

    rs(5) = Text6.TextEnd Sub

    Private Sub Label10_Click()

    End Sub

    Private Sub Text3_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If

    End Sub

    Private Sub Text4_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If End Sub

    Private Sub Text5_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"

    End If

    End Sub

    Private Sub Text6_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If End Sub

    Private Sub Text6_LostFocus()

    If (val(Text1.Text) + val(Text3.Text)) < val(Text5.Text) ThenMsgBox "DEFECTS MORE THAN STOCK"Text5.Text = " "Text6.Text = " "Text5.SetFocus

    End If Command1.Enabled = TrueCommand2.Enabled = True

    32

  • 8/4/2019 Prjt Report

    33/66

    End Sub

    Private Sub Timer1_Timer()

    Label18.Caption = Time$Label2.Caption = Format(Date$, "dd/mm/yyyy")End Sub

    Booking:

    Dim db As Database, rs, rs1 As Recordset

    Private Sub Command1_Click()clearCommand1.Enabled = False

    Command4.Enabled = TrueCommand4.SetFocusText1.Visible = FalseText2.Visible = FalseEnd Sub

    Private Sub Command2_Click()Dim FLAG As IntegerFLAG = MsgBox("BOOKING ORDER?", vbOKCancel)If FLAG = 1 Then

    If rs1.RecordCount 0 Thenrs1.Editstorers1.Updateclear

    Elsers1.AddNewstorers1.Updateclear

    End If Else

    clearEnd If Command2.Enabled = FalseCommand1.Enabled = FalseCommand4.Enabled = TrueEnd Sub

    Private Sub Command3_Click()

    33

  • 8/4/2019 Prjt Report

    34/66

    Unload MeEnd Sub

    Public Sub clear()Text1.Text = " "Label9.Caption = " "Label10.Caption = " "Label12.Caption = " "Label13.Caption = " "Label16.Caption = " "Text2.Text = " "End Sub

    Private Sub Command4_Click()

    Text1.Visible = TrueclearText1.SetFocusCommand4.Enabled = FalseCommand1.Enabled = TrueEnd Sub

    Private Sub Form_Load()Set db = OpenDatabase("c:\program files\microsoft visualstudio\Vb98\gasagency.mdb")Set rs = db.OpenRecordset("CUSTMAST")

    Set rs1 = db.OpenRecordset("TRANSACTION")Command2.Enabled = FalseCommand1.Enabled = FalseText1.Visible = FalseText2.Visible = FalseEnd Sub

    Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    SendKeys "{TAB}"End If

    End Sub

    Private Sub Text1_LostFocus()Set rs = db.OpenRecordset("select * from CUSTMAST wherecons_no=" & val(Text1.Text))Set rs1 = db.OpenRecordset("select * from TRANSACTIONwhere cons_no=" & val(Text1.Text))If Text1.Text = " " Then

    34

  • 8/4/2019 Prjt Report

    35/66

    GoTo ABCEnd If If rs.RecordCount = 0 Then

    MsgBox "CUSTOMER NUMBER DOESNOT EXISTS"clearCommand4.Enabled = TrueCommand1.Enabled = FalseCommand2.Enabled = FalseText1.Visible = FalseCommand4.SetFocusGoTo ABC

    End If

    If rs1.RecordCount 0 Then

    If rs1(3) = "n" ThenMsgBox "ALREADY BOOKED,CANNOT BOOK AGAIN"clearCommand4.Enabled = TrueCommand1.Enabled = FalseCommand2.Enabled = FalseCommand4.SetFocus

    Text1.Visible = FalseText2.Visible = False

    ElseIf (DateDiff("d", Date, rs1(4)) 0) ThenLabel9.Caption = rs(1)

    Label10.Caption = rs(2)Label12.Caption = rs(3)Label13.Caption = rs(4)Label16.Caption = rs(6)Text2.Visible = TrueText2.SetFocusElse

    MsgBox "cannot book today"Command4.Enabled = True

    Command1.Enabled = FalseCommand2.Enabled = False

    Command4.SetFocusText1.Visible = False

    Text2.Visible = FalseEnd If

    ElseLabel9.Caption = rs(1)Label10.Caption = rs(2)Label12.Caption = rs(3)

    35

  • 8/4/2019 Prjt Report

    36/66

    Label13.Caption = rs(4)Label16.Caption = rs(6)Text2.Visible = True

    Text2.SetFocusEnd If ABC:End Sub

    Private Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If End Sub

    Private Sub Text2_LostFocus()Dim FLAG As BooleanFLAG = FalseIf Text2.Text = " " Then

    a = MsgBox("ENTER NO.OF CYLINDERS", vbYesNo)If a = 6 Then

    Text2.SetFocusElse

    clearCommand1.Enabled = FalseCommand4.Enabled = True

    Command4.SetFocusText1.Visible = FalseText2.Visible = FalseGoTo ABC

    End If Command2.Enabled = False

    End If If Label16.Caption = "c" ThenIf val(Text2.Text) >= 5 Then

    MsgBox "MORE THAN 4 CYLINDER NOT POSSIBLE"Text2.Text = " "

    Text2.SetFocusCommand2.Enabled = FalseFLAG = True

    End If End If If Label16.Caption = "d" Then

    If val(Text2.Text) > 2 ThenMsgBox "MORE THAN 2 CYLINDER NOT POSSIBLE"

    36

  • 8/4/2019 Prjt Report

    37/66

    Text2.Text = " "Text2.SetFocusCommand2.Enabled = False

    FLAG = TrueEnd If End If If FLAG = False Then

    Command2.Enabled = TrueEnd If ABC:End Sub

    Public Sub store()rs1(0) = val(Text1.Text)

    rs1(1) = rs(6)rs1(2) = Date$rs1(3) = "n"rs1(4) = DateAdd("d", 15, rs1(2))rs1(5) = val(Text2.Text)End Sub

    Delivery:

    Dim db As Database, rs, rs1 As RecordsetDim val As Integer

    Private Sub ext_Click()MDIForm1.Enabled = TrueUnload MeEnd Sub

    Private Sub Form_Load()Set db = OpenDatabase("c:\program files\microsoft visualstudio\Vb98\gasagency.mdb")Set rs = db.OpenRecordset("TRANSACTION")If rs.RecordCount 0 Then

    On Error GoTo ars.MoveFirstDo While Not (rs.EOF = True)

    If (DateDiff("d", Date, rs(4))

  • 8/4/2019 Prjt Report

    38/66

    GoTo cEnd If

    Else

    c: rs.MoveNextEnd If

    LoopEnd If a:End Sub

    Private Sub prn_Click()Form6.ShowEnd Sub

    Private Sub Timer1_Timer()Label5.Caption = Time$Label6.Caption = Date$End Sub

    Billing:

    Dim db As Database, rs, rs1, rs2, rs3, rs4 As RecordsetDim k As Integer

    Private Sub Command1_Click()Dim FLAG As Integerrs4.EditIf Label14.Caption = "c" Then

    If rs4(0) < 20 ThenFLAG = MsgBox("RE ORDER COMMERCIAL STOCK,WANT

    TO ADD STOCK?", vbYesNo)If FLAG = 6 Then

    Form3.ShowElseIf FLAG = 7 Then

    GoTo aEnd If

    Elsers4(0) = rs4(0) - val(Label16.Caption)

    End If Else

    If rs4(0) < 20 Then

    38

  • 8/4/2019 Prjt Report

    39/66

    FLAG = MsgBox("RE ORDER DOMESTIC STOCK,WANT TOADD STOCK?", vbYesNo)

    If FLAG = 6 Then

    Form3.ShowElseIf FLAG = 7 ThenGoTo a

    End If Else

    rs4(1) = rs4(1) - val(Label16.Caption)End If

    End If rs4.Updatek = Form5.Combo1.ListIndexForm5.Combo1.RemoveItem (k)

    rs3.AddNewrs3(0) = Label19.Captionrs3(1) = Label11.Captionrs3(2) = Label2.Captionrs3.UpdateSet rs1 = db.OpenRecordset("select * from TRANSACTIONwhere cons_no=" & val(Label11.Caption))rs1.Editrs1(3) = "y"rs1(4) = Date$rs1.Update

    MDIForm1.Enabled = Truea:Unload MeForm5.Visible = False

    End Sub

    Private Sub Command2_Click()Unload MeEnd Sub

    Private Sub Form_Load()

    Set db = OpenDatabase("c:\program files\microsoft visualstudio\Vb98\gasagency.mdb")Set rs2 = db.OpenRecordset("PRICE")Set rs3 = db.OpenRecordset("BILL")Set rs4 = db.OpenRecordset("STOCK")If rs3.RecordCount = 0 Then

    Label19.Caption = 1000Else

    39

  • 8/4/2019 Prjt Report

    40/66

    rs3.MoveLastLabel19.Caption = rs3(0) + 1

    End If

    k = Form5.Combo1.TextSet rs = db.OpenRecordset("select * from CUSTMAST whereCons_no=" & k)Set rs1 = db.OpenRecordset("select * from TRANSACTIONwhere cons_no=" & k)If rs1(3) = "n" Then

    loadElse

    Command1.Enabled = FalseEnd If End Sub

    Private Sub Timer1_Timer()Label5.Caption = Time$Label2.Caption = Date$End Sub

    Public Sub load()Label11.Caption = rs(0)Label12.Caption = rs(1)Label13.Caption = rs(2)

    Label14.Caption = rs(6)Label16.Caption = rs1(5)If rs1(1) = "d" Then

    rs2.MoveFirstLabel17.Caption = rs1(5) * rs2(1)

    Elsers2.MoveLastLabel17.Caption = rs1(5) * rs2(1)

    End If End Sub

    Returns:

    Dim db As Database, rs As Recordset

    Private Sub Command1_Click()rs.Editrs(5) = rs(5) - val(Text1.Text)

    40

  • 8/4/2019 Prjt Report

    41/66

    rs(4) = rs(4) - val(Text2.Text)rs.UpdateMsgBox "GOODS RETURNED"

    clearLabel6.Caption = rs(4)Label5.Caption = rs(5)End Sub

    Private Sub Command2_Click()clearEnd Sub

    Private Sub Command3_Click()Unload Me

    End Sub

    Private Sub Form_Load()Set db = OpenDatabase("c:\program files\microsoft visualstudio\Vb98\gasagency.mdb")Set rs = db.OpenRecordset("STOCK")Label6.Caption = rs(4)Label5.Caption = rs(5)End Sub

    Public Sub clear()

    Text1.Text = " "Text1.SetFocusText2.Text = " "Label5.Caption = " "Label6.Caption = " "End Sub

    Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If

    End Sub

    Private Sub Text2_KeyPress(KeyAscii As Integer)If KeyAscii = 13 ThenSendKeys "{TAB}"End If End Sub

    41

  • 8/4/2019 Prjt Report

    42/66

    Daily report:Private Sub Command1_Click()DataReport3.ShowEnd Sub

    Private Sub Command2_Click()DataReport4.ShowEnd Sub

    Private Sub Command3_Click()Unload MeEnd Sub

    Datewise report:

    Dim a As IntegerPrivate Sub Command1_Click()If IsDate(Text1.Text) = True Then

    DataEnvironment1.rsCommand5.Open ("select * fromtransaction where day(released_date)=" & day(Text1.Text)& " and month(released_date)=" & Month(Text1.Text)),DataEnvironment1.Connection1, adOpenKeyset,adLockOptimistic

    DataReport5.ShowElse

    MsgBox "ENTER VALID DATE"Text1.Text = " "Text1.SetFocus

    End If

    End Sub

    Private Sub Command2_Click()Unload MeEnd Sub

    Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then

    42

  • 8/4/2019 Prjt Report

    43/66

    SendKeys "{TAB}"End If End Sub

    d). SCREENS:

    43

  • 8/4/2019 Prjt Report

    44/66

    44

  • 8/4/2019 Prjt Report

    45/66

    45

  • 8/4/2019 Prjt Report

    46/66

    46

  • 8/4/2019 Prjt Report

    47/66

    47

  • 8/4/2019 Prjt Report

    48/66

    48

  • 8/4/2019 Prjt Report

    49/66

    49

  • 8/4/2019 Prjt Report

    50/66

    50

  • 8/4/2019 Prjt Report

    51/66

    51

  • 8/4/2019 Prjt Report

    52/66

    52

  • 8/4/2019 Prjt Report

    53/66

  • 8/4/2019 Prjt Report

    54/66

    54

  • 8/4/2019 Prjt Report

    55/66

    55

  • 8/4/2019 Prjt Report

    56/66

  • 8/4/2019 Prjt Report

    57/66

    6. SYSTEM TESTING:

    In a software development project, errors canbe injected at any stage during the development.Testing performs a very critical role for quality andfor ensuring the reliability of software. Duringtesting ,the program to be tested is executed withset of test cases ,and the output of the program forthe test cases is evaluated to determine if theprogram is performing as it is expected to. Due toits approach, dynamic testing can only ascertainthe presence of error in the program; the exact

    nature of the error is not usually decided by testing. Testing forms the first step in determining theerrors in the program. Clearly the success of testing in revealing errors in programs dependscritically on the test cases.

    Testing is usually relied upon to detect thefaults that occur during any phase of the softwaredevelopment cycle ,in addition to the faults thatintroduced during the coding phase itself. Forthis ,different levels of testing are used whichperform different tasks and aim to test differentaspects of the system. the basic levels of testingare unit testing ,integration testing ,system andacceptance testing. the different levels of testingattempt to detect different types of faults.

    Client Needs Acceptance Testing

    Requirements System Testing

    57

  • 8/4/2019 Prjt Report

    58/66

    Design Integration Testing

    Code Unit Testing

    Test Plan:

    A Test plan is a general document for the entireproject, which defines the scope approach to be

    taken, and the schedule of testing ,as well asidentifying the test items for the entire testingprocess and the personnel responsible for thedifferent activities of testing commences and canbe done in parallel with the coding and designphases, the inputs for the test plan are,

    Project plan

    Requirements Document

    System Design Document

    The project plan is needed to make sure that thetest is consistent with overall plan for the projectand the testing schedule matches that of theproject plan. The requirements document and thedesign document are the basic document used forselecting the test unit and deciding the approachesto be employed during testing.

    Unit Testing:

    Unit testing is a dynamic method forverification, where the programs is actually

    58

  • 8/4/2019 Prjt Report

    59/66

  • 8/4/2019 Prjt Report

    60/66

  • 8/4/2019 Prjt Report

    61/66

    White Box Testing:

    A white box testing technique id described asfollows:

    Control Structure Testing:

    Conditional testing is a test case designmethod that exercises the logical condition in aprogram module. The possible types of componentsin a condition include a Boolean operator, Booleanvariable, pair of Boolean parenthesis relational

    operator or an arithmetic operator.

    Data Flow Testing:

    Data flow testing method selects test path of program according to the location of definition anduses of variables in the program .they are usefulfor selecting test. They are useful for selecting testpaths of a program containing nested if and loopstatements.

    Loop Testing:

    Loops are the cornerstone for the vast majorityof all algorithm implemented in software looptesting is a white box technique that focusesexclusively on validity of loop construct.

    Black box Testing:

    Black box testing method focuses on thefunctional requirements of the software. black box

    61

  • 8/4/2019 Prjt Report

    62/66

    testing method attempts to find in the followingcategories.

    Incorrect or missing functionsInterface errors.Error in data structure or external databasesaccessPerformance errorsInitialization and termination error

    62

  • 8/4/2019 Prjt Report

    63/66

    7. CONCLUSION:This project, GAS AGENCY, helps a gas agency

    to automate their operations. This provides theoperations of customer entry, stock entry andtransactions such as booking, delivering andreturning the defects goods.

    The project is error free and tested with

    different types of inputs. The project could beeasily modified with the future enhancement, sothat the improvements in their business.

    All the necessary documentation have beendone for the ease of operating system. All themodules tested and put together to form the mainsystem. Thus the application has fulfilled all theobjectives of the gas agency.

    63

  • 8/4/2019 Prjt Report

    64/66

    8. SCOPE FOR ENHANCEMENT:

    This Application is designed to be generic as

    we develop our site we should take advantage of several areas in which you can improve andcustomize business.

    Automatic notification of newly placed ordersto the companys Shipping or processingdepartment. We are trying to include differentkinds of products, which are needed by thecustomer in their day-to-day life, and many morefacilities for the customers.

    Credit card facilities will be including formaking the payment easy for the customer. Servicecharge will be there for credit cards. Addition of aprocedure to verify the users credit cardinformation.

    64

  • 8/4/2019 Prjt Report

    65/66

    9. BIBLIOGRAPHY:

    a) VISUAL BASE VOLUME 1&11 -- S.S.IPRESS

    b) DATA BASE MANAGEMENT SYSTEMS -- KORTH

    c) SYSTEM ANALYSIS AND DESIGN -- JAMESA.SENN

    d) VISUALBASIC 6.0 -- GARY CORNELL

    e) COMPLETE REFERENCE VISUAL BASIC -- KEVLINLONEY

    65

  • 8/4/2019 Prjt Report

    66/66