ice cream parlour

51
CONTENTS S.No . Table of Contents Remarks Page No. I Cover – Page i II Certificate Of Approval ii III Preface iii IV Acknowledgement iv V Declaration v VI Contents vi 1. Index Introduction - Existing System without Software Problem Definition Proposed System 2. Technology Details - Integrated Development Environment Introduction To Visual Basic 6.0 Advantages Of Visual Basic 6.0 About Visual Basic 6.0 IDE Database and Database – Connectivity Introduction To Micro- Soft Access 3. Software Requirement Specification Software Requirements Hardware Requirements 4. System Analysis and Design :- Data Flow Diagram (DFD)/E-R Diagram ( 1 )

Upload: professormanoj

Post on 29-Oct-2015

831 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Ice Cream Parlour

CONTENTS

S.No. Table of Contents Remarks Page No.

I Cover – Page iII Certificate Of Approval iiIII Preface iiiIV Acknowledgement ivV Declaration vVI Contents vi

1.

Index Introduction - Existing System without Software Problem Definition Proposed System

2.

Technology Details - Integrated Development Environment Introduction To Visual Basic 6.0 Advantages Of Visual Basic 6.0 About Visual Basic 6.0 IDE Database and Database – Connectivity Introduction To Micro-Soft Access

3.

Software Requirement Specification Software Requirements Hardware Requirements

4.

System Analysis and Design :- Data Flow Diagram (DFD)/E-R Diagram

5.

Deploying the Project -(Snap – Shots)Showing Snap – Shots Of Project

6.

Source – Code -About Code – Editor Of VB 6.0Code of Project

7.Bibliography-References : Books and Websites

Note : - The Softcopy Of Project within a CD with envelop is inside this .

( 1 )

Page 2: Ice Cream Parlour

Existing System: -

Traditional record maintenance in any system uses a lot of paper work, which is really hard to maintain and work with.

Problem Definition:-

( 2 )

INTRODUCTIO

Page 3: Ice Cream Parlour

This causes a lot of problem in record maintenance and in kind of many process like searching record, updating and deletion of data. To keep it simple and easy a computer based system can really do a magic. It will definitely decrease memory overhead.

Proposed System :-

Every Organization has its own Product sale, Product Maintains, procedure and administrative methods to develop and implement this methods and Items. Every organization or institution has made several departments employees of this departments have to be trained or to provide training it their at to improve their efficiency.

Ice Ceram Parlour System is designed under graphical user interface (GUI) environment of Microsoft VB-6 as front end and back end support is given by MS-Access. This software is basically meant for the Abstract report and Customer record. Ice Cream Parlour System is fastening the whole process thus extremely increasing the efficiency and effectiveness of work ability.

( 3 )

Page 4: Ice Cream Parlour

INTRODUCTION TO VISUAL BASIC

VISUAL BASIC is the Graphical User Interface (GUI) language. It is the

language that many developers including Microsoft themselves are using to write new

applications software, Microsoft Corporation created it in 1991. It is a high level

language. With the help of Visual Basic we can communicate with other applications

running under windows. It is an internet based and an object oriented programming.

( 4 )

Technology Detail’sTechnology Detail’s

Page 5: Ice Cream Parlour

Visual Basic is substantially different from traditional Basic, though there are

similarities. Visual Basic requires a different approach to developing programs and to

learning the language. But in Basics, we can develop a program line by line, testing

each command as we write it. With Visual Basic we must develop our programs and we

can understand across a broader front.

In Visual Basic we can write a program by assembling the object that we will

use for screen displays and interaction with the users, adjusting the properties of those

objects, determining which events we will respond to, thinking through the variables

we need for holding data and for passing information from one part of the program to

another, and writing the command lines that will run when events are activated. At

each stage of development we may add to or change any aspect of the program, but it

must be done with an awareness of how it will affect the other aspects. Objects,

properties events and code are all intimation. Visual Basic lets us add menus, text

boxes, command buttons, option buttons, check boxes, list boxes, scroll bars, file and

directory boxes to blank windows, we can use grids to handle toolbar data,

communicate with other window applications and access database. We can have

multiple windows on a screen. These windows have full access to the clipboard and to

the information in most other window application running at the same line.

So Visual Basic is a collection of files. It is a very easy language and flexible to

use. This language also contains all the features of basic language. It is an event

driven programming. It is also called a friend of a user. One of the advantages of

visual basic is that it is a grammar free language. It provides both compiler and

interpreter.

Programming in Visual Basic

Programming in Visual Basic was written around Visual Basic 3.0, standard

edition but virtually all of the techniques and concepts apply equally well to Visual

Basic 2.0.It doesn’t have advanced feature or development of free standing commercial

applications, for which the professional edition is necessary. There was another

version of Visual Basic that is Visual Basic for DOS. This version was out of use.

( 5 )

Page 6: Ice Cream Parlour

Windows is the natural medium for Visual Basic. Then come more advanced version

like Visual Basic 4.0, Visual Basic 5.0, and Visual Basic 6.0 at present the latest the

Visual Basic 6.0.

EVENT DRIVEN PROGRAMMINGVisual Basic is Object Oriented, i.e. it revolves around ready made objects and

it is called as EVENT DRIVEN, i.e. all the activities in a program are triggered by one

event or another. Each object has its own properties, determining its position, size,

color, the appearance and nature of its text, and much more. Each object also has its

own event handling procedures.

In an event driven application the code doesn’t follows a predefined path, it

executes different code section in response to events. Events can be triggered by the

user action, by message from the system of other application or even from application

itself. The sequence of this event determines the sequence in which codes executes.

Thus the path through the application code written each time the program runs.

Visual basic system knows all about event handling procedures. It knows what a

button is and how it works. It also knows how to handle images, menus, dialog boxes,

driven and directory lists, and much else. The programmer’s job is to determine where,

how and when an object appears on screen, what its caption reads and what happens

when an event occurs. The event might be the opening of a form, the user clicking on a

box. The programmer does not have to write code to trap these events the system does

that automatically. Because the program code runs in response to event, as at any point

whole range of event might be possible. The flow of execution is not as fixed as in a

traditional program.

About Visual Basic -

Visual Basic is the most Popular Object Oriented event Driven Programming language. It revolves around readymade objects, and it is event driven i.e. all the activities in a program are triggered by one event or another .The main advantage of visual Programming languages is that we can concentrate on what we want our program to do, not how to get the programming language to do it. Some Visual Basic features are: -

1/ Compatibility: Visual Basic is capable of producing software as sophisticated as any other data access techniques available.

( 6 )

Page 7: Ice Cream Parlour

2/ Flexibility: It not only provides database access but can also be used to link it with other word processor, spreadsheets software etc.

3/ Familiarity: Because it can be said as an extended version of Basic, which is very easy to learn and work with, its syntax seems to be more familiar.

4/ Features: Various Additional Features like ADO reports and other various types of Active X controls are supported by this application, which helps widely in development of the Project.

MICROSOFT ACCESS

The goal of the access is to help you get your work done in the least of time, with a minimum of effort.

What type of application can you develop in Access?

Microsoft Access offers a variety of features for different databases needs. It can be used to develop five general type of application:

1. Personal application.2. Application used to run a small business.3. Department application. 4. Corporation- wide application.5. Front- end for enterprise-wide client/server application.

What is Database actually?

The term database means different things to different people. For many years in the world of Dbase was used to describe a collection of fields and records in a client/server environment. Dbase refers to all the data schema, indexes, rules, triggers and stored procedures associated with a system in access terms, a dbase is a collection of all the tables, queries, forms, reports, macros and modules that compose a complete system. Actually database is a collection of related information. Here information is stored in tabular form one record a show all possible attributes of an entity. In a simple word entity can be identified by its attributes like his name, color, height and hairstyle etc identify a person. So in databases a record makes topple while attributes make fields.

About Ms Access -

This is a Backend Tool widely used for Personal Computer as a Data Base. The

relational database is a well-defined theoretical model of working with and managing

a set of data that attends to three specific things:

( 7 )

Page 8: Ice Cream Parlour

Data Structure, Data integrity and Data manipulation .The MS Access has a

distinct component, which adheres to these requirements. The basic Data Structure in

Access is Table having fixed number of columns but variable rows.

The Data integrity rules of the relational models can be defined within Access

relationship using integrity constraints. When a table is created in Access the integrity

rule is defied at that very time.

MS Access has many important features that make it not only an exceptional

database Management System but also an excellent database for personal system in

windows environment,

- It provides highly secure environment to do better handling of database.

- It can handle reasonable amount of data.

- Easily support all window based systems

( 8 )

Page 9: Ice Cream Parlour

HARDWARE & SOFTWARE REQUIREMENT

The following are the minimum requirement for the smooth and successful running of the module.

Hardware: -

Microprocessor - 166 MHz or Higher

- Any - Any of the external write able drive for Setup of the package also to take regular backup

Hard Disk - Min 1GB for Operating system & program to setup properly.

( 9 )

Software Reuirement SpecificationSoftware Reuirement Specification

Page 10: Ice Cream Parlour

- 32 MB (Min) as the package is developed using MS Office 2000 it requires 32 MB Min RAM.

Display - CGA/VGA or higher.

Key Board - 84/109 Keys use. Mouse - Any Standard Mouse.

Printer - 80/132 cols.

Software: -

Operating System - MS Windows 95 or Higher

RDBMS - MS Access

GUI Tool - Visual Basic 6.0

( 10 )

SYSTEM ANALYSIS

Page 11: Ice Cream Parlour

System Analysis

A system is a set or arrangement of functionally dependent component or

working together to attain a predefined goal by processing information. It is the

process of examine of a business situation with the intent of improving it through better

procedure and method. It is the process of gathering and method. It is process

gathering and interpreting facts.

Timing problems and using the information to recommend improvement to the

system. Analysis is used gained and understanding of the conclusion of the system there

is a system description and as set of requirement for a new system. It there is on

existing system, then the analysis only defines the requirement. The step, which follows,

will propose a new system that meets these requirements.

The new system may be built a fresh or by changing the existing system.

Development being by defining a model of new system an continuous by converting

these model to a system in a short analysis specifies what the system should do.

Analysis objective

An efficient system analysis always plays the role of strong foundation for

development of any proposed system. Information play key role, as the horizon of

knowledge keep on expending, since this project is anaphor to convert the manual in to

computer based system, a through knowledge of the day-to-day functions of present

system of mandatory the objective of this study comprise.

( 11 )

Page 12: Ice Cream Parlour

( 12 )

E-R DIAGARAM

Page 13: Ice Cream Parlour

( 13 )

Page 14: Ice Cream Parlour
Page 15: Ice Cream Parlour

2) E-R Diagram Between Purchase & stock-balance

Page 16: Ice Cream Parlour
Page 17: Ice Cream Parlour

CREDIT DATA TABLE

DATABASE DESIGN

Page 18: Ice Cream Parlour

PURCHASE DATA TABLE

SALES DATA TABLE

Page 19: Ice Cream Parlour

TEMP DATA TABLE

Page 20: Ice Cream Parlour
Page 21: Ice Cream Parlour

\

SNAP SHOT’SSNAP SHOT’S

Page 22: Ice Cream Parlour

WELCOME SCREEN FORM

LOGIN FORM

ADD NEW RECORD FORM

Page 23: Ice Cream Parlour

SALES & BILLING FORM

BILLING REPORT

Page 24: Ice Cream Parlour

STOCK UPDATE RECORD FORM

Page 25: Ice Cream Parlour

BALANCE UPDATE RECORD FORM

VIEW RECORD FORM

Page 26: Ice Cream Parlour

SOURCE CODESOURCE CODE

Page 27: Ice Cream Parlour

LOGIN FORM

Private Sub cmdOK_Click() Dim i As Integer If txtPassword = "pass" And txtUserName.Text = "user" Then LoginSucceeded = True Unload Me mdifrm.Show Else MsgBox "Invalid user name or Password, try again!", , "Login" Me.txtUserName = "" Me.txtPassword = "" txtUserName.SetFocus End IfEnd Sub

PURCHASE FORM

Private Sub cmdadd_Click()

Dim rs As New ADODB.Recordsetrs.Open "insert into purchase values ( '" & dtp.Value & "','" & txtpur.Text & "','" & txtice.Text + "'," & txtquantity.Text & "," & Val(txtuprice.Text) & "," & Val(lbltprice.Caption) & "," & txtsprice.Text & ")", dbcon, 2, 3

MsgBox "saved successfully", vbInformation, "saved"Me.dtp.Value = Datecmdclear_Click

End Sub

Private Sub cmdclear_Click()

Me.dtp.Value = DateMe.txtquantity.Text = ""Me.txtsprice.Text = ""Me.txtice.Text = ""Me.txtuprice.Text = ""

Page 28: Ice Cream Parlour

Me.lbltprice.Caption = ""

End Sub

Private Sub Form_Load()Dim rs As New ADODB.Recordsetrs.Open "select * from purchase", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.txtpur.Text = "enter record here"

Elsers.MoveFirstFor i = 1 To rs.RecordCountMe.txtpur.AddItem rs.Fields(1)rs.MoveNextNext

End Ifdtp.Value = Date

End Sub

Private Sub Image2_Click()Unload Me

End Sub

Private Sub Timer1_Timer()If Me.dtp.Value = "" Or Me.txtpur.Text = "" Or Me.txtsprice.Text = "" Or Me.txtuprice.Text = "" Or Me.txtice.Text = "" ThenMe.cmdadd.Enabled = False

ElseMe.cmdadd.Enabled = True

End IfEnd Sub

Private Sub txtice_KeyPress(KeyAscii As Integer)If KeyAscii >= 97 And KeyAscii <= 122 ThenKeyAscii = KeyAscii - 32End If

End Sub

Private Sub txtpur_KeyPress(KeyAscii As Integer)If KeyAscii >= 97 And KeyAscii <= 122 ThenKeyAscii = KeyAscii - 32End If

End Sub

Private Sub txtquantity_Change()If IsNumeric(Me.txtquantity.Text) = True Then

Me.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)Exit Sub

ElseMe.txtquantity.Text = ""

End IfEnd Sub

Page 29: Ice Cream Parlour

Private Sub txtuprice_Change()If IsNumeric(Me.txtuprice.Text) = True Then

Me.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)Else

Me.txtuprice.Text = ""End If

End Sub

SALE FORMFunction SpellNumber(ByVal MyNumber) Dim Rupees, Paise, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Lakh " Place(4) = " Crore " MyNumber = Trim(Str(MyNumber)) DecimalPlace = InStr(MyNumber, ".") If DecimalPlace > 0 Then Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber <> "" If Count <> 1 Then Temp = GetHundreds(Right(MyNumber, 2)) If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees If Len(MyNumber) > 2 Then MyNumber = Left(MyNumber, Len(MyNumber) - 2) Else MyNumber = "" End If Else Temp = GetHundreds(Right(MyNumber, 3)) If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If End If Count = Count + 1 Loop Select Case Rupees

Page 30: Ice Cream Parlour

Case "" Rupees = " " Case "One" Rupees = "Re One " Case Else Rupees = "Rupees " & Rupees End Select Select Case Paise Case "" Paise = " Zero Paise " Case "One" Paise = " and Paise One" Case Else Paise = "Paise " & Paise End Select If Rupees <> " " Then Paise = " and " & Paise SpellNumber = " [ " & Rupees & Paise & " Only ] "End Function

Function GetHundreds(ByVal MyNumber) Dim Result As String If Val(MyNumber) = 0 Then Exit Function MyNumber = Right("000" & MyNumber, 3) If Mid(MyNumber, 1, 1) <> "0" Then Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred " End If

If Mid(MyNumber, 2, 1) <> "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else Result = Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds = ResultEnd Function

Function GetTens(TensText) Dim Result As String Result = "" If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19... Select Case Val(TensText) Case 10: Result = "Ten" Case 11: Result = "Eleven" Case 12: Result = "Twelve" Case 13: Result = "Thirteen" Case 14: Result = "Fourteen" Case 15: Result = "Fifteen" Case 16: Result = "Sixteen" Case 17: Result = "Seventeen" Case 18: Result = "Eighteen" Case 19: Result = "Nineteen" Case Else

Page 31: Ice Cream Parlour

End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 1)) Case 2: Result = "Twenty " Case 3: Result = "Thirty " Case 4: Result = "Forty " Case 5: Result = "Fifty " Case 6: Result = "Sixty " Case 7: Result = "Seventy " Case 8: Result = "Eighty " Case 9: Result = "Ninety " Case Else End Select Result = Result & GetDigit _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens = ResultEnd Function

Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End SelectEnd FunctionPrivate Sub cmbice_Click()Dim rs As New ADODB.Recordsetrs.Open "select * from purchase where ice_name ='" & Me.cmbice.Text & "'", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.lbluprice.Caption = "no record"ElseMe.lbluprice.Caption = rs!price_to_sellMe.lblquan.Caption = rs!quantityEnd IfMe.lbltprice.Caption = Val(Me.lbluprice) * Val(Me.txtquan.Text)End Sub

Private Sub cmdadd_Click()Dim rs As New ADODB.Recordsetrs.Open "select * from purchase where ice_name='" & Me.cmbice.Text & "'", dbcon, 2, 3

Set lst = ListView1.ListItems.Add(, , cmbice.Text)lst.SubItems(1) = Me.txtquan.Text

Page 32: Ice Cream Parlour

lst.SubItems(2) = Me.lbluprice.Captionlst.SubItems(3) = Me.lbltprice.CaptionMe.cmbremove.AddItem Me.cmbice.TextMe.lblgrandtotal.Caption = Val(Me.lblgrandtotal.Caption) + Val(Me.lbltprice.Caption)Me.lblinwords.Caption = SpellNumber(Val(Me.lblgrandtotal.Caption))rs("quantity") = Val(Me.lblquan.Caption) - Val(Me.txtquan.Text)rs.Updaters.CloseMe.txtquan.Text = ""Me.lbltprice.Caption = ""Me.lbluprice.Caption = ""Me.lblquan.Caption = ""Me.cmbice.SetFocusEnd Sub

Private Sub cmdexit_Click()

End Sub

Private Sub cmdprint_Click()On Error Resume NextDim n As StringIf Me.txtpaid.Text = "" ThenMsgBox "Enter paid amount", vbCritical, "requirement"Me.txtpaid.SetFocusElseDim rs As New ADODB.RecordsetDim rs1 As New ADODB.Recordsetrs.Open "insert into sales values ('" & Me.dtp.Value & "'," & Val(Me.lblbillno.Caption) & ",'" & Me.txtcust.Text & "'," & Val(Me.lblgrandtotal.Caption) & "," & Me.txtpaid.Text & "," & Val(Me.lblbal.Caption) & ")", dbcon, 2, 3rs1.Open "insert into credit values(" & Me.lblbillno.Caption & ",'" & Me.txtcust.Text & "','" & Me.dtp.Value & "'," & Me.txtpaid.Text & "," & Val(Me.lblbal.Caption) & ")", dbcon, 2, 3n = MsgBox("bill saved ! want print ? ", vbYesNo, "saved")If n = vbNo ThenUnload Mefrmoption.ShowMe.cmbice.ClearForm_LoadElseMsgBox "bill printing", vbInformation, "print"If DataEnvironment1.rsdadd.State = 1 Then DataEnvironment1.rsdadd.Closereport_bill.PrintReportUnload Mers.Open "delete from temp", dbcon, 2, 3

'Exit Sub'msg:'MsgBox "printer not found", vbCritical, "error"

Me.cmbice.Clear

Page 33: Ice Cream Parlour

Form_Load

End IfEnd IfEnd Sub

Private Sub cmdremove_Click()Dim rs As New ADODB.Recordsetrs.Open "select * from purchase where ice_name='" & Me.cmbremove.Text & "'", dbcon, 2, 3Dim p As IntegerDim n As DoubleDim m As IntegerOn Error Resume Nextn = ListView1.ListItems(Me.cmbremove.ListIndex + 1).SubItems(3) 'totalpricep = ListView1.ListItems(Me.cmbremove.ListIndex + 1).SubItems(1) 'quantityMe.lblgrandtotal.Caption = Val(Me.lblgrandtotal.Caption) - nMe.lblinwords.Caption = SpellNumber(Val(Me.lblgrandtotal.Caption))ListView1.ListItems.Remove (Me.cmbremove.ListIndex + 1)Me.cmbremove.RemoveItem (Me.cmbremove.ListIndex)rs("quantity") = Val(rs.Fields(3)) + Val(p)rs.Updaters.Close

m = Me.cmbremove.ListCountIf m <= 0 ThenMe.lblgrandtotal.Caption = 0Me.lblinwords.Caption = SpellNumber(Val(Me.lblgrandtotal.Caption))End IfEnd Sub

Private Sub cmdshow_Click()If Me.txtcust.Text = "" ThenMsgBox "Enter customer name", vbCritical, "requirment"Me.txtcust.SetFocusElse

Set rs = New ADODB.Recordsetrs.Open "select * from temp", dbcon, 2, 3Dim i As IntegerSet itm = Me.ListView1.ListItemsFor Each itm In ListView1.ListItems rs.AddNew rs.Fields("date").Value = Me.dtp.Value rs.Fields("bil_no").Value = Me.lblbillno.Caption rs.Fields("customer_name").Value = Me.txtcust.Text rs.Fields("ice_name").Value = itm.Text rs.Fields("quantity").Value = itm.SubItems(1) rs.Fields("unit_price").Value = itm.SubItems(2) rs.Fields("total_price").Value = itm.SubItems(3) rs.Fields("in_words").Value = Me.lblinwords.Caption rs.Update

Page 34: Ice Cream Parlour

Next'MsgBox "saved !"frmgif.Show 1Me.Timer1.Enabled = FalseMe.cmdremove.Enabled = False

Me.cmdshow.Visible = FalseMe.cmdshow2.Visible = TrueMe.cmdprint.Enabled = True

If DataEnvironment1.rsdadd.State = 1 Then DataEnvironment1.rsdadd.Closereport_bill.Refreshreport_bill.ShowEnd If

End Sub

Private Sub cmdshow2_Click()report_bill.ShowEnd Sub

Private Sub Form_Load()Me.Timer1.Enabled = TrueMe.cmdprint.Enabled = FalseMe.cmdshow.Visible = TrueMe.cmdshow2.Visible = FalseDim rs As New ADODB.Recordsetrs.Open "select * from purchase", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.cmbice.Text = "no record inserted yet"Elsers.MoveFirstFor i = 1 To rs.RecordCountMe.cmbice.AddItem rs.Fields(2)rs.MoveNextNextEnd Ifdtp.Value = Daters.Close

rs.Open "select * from sales", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.lblbillno.Caption = 1Elsers.MoveLastMe.lblbillno.Caption = rs.Fields(1) + 1End Ifrs.Closers.Open "delete from temp", dbcon, 2, 3

Page 35: Ice Cream Parlour

End Sub

Private Sub Image3_Click()i = MsgBox("are u sure to close this form", vbYesNo)If i = vbYes ThenUnload MeElseCancel = 1End IfEnd Sub

Private Sub Timer1_Timer()Dim m As Integerm = Me.cmbremove.ListCountIf m <= 0 ThenMe.cmdremove.Enabled = FalseMe.cmdshow.Enabled = FalseElseMe.cmdremove.Enabled = TrueMe.cmdshow.Enabled = TrueEnd If

If Me.lblquan.Caption = "" Or Me.txtquan.Text = "" Or Me.cmbice.Text = "" Or Me.lbluprice.Caption = "" ThenMe.cmdadd.Enabled = FalseElseMe.cmdadd.Enabled = TrueEnd IfEnd Sub

Private Sub Timer2_Timer()If Me.lblbal.Caption = "0" ThenMe.lblbal.Caption = "nil"End IfIf Me.txtpaid.Text = "" ThenMe.lblbal.Caption = "nil"End IfEnd Sub

Private Sub txtcust_KeyPress(KeyAscii As Integer)If KeyAscii >= 97 And KeyAscii <= 122 ThenKeyAscii = KeyAscii - 32End IfEnd Sub

Private Sub txtpaid_Change()If IsNumeric(Me.txtpaid.Text) = True ThenMe.lblbal.Caption = Val(Me.lblgrandtotal.Caption) - Val(Me.txtpaid.Text)

Else

Me.txtpaid.Text = ""

Page 36: Ice Cream Parlour

End IfIf Val(Me.txtpaid.Text) > Val(Me.lblgrandtotal.Caption) ThenMsgBox "Entered amount should be less then grand total", vbInformation, "cant accept"Me.txtpaid.Text = ""End IfEnd Sub

Private Sub txtquan_Change()If IsNumeric(Me.txtquan.Text) = True ThenMe.lbltprice.Caption = Val(Me.txtquan.Text) * Val(Me.lbluprice.Caption)If Val(Me.txtquan.Text) > Val(Me.lblquan.Caption) ThenMsgBox "please enter quantity less then available quantity !", vbInformation, "info"Me.txtquan.Text = ""

ElseExit SubEnd IfElseMe.txtquan.Text = ""End IfEnd Sub

MAINTAINS FORM

Private Sub cmbbill_Click()On Error Resume NextMe.cmdupdate2.Enabled = TrueMe.txttpaid.Enabled = TrueMe.txttpaid.Text = ""Me.lblubal.Caption = ""Dim rs As New ADODB.Recordsetrs.Open "select * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3Me.cmbcustname.Text = rs!customer_nameMe.lbltotal.Caption = rs!grand_totalMe.lblpaid.Caption = rs!paidMe.lblbal.Caption = rs!balanceEnd Sub

Private Sub cmbcustname_Click()On Error Resume NextMe.cmdupdate2.Enabled = TrueMe.txttpaid.Enabled = TrueMe.txttpaid.Text = ""Me.lblubal.Caption = ""Dim rs As New ADODB.Recordsetrs.Open "select * from sales where customer_name='" & Me.cmbcustname.Text & "'", dbcon, 2, 3Me.cmbbill.Text = rs!bill_noMe.lbltotal.Caption = rs!grand_totalMe.lblpaid.Caption = rs!paid

Page 37: Ice Cream Parlour

Me.lblbal.Caption = rs!balanceEnd Sub

Private Sub cmbstone_Click()Me.cmdupdate2.Enabled = TrueDim rs As New ADODB.Recordsetrs.Open "select * from purchase where ice_name ='" & Me.cmbstone.Text & "'", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.txtuprice.Text = "no record"Else'Me.txtuprice.Text = rs!selling_priceMe.txtpur.Text = rs!purchasing_fromMe.txtquantity.Text = rs!quantityMe.txtsprice.Text = rs!price_to_sellMe.txtuprice.Text = rs!unit_price

Me.dtp.Value = rs!DateMe.lbltprice.Caption = rs!total_priceEnd IfEnd Sub

Private Sub cmdelete2_Click()

End Sub

Private Sub cmddelete2_Click()n = MsgBox("sure to delete " + Me.cmbcustname.Text + "'s record", vbYesNo, "sure")If n = vbNo ThenMe.cmddelete2.Cancel = TrueElseDim rs As New ADODB.Recordsetrs.Open "delete * from credit where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3rs.Open "delete * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3Me.cmbbill.Text = ""Me.cmbcustname.Text = ""Me.lblbal.Caption = ""Me.lblpaid.Caption = ""Me.lbltotal.Caption = ""Me.txttpaid.Text = ""Me.lblubal.Caption = ""MsgBox "record deleted", vbInformation, "info"Me.cmbbill.ClearMe.cmbcustname.ClearForm_LoadMe.Frame2.Visible = TrueMe.frame1.Visible = FalseEnd IfEnd Sub

Private Sub cmdelete_Click()

Page 38: Ice Cream Parlour

n = MsgBox("sure to delete record " + Me.cmbstone.Text, vbYesNo, "sure")If n = vbNo ThenMe.cmdelete.Cancel = TrueElseDim rs As New ADODB.Recordsetrs.Open " delete * from purchase where ice_name='" & Me.cmbstone.Text & "'", dbcon, 2, 3

Me.txtpur.Text = ""Me.txtquantity.Text = ""Me.txtsprice.Text = ""Me.txtuprice.Text = ""Me.lbltprice.Caption = ""MsgBox "record deleted", vbInformation, "info"Me.cmbstone.ClearForm_LoadMe.frame1.Visible = TrueMe.Frame2.Visible = FalseEnd IfEnd Sub

Private Sub cmddelete_Click()

End Sub

Private Sub cmdexit2_Click()

End Sub

Private Sub cmdupdate_Click()Dim rs As New ADODB.Recordsetrs.Open "select * from purchase where ICE_name ='" & Me.cmbstone.Text & "'", dbcon, 2, 3rs("date") = Me.dtp.Valuers("purchasing_from") = Me.txtpur.Textrs("ice_name") = Me.cmbstone.Text

rs("quantity") = Val(Me.txtquantity.Text)rs("unit_price") = Val(Me.txtuprice.Text)rs("total_price") = Val(Me.lbltprice.Caption)rs("price_to_sell") = Val(Me.txtsprice.Text)rs.Updaters.CloseMsgBox "updated", vbInformation, "information"

Me.txtpur.Text = ""Me.txtquantity.Text = ""Me.txtsprice.Text = ""Me.txtuprice.Text = ""

Me.lbltprice.Caption = ""

Page 39: Ice Cream Parlour

Me.cmbstone.SetFocusEnd Sub

Private Sub cmdupdate2_Click()

Dim rs As New ADODB.Recordsetrs.Open "select * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3rs("balance") = Val(Me.lblubal.Caption)rs("paid") = Val(Me.lblpaid.Caption) + Val(Me.txttpaid.Text)rs.Updaters.CloseDim rs1 As New ADODB.Recordsetrs1.Open "insert into credit values(" & Me.cmbbill.Text & ",'" & Me.cmbcustname.Text & "','" & Me.dtp2.Value & "'," & Me.txttpaid.Text & "," & Val(Me.lblubal.Caption) & ")", dbcon, 2, 3MsgBox "updated successfully", vbInformation, "info"Me.cmbbill.Text = ""Me.cmbcustname.Text = ""Me.lblbal.Caption = ""Me.lblpaid.Caption = ""Me.lbltotal.Caption = ""Me.txttpaid.Text = ""Me.lblubal.Caption = ""Me.cmbbill.SetFocusEnd Sub

Private Sub Command2_Click()n = MsgBox("sure to delete " + Me.cmbcustname.Text + "'s record", vbYesNo, "sure")If n = vbNo ThenMe.cmddelete2.Cancel = TrueElseDim rs As New ADODB.Recordsetrs.Open "delete * from credit where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3rs.Open "delete * from sales where bill_no=" & Me.cmbbill.Text, dbcon, 2, 3Me.cmbbill.Text = ""Me.cmbcustname.Text = ""Me.lblbal.Caption = ""Me.lblpaid.Caption = ""Me.lbltotal.Caption = ""Me.txttpaid.Text = ""Me.lblubal.Caption = ""MsgBox "record deleted", vbInformation, "info"Me.cmbbill.ClearMe.cmbcustname.ClearForm_LoadMe.Frame2.Visible = TrueMe.frame1.Visible = FalseEnd IfEnd Sub

Page 40: Ice Cream Parlour

Private Sub Form_Load()

Me.txttpaid.Enabled = FalseMe.frame1.Visible = FalseMe.Frame2.Visible = Falsedtp.Value = DateDim rs As New ADODB.RecordsetDim n As Integerrs.Open "select * from purchase", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.cmbstone.AddItem "NO RECORD INSERTD YET"rs.CloseElsers.MoveFirstFor n = 1 To rs.RecordCountMe.cmbstone.AddItem rs.Fields(2)rs.MoveNextNextrs.CloseEnd Ifrs.Open "select * from sales", dbcon, 2, 3If rs.RecordCount = 0 ThenMe.cmdupdate2.Enabled = FalseMe.cmbcustname.AddItem "NO INVOICE RECORD YET"Me.cmbbill.AddItem "NO INVOICE RECORD YET"

rs.CloseElsers.MoveFirstFor n = 1 To rs.RecordCountMe.cmbcustname.AddItem rs.Fields(2)Me.cmbbill.AddItem rs.Fields(1)rs.MoveNextNextrs.CloseEnd IfMe.dtp2.Value = DateMe.dtp.Value = DateEnd Sub

Private Sub Image2_Click()Unload MeEnd Sub

Private Sub Optbal_Click()Me.Frame2.Visible = TrueMe.frame1.Visible = FalseEnd Sub

Private Sub Optstock_Click()Me.frame1.Visible = TrueMe.Frame2.Visible = False

Page 41: Ice Cream Parlour

End Sub

Private Sub Timer2_Timer()If Me.lblpaid.Caption = "" Or Me.txttpaid.Text = "" Or Me.cmbbill.Text = "" Or Me.cmbcustname.Text = "" ThenMe.cmdupdate2.Enabled = False

ElseMe.cmdupdate2.Enabled = True

End If

If Me.lblpaid.Caption = "" Or Me.cmbbill.Text = "" Or Me.cmbcustname.Text = "" ThenMe.cmddelete2.Enabled = False

ElseMe.cmddelete2.Enabled = True

End If

If Me.dtp.Value = "" Or Me.txtpur.Text = "" Or Me.txtquantity.Text = "" Or Me.txtsprice.Text = "" Or Me.txtuprice.Text = "" ThenMe.cmdupdate.Enabled = FalseMe.cmdelete.Enabled = FalseElseMe.cmdupdate.Enabled = TrueMe.cmdelete.Enabled = TrueEnd IfIf Me.lblbal.Caption = "0" ThenMe.lblbal.Caption = "nill"Me.cmdupdate2.Enabled = FalseMe.txttpaid.Enabled = False

End IfIf Me.txttpaid.Text = "" ThenMe.lblubal.Caption = ""End If

End Sub

Private Sub txtpur_KeyPress(KeyAscii As Integer)If KeyAscii >= 97 And KeyAscii <= 122 ThenKeyAscii = KeyAscii - 32End IfEnd Sub

Private Sub txtquantity_Change()If IsNumeric(Me.txtquantity.Text) = True ThenMe.lbltprice.Caption = Val(Me.txtquantity.Text) * Val(Me.txtuprice.Text)Exit SubElse

Page 42: Ice Cream Parlour

Me.txtquantity.Text = ""End IfEnd Sub

Private Sub txttpaid_Change()

If IsNumeric(Me.txttpaid.Text) = True ThenMe.lblubal.Caption = Val(Me.lblbal.Caption) - Val(Me.txttpaid.Text)If Val(Me.txttpaid.Text) > Val(Me.lblbal.Caption) ThenMsgBox "please enter paid amount less then balance !", vbInformation, "info"Me.txttpaid.Text = ""Me.lblubal.Caption = ""ElseExit SubEnd IfElseMe.txttpaid.Text = ""End If

End Sub

CONCLUSIONCONCLUSION

Page 43: Ice Cream Parlour

Conclusion :-

Designed system provides an easy way to interact with user and administrator. This GUI based system gives a system with less paper work and less memory overhead. It is also a fast and interactive system.

Page 44: Ice Cream Parlour

BIBLIOGRAPHY:

1/ Mr. Steven Holzner, Visual Basic 6 Programming (Black Book), 2006

edition, Dreamtech Press, New Delhi, 2002.

2/ Mr. Soma dasgupta, Visual Basic project, 2002 edition, BPB Publication,

New Delhi.

3/ Mastering in Visual Basic

Steven Holzner, Visual Basic 6 Programming (Black Book), 2006 edition, Dreamtech Press, New Delhi, 2002.

BIBLIOGRAPHYBIBLIOGRAPHY

Page 45: Ice Cream Parlour

2/ Mr. Soma Dasgupta, Visual Basic project, 2002 edition, BPB Publication,

New Delhi

3/ Mr. Evangelos Petroutsos, Mastering in Visual Basic 6.0, BPB

Publication, New Delhi

The following are the minimum requirement for the smooth and successful running of the module.