Você está na página 1de 43

UTTARANCHAL INSTITUTE OF MANAGEMENT

MINI PROJECT REPORT


On

“Muddy’s Cafe”
Submitted in partial fulfillment of BCA 2nd Year
For the academic session 2016-19

To
UTTARANCHAL UNIVERSITY

STIT UTE OF

Under the supervision of:- Submitted by:-


Mr.Amarjeet Rawat Parth Pangtey
(Assistant Professor) (BCA 2nd Year )

1
ACKNOWLEDGEMENT

The most awaited moment of any Endeavour is successful completion, but nothing can be done
successfully if done alone. Success is the outcome of contribution and consistent help of various persons
and we thank those ones who helped us in successful completion of this project.

We profusely thankful to the department‘s head of computer science and applications Dr. Sonal
Sharma and our guide Mr. Amarjeet Rawat. Both have been generous enough to provide us an
opportunity and accepting our candidature for the most valuable guidance and affordable treatment
given to us at every stage to boost our morale.

We express our sincere gratitude to our colleagues with whom we have fruitful discussions which have
helped us a lot in giving a final shape to the program.

Student Name

PARTH PANGTEY
BCA 4TH SEM (B)

2
DECLARATION
I hereby declare that the project work entitled “Muddy’s Cafe” submitted to the Uttaranchal Institute
of Management, is a record of an original work done by us under the guidance of MR AMARJEET
RAWAT and this project work has not performed the basis for the award of any Degree or diploma/
associate ship/fellowship and similar project if any.

3
CERTIFICATE

This is to certify that Parth Pangtey, student of 4th semester under doing BCA, have
completed the Project Entitled “Muddy’s Cafe” Using the VB.NET platform at
Uttaranchal Institute of Management Dehradun for the Batch (2016-2019).

Under the guidance of:

Mr. Amarjeet Rawat

(Assistant Professor)

Uttaranchal University, Dehradun

4
TABLE OF CONTENTS

i. ACKNOWLEGMENT.......................................................................................................i
ii. DECLARATION...............................................................................................................ii
iii. CERTIFICATE OF ORIGINALITY......................................................................................iii

5
INTRODUCTION

The “Muddy’s Cafe” is a specific type of restaurant characterized both by its cuisine
and by minimal table service. The restaurant more effectively and efficiently by
computerizing meal ordering, billing and inventory control. We have always focussed on
quality, taste and perfection rather than earning profit. We believe in customers
satisfaction at priority. Muddy’s has discovered its own Variety of Spices which is used
in all our outlets. The most important part of this Cafe is it's Ingredients which is used to
make the delicious and tasty meal.

The system processes transaction and stores the resulting data. Reports will be generated
from these data which help the manager to make appropriate business decisions for the
restaurant. For example, knowing the number of customers for a particular time interval.

6
OBJECTIVES

The general objectives of the study is to develop a reliable, convenient and accurate
Application.
The study has the following specific objectives:

 To develop a system that will surely satisfied the customer service.


 To design a system able to accommodate huge amount of orders at a time.
 To evaluate its performance and acceptability in terms of security, user-
friendliness, accuracy and reliability.
 To improve the communication between the client and the server and minimize
the time of ordering.

 To automatically compute the bill.


The system will also automatically calculate and displays the final bill so the bills
will ready to print without having any error because the information for that item is
already inserted.

One of the main objectives of a restaurant to ensure customer satisfaction. Manual


listing of orders by the waiters/waitresses may result to slow response in customer
service. Hence, if the restaurant uses the proposed system, manipulation of orders
to the customers be so easy and quick by just touching on the tablet and choosing
the desired menu.

 Advantages of this application:-


 Easy to Use.
 Easy to Learn the system.
 Easy to Calculate Bill.
 Easy to Order Food.

7
SYSTEM ANALYSIS

 PROPOSED SYSTEM

“Muddy’s Cafe” is a Billing System Application for a Restaurant.


The system is very simple in design and to implement. The system requires very low
system resources and the system will work in almost all configurations.

 Error reduction.
 Improve reporting.
 Flexibility.
 Improve resource user.
 Reduction in use of the paper.
 Reduction in man power.
 Administrator controls the entire system.

Identification of need:

Muddy’s Café is the system, which has developed to keep track of cash Information and
to maintain cash records easily, rapidly and accurately. It used to be quite difficult to
maintain all the records of cash operation held in a business effectively and accurately
and to maintain the paper files to store the details into it and to generate accurate detail of
each. In order to overcome this problem restaurant billing system is proposed, which help
us to generate customer information at any time on system. This system decreases time
taken to complete the task.

8
Preliminary Study:-

The current process of Cafes is slow. It take time to calculate the bill .
So, we need to develop software that can overcome all these problems. The proposed
system needs to provide a simple interface that should allow the customer to easily pay
their bills.

 EXISTING SYSTEM

The existing system was a manual system. This manual system had piles of
the paper work to be maintained to track the record of cash. Due to this a lot of the time
and energy was been utilized and this lead to wastage of important resources.
 Time consuming.
 Processing speed of the software is not so much good to operate fast.
 Sometimes the system hangs when work load is more.
 Limited space for storing the information
 Processing speed of the software is not so much good to operate fast.

9
FEASIBILITY STUDY

By the investigation, I have identified the need, problems and requirements. So my next
step was to determine exactly what the proposed system is to do by defining its expected
performance. This kind of work can be carried out in the Feasibility Study.
In the conduct of the feasibility study, I have gone through followings distinct, but inter-
related types of feasibility. These are:

1. Technical Feasibility
This system will be developed using VB .Net and SQL Server. As we require some
time to learn all these technologies, All these technologies are easy to learn and can
develop system very rapidly. After developing and deploying the system, student can
easily use it.

2. Economic Feasibility
As existing system is manual, where it is expensive to maintain, up to date, and
available on time. But proposed system will be computerized, so we can overcome all
limitations of existing system. Also with this new system insertion, deletion, and
modification of various data will be easier to handle.

This system will reduce the paperwork. And quality of data will be improved.

So keeping all above mentioned benefits and comparing with various expenditures of
resources, we conclude that proposed system is economical feasible.

10
3. OPERATIONAL FEASIBILITY

The new solution is feasible in all sense .student do not require to go search for different
social sites and can easily get the information regarding the specific persons. So it very
easy to handle no technical expertise are required.

11
Software Requirements Specification (SRS)

Introduction

The following subsections of the SRS document provide an overview of three tire SRS.

A. Purpose

The purpose of the project is to provide facility to the administrative staff as well as
member of the restaurant instead of managing all the task manually .This application will
help in managing tasks automatically.

B. Scope

The application will be used by administrative staff as well as member of the restaurant.
Member can view their bills record easily from the software.

C. Benefits

This application reduces the complexity, increase efficiency, increases accessibility and
saving time.

12
Functional Requirement

For this project we need the following functional requirement to be fulfilled:

 Login form that will allow the authorized user (admin, staff) to access the
software.
 We need to provide the facility to update bills record using which customer can
submit their feedback and other customer can check them thereafter.
 We need to provide the facility to the customer for checking their bills records and
then give review.

Non-Functional Requirement

 The software needs to be user friendly and easy to access so that the end user
(users and admin staff) can easily use this software.
 The software needs to be secure by implementing login using user ID and
Password.
 The software needs to be portable so that it can be run on any system.

13
TOOLS/PLATFORM USED

Hardware On Which Project Is Developed:


Laptop/Desktop

 RAM: 4 GB RAM
 PROCESSOR: Intel Core i3
 HARD DISK: 1TB Hard Disk

Software Using Which Project Is Developed:

 OPERATING SYSTEM: WINDOWS 8/10


 FRONT END: VB.NET 2012 PRO.
 BACK END/ DATABASE: SQL SERVER

14
DATA FLOW DIAGRAM

0-Level DFD:-

0.0
LOGIN
ADMINISTRATOR RESTAURAN
T BILLING
SYSTEM

VIEW
DETAILS

1-Level DFD:- FETCHING


DATABASE

0.0
LOGIN 1.1
Admin RESTAURANT CORRECT
BILLING SYSTEM MENU
PASSWORD

CHECK USER
OR PASSWRD

ERROR

15
1.1-LeveL DFD:-

1.1.1
PROCESS add
ADMINSTRATOR
1.1 Add item

LOGIN MENU

Generate 1.1.2

BILL
GENERATE

1.1.1-LEVEL

INSERT 1.1.1

Admin ADD ITEM DATABASE

DETAILS

FETCH

16
1.1.2-LEVEL DFD

1.1.2
Admin DATABASE
BILL GENERTAOR

BILL GENERATE

17
E-R Diagram
An entity-relationship model (ER model) describes inter-related things of interest in a
specific domain of knowledge. An ER model is composed of entity types (which classify
the things of interest) and specifies relationships that can exist between instances of those
entity types. In software engineering an ER model is commonly formed to represent things
that a business needs to remember in order to perform business processes. Consequently,
the ER model becomes an abstract data model that defines a data or information structure
that can be implemented in a database, typically a relational database.

USERNAME

MANAGES
ADMINISTRATOR Muddy’s Cafe

HAS BILL ID

PASSWORD GENERATE
BILL
BILL
DAY

BILL BILL
DATE AMOUNT

18
TESTING
1. Welcome screen:-

2. If the user choose Admin and input wrong


username/password:-

19
3. If the user choose Admin and input right
username/password:-

4. After successfully logged in , the Admin come to the home


page where the admin can view or manage their product:-

20
5.If the Admin wants to view the product:-

6.If the Admin wants to search any of the product he can


simply write up the name of the product or id or category in
the search box:-

21
7.If the Admin wants to manage the product:-

8.If the Admin wants to save the new product:-

9.If the Admin wants to delete the product:-

22
10.If the user is staff person and apply wrong
username/password :-

11. If the user is staff person and apply right


username/password :-

23
12. After successfully logged in , the Staff person come to the
home page where he/she can view or order the product:-

13.If the staff sperson want to view the product:-

24
14.If the user wants to search any of the product he can
simply write up the name of the product or id or category in
the search box:-

15.If the user wants to order any of the product for the
customer:-

25
16.In this the user can simply add the product to the
wishlist:-

17.If the user selects the product that is already selected


then:-

26
18.Here the user can update the quantity of the product or
delete the product as per customers requirement:-

19.Here the user cannot come to the next page unless and un
till the user can fill the customer details:-

27
20.After filling the customer details the person came to
payment column:-

21.If the user put the insufficient cash then:-

28
22.If the user input proper amount then :-

23.After the payment process is successful l then the user


can print the receipt:-

29
SYSTEM SECURITY MEASURES

Implementation of security for the developed project.

• The application is password protected for security and privacy.

• No one can add or delete records without the correct password.

• User can change password any time he/she wants.

30
APPENDICES

CODING:-
 LOGIN
Public Class login

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


txtun.Enabled = False
txtpass.Enabled = False

End Sub

Private Sub btnlog_Click(sender As Object, e As EventArgs) Handles btnlog.Click


Dim a As String
Dim b As String
a = txtun.Text
b = txtpass.Text

If rbAdmin.Checked = True Then


If a = "admin" And b = "123" Then
MessageBox.Show("Admin logged in successful")
rbAdmin.Checked = False
Me.Hide()
Home.Show()
Else
MessageBox.Show("wrong username and password")
End If
End If
If rbStaff.Checked = True Then
If a = "staff" And b = "123" Then
MessageBox.Show("staff logged in successful")
rbStaff.Checked = False
Me.Hide()
StaffHome.Show()
Else
MessageBox.Show("wrong username and password")
End If
End If

End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click


Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit", "Muddy's Cafe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If iExit = DialogResult.Yes Then
Application.Exit()
End If
End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click

31
txtun.Enabled = False
txtpass.Enabled = False
txtpass.Clear()
txtun.Clear()
rbAdmin.Checked = False
rbStaff.Checked = False
End Sub

Private Sub rbAdmin_CheckedChanged(sender As Object, e As EventArgs) Handles rbAdmin.CheckedChanged


If rbAdmin.Checked = True Then
txtun.Enabled = True
txtpass.Enabled = True
End If
End Sub

Private Sub rbStaff_CheckedChanged(sender As Object, e As EventArgs) Handles rbStaff.CheckedChanged


If rbStaff.Checked = True Then
txtun.Enabled = True
txtpass.Enabled = True
End If
End Sub
End Class

 ADMIN HOME
Imports System.Windows.Forms

Public Class Home

Private Sub ViewProductToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles


ViewProductToolStripMenuItem1.Click
Dim vwprod As New ViewProduct
vwprod.Show()
End Sub

Private Sub ManageProductToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles


ManageProductToolStripMenuItem1.Click
Dim prdmas As New ProductMaster
prdmas.Show()
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles
ExitToolStripMenuItem.Click
Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit", "Muddy's Cafe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If iExit = DialogResult.Yes Then
Application.Exit()
End If
End Sub

Private Sub BackToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles


BackToolStripMenuItem1.Click
Me.Close()
login.Show()
End Sub

Private Sub Home_Load(sender As Object, e As EventArgs) Handles MyBase.Load

32
End Sub
End Class

 STAFF HOME
Imports System.Windows.Forms

Public Class StaffHome

Private Sub ViewProductToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


ViewProductToolStripMenuItem.Click
Dim vwprod As New ViewProduct
vwprod.Show()
End Sub

Private Sub OrderToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


OrderToolStripMenuItem.Click
Dim order As New OrderMaster
order.Show()
End Sub

Private Sub BackToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


BackToolStripMenuItem.Click

Me.Close()

login.Show()

End Sub

Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles


ExitToolStripMenuItem.Click

Dim iExit As DialogResult

iExit = MessageBox.Show("Confirm if you want to exit", "Muddy's Cafe", MessageBoxButtons.YesNo,


MessageBoxIcon.Question)
If iExit = DialogResult.Yes Then
Application.Exit()
End If

End Sub

Private Sub StaffHome_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub MenuStrip1_ItemClicked(sender As Object, e As ToolStripItemClickedEventArgs) Handles


MenuStrip1.ItemClicked

End Sub
End Class

33
 PRODUCT MASTER

Imports System.Data.SqlClient
Imports System.Data
Public Class ProductMaster

Dim path As String = "Data


Source=(LocalDB)\v11.0;AttachDbFilename=E:\stepinrestaurent\StepIn\StepDB.mdf;Integrated
Security=True;Connect Timeout=30"
Dim conn As SqlConnection
Dim cmd As SqlCommand
Dim du As New DataUtility
Dim idd As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs)

End Sub
Public Sub comp()
For i As Integer = 0 To grdview.Rows.Count() - 1 Step +1
Dim cmpName As String
Dim cmpName1 As String
Dim cmpCate As String
Dim cmpCate1 As String
cmpName = grdview.Rows(i).Cells(1).Value
cmpCate = grdview.Rows(i).Cells(2).Value
cmpName1 = txtname.Text
cmpCate1 = cbcate.Text
If StrComp(cmpName, cmpName1) = 0 Then
MessageBox.Show("Already Availabe")
allclear()
Exit For
End If
Next

End Sub

Private Sub button1_Click_1(sender As Object, e As EventArgs) Handles button1.Click

comp()
If txtname.Text <> "" And txtbal.Text <> "" And txtpri.Text <> "" And cbcate.Text <> "" Then
Dim sql As String = "insert into product values('" + txtname.Text + "','" + cbcate.Text + "'," + txtpri.Text + "," +
txtbal.Text + ")"
du.executeMySQL(sql)
fillgrid()
MessageBox.Show("Record Saved")
cbcate.Text = ""
allclear()
End If
End Sub

Public Sub allclear()


cbcate.Text = ""

txtname.Clear()
txtpri.Clear()
txtbal.Clear()
End Sub

Private Sub ProductMaster_Load(sender As Object, e As EventArgs) Handles MyBase.Load

34
fillgrid()
End Sub
Public Sub fillgrid()
Dim dt As New DataTable
dt = du.getDataTable("select * from Product")
grdview.DataSource = dt
End Sub

Private Sub grdview_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles


grdview.CellClick
Try
idd = grdview.Item(0, e.RowIndex).Value
txtname.Text = grdview.Item(1, e.RowIndex).Value
cbcate.Text = grdview.Item(2, e.RowIndex).Value
txtpri.Text = grdview.Item(3, e.RowIndex).Value
txtbal.Text = grdview.Item(4, e.RowIndex).Value
Catch ex As Exception

End Try
End Sub

Private Sub btnupdt_Click(sender As Object, e As EventArgs) Handles btnupdt.Click

Dim sql As String


Try
If txtname.Text <> "" And txtbal.Text <> "" And txtpri.Text <> "" And cbcate.Text <> "" Then

sql = "update Product Set PrdName='" + txtname.Text + "',PrdCate='" + cbcate.Text + "',PrdPrice =" +
txtpri.Text + ",Quantity=" + txtbal.Text + " where id = " + idd.ToString() + ""
du.executeMySQL(sql)
fillgrid()
MessageBox.Show(sql)

MessageBox.Show("Update")

End If
Catch ex As Exception

End Try
allclear()
fillgrid()
End Sub

Private Sub btndel_Click(sender As Object, e As EventArgs) Handles btndel.Click


Dim sql As String
sql = "delete from Product where id=" + idd.ToString

du.executeMySQL(sql)
MessageBox.Show("Deleted...")
allclear()
fillgrid()
End Sub

Private Sub btnback_Click(sender As Object, e As EventArgs) Handles btnback.Click


Home.Show()
Me.Hide()

End Sub

35
Private Sub btnDelAll_Click(sender As Object, e As EventArgs)
Dim idel As DialogResult
idel = MessageBox.Show("Confirm if you want to delete", "Muddy's Cafe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If idel = DialogResult.Yes Then
grdview.DataSource.clear()
End If

End Sub
End Class

 VIEW PRODUCT
Imports System.Data.SqlClient
Imports System.Data

Public Class ViewProduct


Dim conn As New SqlConnection("Data
Source=(LocalDB)\v11.0;AttachDbFilename=E:\stepinrestaurent\StepIn\StepDB.mdf;Integrated
Security=True;Connect Timeout=30")

Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnClose.Click


Me.Close()
End Sub

Private Sub ViewProduct_Load(sender As Object, e As EventArgs) Handles MyBase.Load


FilterData("")
End Sub

Public Sub FilterData(valueToSearch As String)


'SELECT * From Product WHERE CONCAT(PrdName,PrdCate,PrdPrice,Balance) like'%F%'
Dim searchQuery As String = "SELECT * From Product WHERE CONCAT(Id,PrdName,PrdCate) like '%" &
valueToSearch & "%'"
Dim cmd As New SqlCommand(searchQuery, conn)
Dim adapter As New SqlDataAdapter(cmd)
Dim table As New DataTable()
adapter.Fill(table)
grdview.DataSource = table
End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged


FilterData(TextBox1.Text)
End Sub
End Class

 ORDER MASTER
Imports System.Data.SqlClient
Imports System.Data.DataTable
Imports System.Data

Public Class OrderMaster

36
Dim conn As New SqlConnection("Data
Source=(LocalDB)\v11.0;AttachDbFilename=E:\stepinrestaurent\StepIn\StepDB.mdf;Integrated
Security=True;Connect Timeout=30")
Dim du As New DataUtility
Dim cmd As SqlCommand
Dim idd As Integer
Dim table1 As New DataTable("Table1")
Dim index As Integer
Dim table As New DataTable()

Dim discount As Double = 0


Dim tax As Double = 0
Dim subtotal As Double = 0
Dim total As Double = 0
Dim subprice As Integer = 0

Private Sub OrderMaster_Load(sender As Object, e As EventArgs) Handles MyBase.Load


Timer1.Enabled = True
pnlPayment.Enabled = False
FilterData("")
table1.Columns.Add("ID", Type.GetType("System.Int32"))
table1.Columns.Add("Name", Type.GetType("System.String"))
table1.Columns.Add("Category", Type.GetType("System.String"))
table1.Columns.Add("Price", Type.GetType("System.Int32"))
table1.Columns.Add("Quantity", Type.GetType("System.Int32"))
table1.Columns.Add("Total Price", Type.GetType("System.Int32"))
End Sub

Public Sub FilterData(valueToSearch As String)


'SELECT * From Product WHERE CONCAT(PrdName,PrdCate,PrdPrice,Balance) like'%F%'
Dim searchQuery As String = "SELECT Id,PrdName,PrdCate,PrdPrice,Quantity From Product WHERE
CONCAT(Id,PrdName,PrdCate) like '%" & valueToSearch & "%'"
Dim cmd As New SqlCommand(searchQuery, conn)
Dim adapter As New SqlDataAdapter(cmd)
adapter.Fill(table)
grdview.DataSource = table
End Sub

Private Sub grdview_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles


grdview.CellContentClick
index = e.RowIndex
End Sub

Private Sub grdview_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles


grdview.CellClick
Try
txtid.Text = grdview.Item(0, e.RowIndex).Value
txtpn.Text = grdview.Item(1, e.RowIndex).Value
txtcate.Text = grdview.Item(2, e.RowIndex).Value
txtPri.Text = grdview.Item(3, e.RowIndex).Value

Catch ex As Exception
End Try
End Sub

Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnBack.Click


Dim iBack As DialogResult
iBack = MessageBox.Show("Confirm if you want to Back", "Muddy's Cafe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)

37
If iBack = DialogResult.Yes Then
Me.Close()
StaffHome.Show()
End If
End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged


FilterData(TextBox1.Text)
End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click


txtpn.Clear()
txtPri.Clear()
txtid.Clear()
End Sub
Public Sub cmp_prod()

For i As Integer = 0 To grdview1.Rows.Count() - 1 Step +1


Dim cmpName As String
Dim cmpName1 As String
Dim cmpCate As String
Dim cmpCate1 As String
cmpName = grdview1.Rows(i).Cells(1).Value
cmpCate = grdview1.Rows(i).Cells(2).Value
cmpName1 = txtpn.Text
cmpCate1 = txtcate.Text
If StrComp(cmpName, cmpName1) = 0 And StrComp(cmpCate, cmpCate1) = 0 Then
MessageBox.Show("You Already Taken")
txtpn.Text = ""
txtcate.Text = ""
txtPri.Text = ""
txtid.Text = ""
Exit For
End If
Next

End Sub

Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click


Dim cmpid As String
Dim cmpid1 As String
Dim q As String
Dim q1 As String
cmpid = txtid.Text
q = txtq.Text
For j As Integer = 0 To grdview.Rows.Count() - 1 Step +1
cmpid1 = grdview.Rows(j).Cells(0).Value

If StrComp(cmpid, cmpid1) = 0 Then


q1 = grdview.Rows(j).Cells(4).Value
If q > q1 Then
MessageBox.Show("you have " + q1 + " quantity of id " + cmpid1)
txtpn.Text = ""
txtcate.Text = ""
txtPri.Text = ""
txtid.Text = ""
txtq.Text = "1"
Else
cmp_prod()

38
If txtpn.Text <> "" And txtq.Text <> "" And txtPri.Text <> "" Then
If txtq.Text > 0 Then
Dim tprice As Integer
tprice = txtq.Text * txtPri.Text
table1.Rows.Add(txtid.Text, txtpn.Text, txtcate.Text, txtPri.Text, txtq.Text, tprice)
grdview1.DataSource = table1
subprice = subprice + tprice
btnBill.PerformClick()
txtq.Text = "1"
txtPri.Clear()
txtpn.Clear()
txtid.Clear()
Else
MessageBox.Show("Enter Quantity")
End If
End If
End If
Exit For
End If
Next

End Sub

Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click


Dim selectedRow As DataGridViewRow
selectedRow = grdview1.Rows(index)
Dim tprice As Integer = selectedRow.Cells(5).Value.ToString
subprice = subprice - tprice
Dim del As Integer
del = grdview1.CurrentCell.RowIndex
grdview1.Rows.RemoveAt(del)
btnBill.PerformClick()
End Sub

Private Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click


Dim nQuantity As Integer
nQuantity = InputBox("New Quantity : ")
Dim selectedRow As DataGridViewRow
selectedRow = grdview1.Rows(index)
Dim nPrice As Integer = selectedRow.Cells(3).Value.ToString
Dim tprice As Integer = selectedRow.Cells(5).Value.ToString
subprice = subprice - tprice
nPrice = nQuantity * nPrice
subprice = subprice + nPrice
selectedRow.Cells(4).Value = nQuantity
selectedRow.Cells(5).Value = nPrice
btnBill.PerformClick()
End Sub

Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint


btnDate.Text = Date.Now.ToString("dd-MMM-yyyy")
btnTime.Text = Date.Now.ToString("hh:mm:ss")
End Sub
Public Sub quan()
Dim obj As New ProductMaster
Dim cmpid As String
Dim cmpid1 As String
Dim q As String
Dim q1 As String
For i As Integer = 0 To grdview1.Rows.Count() - 1 Step +1

39
cmpid = grdview1.Rows(i).Cells(0).Value
q = grdview1.Rows(i).Cells(4).Value
For j As Integer = 0 To grdview.Rows.Count() - 1 Step +1
cmpid1 = grdview.Rows(j).Cells(0).Value

If StrComp(cmpid, cmpid1) = 0 Then


q1 = grdview.Rows(j).Cells(4).Value
Dim sql As String
q1 = q1 - q
Try
sql = "update Product Set Quantity=" + q1 + " where Id=" + cmpid1
du.executeMySQL(sql)
obj.fillgrid()
Catch ex As Exception

End Try
End If
Next
Next
End Sub

Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnNext.Click


quan()
If txtName.Text = "" Then
MessageBox.Show("Enter Your Name")
ElseIf txtContact.Text = "" Then
If Len(txtContact.Text) < 10 Then
MessageBox.Show("Input 10 digit no")
txtContact.Text = ""
Else
MessageBox.Show("Enter Your Contact")
End If

ElseIf txtBill.Text = "0" Then


MessageBox.Show("Select Your Meal")
Else
txtName.Enabled = False
txtContact.Enabled = False
txtq.Enabled = False
For Each btn In {btnAdd, btnBack, btnBill, btnClear, btnDelete, btnUpdate, btnDelAll}
btn.Enabled = False
Next
pnlPayment.Enabled = True
btnNext.Enabled = False

End If
End Sub

Private Sub Numbers_only(sender As Object, e As KeyPressEventArgs) Handles txtContact.KeyPress,


txtCash.KeyPress, txtq.KeyPress
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End If
End Sub

40
Private Sub grdview1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles
grdview1.CellContentClick
index = e.RowIndex
End Sub

Private Sub btnBill_Click(sender As Object, e As EventArgs) Handles btnBill.Click


txtBill.Text = subprice
End Sub

Private Sub btnDelAll_Click(sender As Object, e As EventArgs) Handles btnDelAll.Click


Me.table1.Rows.Clear()
subprice = 0
btnBill.PerformClick()
End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click


Dim iExit As DialogResult
iExit = MessageBox.Show("Confirm if you want to exit", "Muddy's Cafe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If iExit = DialogResult.Yes Then
Application.Exit()
End If
End Sub

Private Sub pnlPayment_Paint(sender As Object, e As PaintEventArgs) Handles pnlPayment.Paint


txtDiscount.Text = 0
For Each txt In {txtTax, txtDiscount, txtTotal, txtChange}
txt.Enabled = False
Next
subtotal = txtBill.Text
txtSubTotal.Text = FormatNumber(subtotal, 2)
If subtotal >= 500 Then
discount = subtotal * 20 / 100
txtDiscount.Text = FormatNumber(discount, 2)
End If
tax = subtotal * 5 / 100
txtTax.Text = FormatNumber(tax, 2)
total = subtotal + tax - discount
txtTotal.Text = FormatNumber(total, 2)
End Sub

Private Sub rbCash_CheckedChanged(sender As Object, e As EventArgs) Handles rbCash.CheckedChanged


If rbCash.Checked = True Then
txtCash.Enabled = True
End If
End Sub

Private Sub btnClear1_Click(sender As Object, e As EventArgs) Handles btnReset.Click


txtCash.Text = 0
txtChange.Enabled = False
txtChange.Text = ""
End Sub

Private Sub btnTotal_Click(sender As Object, e As EventArgs) Handles btnTotal.Click


Dim change As Double = 0
Dim cash As Double = 0
cash = txtCash.Text
If txtCash.Text <> 0 Then

41
If cash >= total Then
change = cash - total
txtChange.Text = FormatNumber(change, 2)
Else
MessageBox.Show("Insufficient Money")
End If
Else
MessageBox.Show("Enter cash First")
End If
End Sub

Private Sub btnReciept_Click(sender As Object, e As EventArgs) Handles btnReciept.Click

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


ViewProduct.Show()
End Sub

End Class

42
BIBLIOGRAPHY :-

Books

[1]A.Troelsen, The Complete Reference for Pro VB and the .NET 3.5 Platform

(Windows.Net), Hill Edition, Pageno:- 123-135

[2]S. Holzner, Programming Visual Basic .NET, Pageno:- 207-235

[3]C.Thomsen, Database Programming with Visual Basic.NET, Second Edition

Websites

Ieee STANDARDS FOR BIBLOGRAPHY

[4]VB.NET Introduction” www.codeproject.com ,Last Access 27/4/2018 11:00pm

[5] ”Feasibilities”, http://en.wikipedia.org/wiki/Feasibility study , Last Access 28/4/2018

10:22pm

[6]”Functional Requirements” , www.w3schools.com Last Access 29/4/2018 10:00pm

43

Você também pode gostar