1. Item code is checked whether exist in the file or not whenever user input, while purchase, delete or modify.
2. Validation for quantity is checked, customer should not purchase above the available quantity.
Coding
Module1
Public con As New ADODB.Connection
frmMain
Private Sub cmdOk_Click()
Dim rsPass As New ADODB.Recordset
rsPass.Open "select Password from Pass", con, adOpenDynamic If Not rsPass.EOF Then
If (txtPassword.Text = "" And IsNull(rsPass("Password"))) Or (rsPass("Password")
= txtPassword.Text) Then
rsPass.Close
Set rsPass = Nothing
End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub Form_Load()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + App.Path + "\fastfood.mdb"
con.Open End Sub frmMenu
Private Sub Command1_Click()
End Sub
Private Sub cmdFile_Click()
frmFileMaintainance.Show vbModal End Sub
Private Sub cmdHelp_Click()
Call Shell("Notepad.exe " & App.Path & "\readme.txt", 1) End Sub
Private Sub cmdQuit_Click() Unload Me
End Sub
Private Sub cmdReports_Click() frmReports.Show vbModal End Sub
Private Sub cmdSales_Click() frmSales.Show vbModal End Sub
Private Sub cmdToday_Click() frmToday.Show vbModal
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc1.bmp") End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc2.bmp")
End Sub
frmChangePassword
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdOk_Click()
Dim rsPass As New ADODB.Recordset
rsPass.Open "select Password from Pass", con, adOpenDynamic If rsPass("Password") <> Me.txtOld.Text Then
MsgBox "Invalid Password."
Me.txtOld.SetFocus Exit Sub
ElseIf Me.txtNew.Text <> Me.txtConfirm.Text Then MsgBox "Invalid Password."
Me.txtConfirm.SetFocus Exit Sub
Else
con.Execute "update Pass set Password = '" & Me.txtNew.Text & "'"
MsgBox "Password Changed"
Unload Me End I
End Sub If Me.txtFrom.Text = "" Then MsgBox "Input Date."
Me.txtFrom.SetFocus Exit Sub
End If
If Not IsDate(Me.txtFrom) Then MsgBox "Invalid Date."
Me.txtFrom.SetFocus Exit Sub
End If
If Me.txtTo.Text = "" Then MsgBox "Input Date."
Me.txtTo.SetFocus Exit Sub
End If
If Not IsDate(Me.txtTo) Then MsgBox "Invalid Date."
Me.txtTo.SetFocus Exit Sub
End If
'Dim rsList As New ADODB.Recordset
'rsList.Open "select * from ListofBills where DoB >= cdate('" & Me.txtFrom.Text &
"') and DoB <= cdate('" & Me.txtTo.Text & "') order by DoB,BillNo", con, adOpenDynamic
'Set repDatewiseBillList.DataSource = rsList 'repDatewiseBillList.Show vbModal
'rsList.Close
'Set rsList = Nothing
Dim acApp As Access.Application Set acApp = New Access.Application
acApp.OpenCurrentDatabase App.Path & "\fastfood.mdb"
acApp.DoCmd.OpenReport "repPrintBill", acViewPreview, "select * from PrintBill where DoB >= cdate('" & Me.txtFrom.Text & "') and DoB <= cdate('" &
Me.txtTo.Text & "')"
acApp.DoCmd.Maximize
acApp.Visible = True
End Sub
Private Sub Form_Load() Me.txtFrom.Text = Date Me.txtTo.Text = Date
End Sub
frmDelete
Private Sub cmbItemCode_Click()
Dim rsFill As New ADODB.Recordset
rsFill.Open "select * from Item where ItemCode = " & Me.cmbItemCode.Text, con, adOpenDynamic
If Not rsFill.EOF Then
Me.txtName.Text = rsFill("Name").Value Me.txtPrice.Text = rsFill("Price").Value End If
rsFill.Close
Set rsFill = Nothing End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdDelete_Click()
con.Execute "delete from Item where ItemCode = " & Me.cmbItemCode.Text MsgBox "Record Deleted."
Me.txtName.Text = ""
Me.txtPrice.Text = ""
Me.cmbItemCode.RemoveItem (Me.cmbItemCode.ListIndex) If Me.cmbItemCode.ListCount <> 0 Then
Me.cmbItemCode.ListIndex = 0 End If
Me.cmbItemCode.SetFocus End Sub
Private Sub Form_Load()
Me.txtName.Enabled = False Me.txtPrice.Enabled = False
Dim rsItemCode As New ADODB.Recordset
rsItemCode.Open "select ItemCode,Name from Item order by Itemcode", con, adOpenDynamic
Do While Not rsItemCode.EOF
Me.cmbItemCode.AddItem rsItemCode("ItemCode").Value
rsItemCode.MoveNext Loop
If Me.cmbItemCode.ListCount <> 0 Then Me.cmbItemCode.ListIndex = 0
End If
rsItemCode.Close
Set rsItemCode = Nothing
End Sub
frmFileMaintenance
Private Sub cmdChangePassword_Click() frmChangePassword.Show vbModal End Sub
Private Sub cmdDelete_Click() frmDelete.Show vbModal End Sub
Private Sub cmdModify_Click() frmModifyItem.Show vbModal End Sub
Private Sub cmdNew_Click() frmNewItem.Show vbModal End Sub
Private Sub cmdReturn_Click() Unload Me
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc1.bmp") End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc2.bmp") End Sub
frmModifyItem
Private Sub cmbItemCode_Click()
Dim rsFill As New ADODB.Recordset
rsFill.Open "select * from Item where ItemCode = " & Me.cmbItemCode.Text, con, adOpenDynamic
If Not rsFill.EOF Then
Me.txtName.Text = rsFill("Name").Value Me.txtPrice.Text = rsFill("Price").Value End If
rsFill.Close
Set rsFill = Nothing End Sub
Me.txtName.SetFocus
If Not IsNumeric(Me.txtPrice) Then
MsgBox "Please input Numeric Value."
Me.txtPrice.SetFocus Exit Sub
End If
con.Execute "update Item set Name='" & Me.txtName.Text & "', Price=" &
Me.txtPrice.Text & " where ItemCode = " & Me.cmbItemCode.Text MsgBox "Record Updated."
Me.cmbItemCode.Text = ""
Me.txtName.Text = ""
Me.txtPrice.Text = ""
Me.cmbItemCode.SetFocus End Sub
Private Sub Form_Load()
Dim rsItemCode As New ADODB.Recordset
rsItemCode.Open "select ItemCode,Name from Item order by Itemcode", con, adOpenDynamic
Do While Not rsItemCode.EOF
Me.cmbItemCode.AddItem rsItemCode("ItemCode").Value rsItemCode.MoveNext
Loop
If Me.cmbItemCode.ListCount <> 0 Then Me.cmbItemCode.ListIndex = 0
End If
rsItemCode.Close
Set rsItemCode = Nothing
End Sub
frmNewItem
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdNew_Click()
If Me.cmdNew.Caption = "&New Item" Then Me.cmdNew.Caption = "&Update"
Me.txtName.Enabled = True Me.txtPrice.Enabled = True
Dim rsItemCode As New ADODB.Recordset
rsItemCode.Open "select ItemCode from Item order by ItemCode desc", con, adOpenDynamic
If Not rsItemCode.EOF Then
Me.txtItemCode.Text = rsItemCode("ItemCode").Value + 1 Else
Else
If Not IsNumeric(Me.txtPrice) Then
MsgBox "Please input Numeric Value."
Me.txtPrice.SetFocus Exit Sub
End If
con.Execute "Insert into Item(ItemCode,Name,Price) values(" &
Me.txtItemCode.Text & ",'" & Me.txtName.Text & "'," & Me.txtPrice.Text & ")"
MsgBox "Record Saved"
Me.txtItemCode.Text = ""
Me.txtName.Text = ""
Me.txtPrice.Text = ""
Me.txtName.Enabled = False Me.txtPrice.Enabled = False
Me.cmdNew.Caption = "&New Item"
End If End Sub
Private Sub Form_Load()
Me.txtItemCode.Enabled = False Me.txtName.Enabled = False Me.txtPrice.Enabled = False
End Sub
frmPrintBill
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub cmdPreview_Click() 'Dim rsBill As New ADODB.Recordset
'rsBill.Open "select distinct * from ListofBills where BillNo=" & Me.cmbBillNo.Text
& " order by billno", con, adOpenDynamic 'Set repPrintBill.DataSource = rsBill
'repPrintBill.Show vbModal 'rsBill.Close
'Set rsBill = Nothing
Dim acApp As Access.Application Set acApp = New Access.Application
acApp.OpenCurrentDatabase App.Path & "\fastfood.mdb"
acApp.DoCmd.OpenReport "repPrintBill", acViewPreview, "select * from PrintBill where BillNo=" & Me.cmbBillNo.Text
acApp.DoCmd.Maximize acApp.Visible = True
End Sub
Private Sub Form_Load()
Dim rsBillCode As New ADODB.Recordset
rsBillCode.Open "select BillNo from ListofBills order by BillNo", con, adOpenDynamic
Do While Not rsBillCode.EOF
Me.cmbBillNo.AddItem rsBillCode("BillNo").Value rsBillCode.MoveNext
Loop
If Me.cmbBillNo.ListCount <> 0 Then Me.cmbBillNo.ListIndex = 0
End If
rsBillCode.Close
Set rsBillCode = Nothing
End Sub
frmReports
Private Sub cmdFile_Click()
'Dim rsList As New ADODB.Recordset
'rsList.Open "select * from ListofBills", con, adOpenDynamic 'Set repAllBills.DataSource = rsList
'repAllBills.Show vbModal 'rsList.Close
'Set rsList = Nothing
Dim acApp As Access.Application Set acApp = New Access.Application
acApp.OpenCurrentDatabase App.Path & "\fastfood.mdb"
acApp.DoCmd.OpenReport "repPrintBill", acViewPreview
Private Sub cmdReports_Click() frmDatewise.Show vbModal End Sub
Private Sub cmdSales_Click()
Dim rsList As New ADODB.Recordset
rsList.Open "select * from Item order by ItemCode", con, adOpenDynamic Set repItemList.DataSource = rsList
repItemList.Show vbModal rsList.Close
Set rsList = Nothing
End Sub
Private Sub cmdToday_Click() frmPrintBill.Show vbModal End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc1.bmp")
End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Image2.Picture = LoadPicture(App.Path & "\mc2.bmp") End Sub
frmSales
Dim tmpPrice As Integer
Private Sub cmbItemCode_Click()
Dim rsFill As New ADODB.Recordset
rsFill.Open "select * from Item where ItemCode = " & Me.cmbItemCode.Text, con, adOpenDynamic
If Not rsFill.EOF Then
Me.txtName.Text = rsFill("Name").Value Me.txtPrice.Text = rsFill("Price").Value tmpPrice = rsFill("Price").Value
End If rsFill.Close
Set rsFill = Nothing End Sub
Private Sub cmdAdd_Click() If Me.txtQuantity.Text = "" Then MsgBox "Please input quantity"
Me.txtQuantity.SetFocus
Exit Sub End If
If Not IsNumeric(Me.txtQuantity.Text) Then MsgBox "Please input numeric data"
Me.txtQuantity.SetFocus Exit Sub
End If
Me.lstItemCode.AddItem Me.cmbItemCode.Text Me.lstQuantity.AddItem Me.txtQuantity.Text
Me.lstPrice.AddItem Me.txtPrice * Me.txtQuantity.Text t = 0
For i = 0 To Me.lstPrice.ListCount - 1 Me.lstPrice.ListIndex = i
Private Sub cmdPrintBill_Click() 'Dim rsBill As New ADODB.Recordset
'rsBill.Open "select * from ListofBills where BillNo=" & Me.txtBillNo.Text, con, adOpenDynamic
'Set repPrintBill.DataSource = rsBill 'repPrintBill.Show vbModal
'rsBill.Close
'Set rsBill = Nothing
Dim acApp As Access.Application Set acApp = New Access.Application
acApp.OpenCurrentDatabase App.Path & "\fastfood.mdb"
acApp.DoCmd.OpenReport "repPrintBill", acViewPreview, "select * from PrintBill where BillNo=" & Me.txtBillNo.Text
acApp.DoCmd.Maximize acApp.Visible = True
End Sub
Private Sub cmdRemove_Click()
If Me.lstItemCode.ListIndex <> -1 Then
t = Me.lstItemCode.ListIndex Me.lstItemCode.RemoveItem (t) Me.lstQuantity.RemoveItem (t) Me.lstPrice.RemoveItem (t) t = 0
If Me.cmdSaleItem.Caption = "&New Sale" Then Me.cmdSaleItem.Caption = "&Sale Item"
Me.cmdAdd.Enabled = True Me.cmdPrintBill.Enabled = False Me.cmbItemCode.Enabled = True Me.txtDoB.Enabled = True
Me.txtCustName.Enabled = True Me.txtQuantity.Enabled = True Me.txtCustName.Text = ""
Me.txtQuantity.Text = ""
Me.txtDoB.Text = Date Me.txtAmount.Text = "0"
Me.lstItemCode.Clear Me.lstPrice.Clear Me.lstQuantity.Clear
Dim rsBillNo As New ADODB.Recordset
rsBillNo.Open "select BillNo from Bill order by BillNo desc", con, adOpenDynamic
If Me.cmbItemCode.ListCount <> 0 Then Me.cmbItemCode.ListIndex = 0
End If
Me.cmbItemCode.SetFocus
If Not IsNumeric(Me.txtQuantity) Then
Me.txtBillNo.Text & "," & Me.cmbItemCode.Text & ",'" & Me.txtDoB.Text & "'," &
Me.txtQuantity.Text & "," & tmpPrice & "," & Me.txtAmount.Text & ",'" &
Me.txtCustName.Text & "')"
For i = 0 To Me.lstItemCode.ListCount - 1 Me.lstItemCode.ListIndex = i
Me.lstPrice.ListIndex = i Me.lstQuantity.ListIndex = i
con.Execute "insert into BillTrans(BillNo,ItemCode,Quantity,Amount,Price) values(" & Me.txtBillNo.Text & "," & Me.lstItemCode.Text & "," &
Me.lstQuantity.Text & "," & Me.lstPrice.Text & "," & Me.lstPrice.Text / Me.lstQuantity.Text & ")"
Next
MsgBox "Record Inserted."
Me.cmdSaleItem.Caption = "&New Sale"
Me.cmdPrintBill.Enabled = True Me.cmdAdd.Enabled = False Me.cmbItemCode.Enabled = False
Me.txtDoB.Enabled = False
Me.txtCustName.Enabled = False Me.txtQuantity.Enabled = False Me.cmdSaleItem.SetFocus End If
Me.txtQuantity.Enabled = False Me.cmdPrintBill.Enabled = False Me.cmdAdd.Enabled = False
Dim rsItemCode As New ADODB.Recordset
rsItemCode.Open "select ItemCode,Name from Item order by Itemcode", con, adOpenDynamic
Do While Not rsItemCode.EOF
Me.cmbItemCode.AddItem rsItemCode("ItemCode").Value rsItemCode.MoveNext
Loop
'If Me.cmbItemCode.ListCount <> 0 Then ' Me.cmbItemCode.ListIndex = 0
'End If
rsItemCode.Close
Set rsItemCode = Nothing
End Sub
frmToday
Private Sub cmbItemCode_Click()
Dim rsFill As New ADODB.Recordset
rsFill.Open "select * from Item where ItemCode = " & Me.cmbItemCode.Text, con, adOpenDynamic
If Not rsFill.EOF Then
Me.lblName.Caption = rsFill("Name").Value Me.lblPrice.Caption = rsFill("Price").Value End If
rsFill.Close
Set rsFill = Nothing End Sub
Private Sub cmdExit_Click() Unload Me
End Sub
Private Sub Form_Load()
Me.lblName.Enabled = False Me.lblPrice.Enabled = False
Dim rsItemCode As New ADODB.Recordset
rsItemCode.Open "select ItemCode,Name from Item order by Itemcode", con, adOpenDynamic
Do While Not rsItemCode.EOF
Me.cmbItemCode.AddItem rsItemCode("ItemCode").Value rsItemCode.MoveNext
Loop
If Me.cmbItemCode.ListCount <> 0 Then Me.cmbItemCode.ListIndex = 0
End If
rsItemCode.Close
Set rsItemCode = Nothing
End Sub
TESTING
TESTING
Testing is a very critical activity that ensures the liability of a particular software product.
During this activity the software to be tested is executed with a set of tests, and the output and functioning of the program are evaluated. It is done to ensure whether the system meets the specified requirements or not.
Testing can bring forth some aspects that have not been considered or covered by the developers. Testing a large program is a complex process that can be broken down into two parts:
unit testing
system testing
In the first case the different modules of the application are tested individually. In case of system testing the software is tested as a whole. The system undergoes several tests like:
time tests
performance tests
memory tests
input and output tests, etc.
Testing can be done in the following three phases:
Programmatic Testing – This is done to determine whether the application works according to the specifications. Here it is checked whether the application is providing all the required functionalities and features or not. All the validations
are checked thoroughly. All the links are tested and the database functionalities are also checked.
User Testing – In this phase it is ascertained whether the target audience of the application can use the application easily and effectively. Is the software system is serving their purpose and fits their requirements or not. It is checked whether they are satisfied with the information provided. They are asked about the clarity, attractiveness and the overall presentation of the screens and reports.
Goal Testing – Finally this test is performed to test whether the application meets the goals, which were set before developing the application. Here it must be ensured that the organization is satisfied with the working and presentation of the application.
SUGGESTIONS
PIZZA HUT is large growing fast food centre in India and other countries also, it becomes very difficult to keep records for large no. of items and customers and calculating bills. This project is very useful in the fastfood management.
Utmost care and back-up procedures must be established to ensure 100%
successful implementation of the computerized fastfood system. In case of system failure, the organization should be in a position to process the transaction with another organization or if the worst comes to the worst, it should be in a position to complete it manually.