Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Pizza ordering system in VB.

NET
Chapter 1
Introduction

Online Pizza ordering system is a web-based application that enables customers


to order their pizzas online for home delivery or pick up from the pizzeria. If you are
planning to do some other projects. You can get computer science final year project
help. There are a variety of food items available on this planet. Each country has its
own kind of dishes to offer.

But if we pick a food item which is loved by all the people on this planet, then
pizza will be a clear winner in it. I have listed more than 90 computer science projects,
Kindly check that. The whole world is in love with pizzas. The billions of dollars
earned by different pizzerias across the globe just prove this. The love of pizzas has
enabled the rise of large pizza companies like Pizza Hut, Domino’s, Papa John’s, and
much more.

As the internet users are increasing exponentially, these companies have


introduced an Online Pizza ordering system for taking orders from customers. This
system not only improves customer’s experience but also eases the workload on the
staff of pizzerias.

STC/SPRT/CSE/2022-2023 Page 1
Pizza ordering system in VB.NET
Chapter 2
Why an Online system for Pizza ordering was needed?

You must have ordered your pizzas by phone for home delivery. The process
seems easy to use but at times there is miscommunication. As there is no visual menu
shown during a phone call, the employees have to repeat a lot of things again and again
to the customers. It’s a time-consuming process that at times irritates customers.

Also, it takes a lot of time of the pizzeria staff. It would be much more
comfortable for the customers to have an online pizza ordering system. It would be
hassle-free for users as they can select the pizzas they want and make payment for it.
Also, it will reduce the purchasing time for customers. Let us look at another benefit of
using this system.

Suppose I go to a pizzeria and make the order. Even after ordering pizzas from
their outlet, I have to wait at least 15 minutes for my order to be ready. Wouldn’t it be
much more convenient if I ordered my pizzas before using a mobile app or an online
system and then it will tell me the time by which I have to pick my order from their
counter?

It would be great for me as I don’t need to wait for my pizza. I need to reach
there only when my pizza is ready. In a nutshell, we can say that improved and
efficient services are provided to the customers by the inclusion of internet in your
business. From a business point of view, it gives you an edge over your competitors.

STC/SPRT/CSE/2022-2023 Page 2
Pizza ordering system in VB.NET
Chapter 3
Objectives of Online Pizza Ordering System
The main objectives of this ordering system are:

Build your own pizza – This system will help customers in ordering custom pizzas. So,
the customer will pick exactly the things which he/she wants in their pizza. This will
surely enhance the image of the pizzeria and customer satisfaction will be more.

Online Payment– This system will give the option to the customer for online payment.
This will make the pizza buying experience cash-free.

Better Knowledge– This system will provide the customer all the details of his order
before making the order. This confirmation will help customers to check the items
ordered with their prices.

Know Delivery Time– This system will show the time by which the order will be
delivered to the customer. For pick-ups, customers can fix the time by which they will
pick their order.

Reduce Paper Work– As most of the things will be performed online, it will reduce the
usage of paper for the pizzeria.

Improves Efficiency–

This system will make things easier for staff as the whole ordering process is done by
the customer only.
These were the objectives of the online pizza ordering system.
Let us now get into the details of the working of this ordering system.

STC/SPRT/CSE/2022-2023 Page 3
Pizza ordering system in VB.NET
Chapter 4
Working

How this system works–


Let us now understand the working of this system. Whenever a customer visits the
webpage or mobile application of the pizzeria, he/she will have to select his location so
that the order is made to the nearest pizzeria. The menu will be visible to the customer
with the pizzas and other non-pizza products on offer. All the ingredients will be
shown at their prices.

Now the customer will customize his pizza and make changes in the ingredients if he
wishes and select the quantity for it. After selecting the items to be ordered, the
customer has to select the type of order whether it will be home delivery or pick up.
After that, the customer has to provide his/her details like name, phone number,
address, email id.

Now payment option is shown to the customer. He has to choose from the various
online payment methods or cash-on-delivery options. After this process, the order is
made and the customer is notified about the time by which the pizza will be delivered
to them.

The ER diagram for the online pizza ordering system is shown below:

Online Pizza Ordering System ERD


Online Pizza Ordering System ERD
Modules of online pizza ordering system:

There are 3 modules in this system. These modules are:

Ordering.
Order Processing.
Administration.
Let us now get into the details of these modules:

Ordering
This module will provide the interface for customers to order their pizzas:

Menu:
The system will provide customers a menu in which all the pizzas and non-pizza items
will be shown with their prices. The pizzas on the menu are created by the professional
chefs of the pizzeria.
The ingredients in this pizza can be changed according to the customer’s interests. The
customer can select any pizza from the menu or build a custom pizza.
Each pizza will be shown with its image and price. The ingredients used in the making
of that pizza can also be seen.
STC/SPRT/CSE/2022-2023 Page 4
Pizza ordering system in VB.NET
Each of these ingredients can be removed or other new ingredients can be added in the
order.
After each selection or de-selection, the grand total of the order will be updated.
Build Your Pizza:
One of the most amazing features of an online pizza ordering system is that you can
build your pizzas from the scratch. This system provides the options to create your
custom pizzas with everything of your choice. Let me tell you more about making
custom pizzas.

The customer will get an option to select the pizza’s crust size which can be small,
medium, or large.
Then the customer has to choose the sauce to be used on his pizza crust. These can
marinara, cheese, ranch, and others.
Then the system asks the customer whether to add cheese or not. He also has an option
to select extra cheese.
At last, the system shows the customers different types of toppings. Firstly, the
customer has to choose between veg. and non-veg. toppings. Suppose you selected
veg., then different options like pineapple, mushrooms, olives, etc. are shown.
One important point to be noticed here is after each step, the updated price of your
custom-built pizza is shown to the customers. Each item’s price is also reflected below
its image.

Add To Cart:
This feature is useful in a situation where you have to order more than one pizza or
other non-pizza items.
Suppose you have selected a Margherita pizza and now you want to select another
pizza as well. Then you just have to add that pizza to the cart using the Add to cart
option. Items added to the cart will be saved so that you can choose other pizzas as
well.

Finally, when you are ready to order you can check out from the cart to make payment.
Payment There will be basically 2 payment options i.e. online payment using
Credit/Debit cards and Internet banking or Cash on delivery. Before making payment,
your order details are shown and confirmed. This system makes transactions easier as
the need to pay with cash is not there.

Home Delivery or Pick up. This feature asks the customer if he/she intends to pick up
his/her order from the pizzeria or it is needed to be delivered to their address.

Track your Order:


This is another interesting feature which helps customers to keep a track of his order.
The customer is notified at every step of their order completion. After making payment
the customer is shown the time by which his order will be delivered to his doorstep.

STC/SPRT/CSE/2022-2023 Page 5
Pizza ordering system in VB.NET
Order Processing
In the previous section, I told you all about pizza ordering by customers. But what
happens after this. How the pizzeria manages the order made by the customer and
delivers it on time. The online pizza ordering system comes to their rescue again. It
provides all the features and functionalities for processing orders without any fuss for
the staff of the pizzeria.

This module will be used by the employees of the pizzeria for preparing orders and
delivering them to their destination. Each employee of the pizzeria will have an
account in this ordering system. They will have a username and password provided to
them by the system admin. Mainly there are three types of employees using the online
pizza ordering system.

STC/SPRT/CSE/2022-2023 Page 6
Pizza ordering system in VB.NET
Chapter 5
Program
Public Class Form1 If InStr(1, strAllowedChars,
Dim con As New txtTel.Text(i)) = 0 Then
OleDb.OleDbConnection Return False
Dim ds As New DataSet End If
Dim da As OleDb.OleDbDataAdapter Next
Dim sql As String Return True
Dim cmd As OleDb.OleDbCommand End If
End Function
'Declare control arrays Private Sub cmdContinue_Click(ByVal
Dim RadioArrayTopping(0 To 2) As sender As System.Object, ByVal e As
RadioButton System.EventArgs) Handles
Dim RadioArrayBase(0 To 2) As cmdContinue.Click
RadioButton If checkTelNum() = False Then
Dim CheckArrayExtras(0 To 3) As MsgBox("You have not Entered a
CheckBox valid Telephone No.")
Dim Topping() As String = txtTel.Focus()
{"Margherita", "Four Seasons", "Meat Exit Sub
Feast"}
Dim Base() As String = {"9""", "12""", End If
"14"""} 'If Telephone No. is valid , disable
Dim Extras() As String = {"Mushrooms", telephone Textbox
"Green Peppers", "Anchovies", "Cheese"} '& Enable main Form Functionality
Dim Drinks() As String = {"Cola", cmdContinue.Enabled = False
"Lemonade", "Orange", "Mineral Water"} txtTel.Enabled = False
Dim PizzaPrice(,) As Single = {{30, 40,
55}, {35, 45, 60}, {40, 50, 65}} pnlLeft.Enabled = True
Dim ExtraPrice() As Single = {5, 4, 6, 5} pnlRight.Enabled = True
Dim DrinkPrice() As Single = {1.0, 1.0, enableCustomerInput()
1.0, 0.9}
Dim itemNo As Integer = -1 'Opne database & check for exixting
Dim strOrder01 As String = "" customer using telephone No.
Dim strOrder02 As String = "" con.ConnectionString =
Dim strDrinks As String = "" "Provider=Microsoft.ACE.OLEDB.12.0;Dat
Dim pizzaVal, drinkVal, orderVal, a Source=D:\Pizza.accdb;"
delivery, total As Single con.ConnectionString &= "Persist
Dim pizzaArray(-1) As pizzaStruct Security Info=False;"
Dim drinkSelection As drinkStruct con.Open()
sql = "Select * FROM Customer
WHERE TelephoneNo='" & txtTel.Text &
"'"
da = New
Function checkTelNum() As Boolean OleDb.OleDbDataAdapter(sql, con)
'make sure telephone No. is valid da.Fill(ds, "Customer")
Dim strAllowedChars As String = con.Close()
"0123456789() -+ " If ds.Tables("Customer").Rows.Count =
If Len(txtTel.Text) < 5 Then 0 Then
Return False 'if customer Telephone No not Found
Else 'move focus to customer First name
For i = 0 To Len(txtTel.Text) - 1 Input Box
STC/SPRT/CSE/2022-2023 Page 7
Pizza ordering system in VB.NET
MsgBox("Number Not Found In txtAddress01.Enabled = True
Database", MsgBoxStyle.Critical) txtAddress02.Enabled = True
cmdSave.Enabled = True txtTown.Enabled = True
txtForename.Focus() txtPostcode.Enabled = True
Exit Sub
Else End Sub
'otherwise Add customer details in Sub disableCustomerInput()
database 'Prevent customer details being
txtTel.Text = accidentally change
ds.Tables("Customer").Rows(0).Item(0)
txtSurname.Text = cmdSave.Enabled = False
ds.Tables("Customer").Rows(0).Item(1) txtForename.Enabled = False
txtForename.Text = txtSurname.Enabled = False
ds.Tables("Customer").Rows(0).Item(2) txtAddress01.Enabled = False
txtAddress01.Text = txtAddress02.Enabled = False
ds.Tables("Customer").Rows(0).Item(3) txtTown.Enabled = False
txtAddress02.Text = txtPostcode.Enabled = False
ds.Tables("Customer").Rows(0).Item(4)
txtTown.Text = End Sub
ds.Tables("Customer").Rows(0).Item(5) Sub enablePizzaInput()
txtPostcode.Text = 'Allow further pizza selection to be
ds.Tables("Customer").Rows(0).Item(6) made
'Protect customer details form change cmdAddItem.Enabled = True
disableCustomerInput() pnlTopping.Enabled = True
pnlBase.Enabled = True
pnlExtras.Enabled = True
End If
End Sub

Function checkCustomer() As Boolean


End Sub 'make sure customer details are
Structure pizzaStruct complete
Dim Topp As Integer If txtSurname.Text = "" Then
Dim Base As Integer MsgBox("please enter the customer's
Dim Ex00 As Boolean Surname")
Dim Ex01 As Boolean Return False
Dim Ex02 As Boolean ElseIf txtAddress01.Text = "" Then
Dim Ex03 As Boolean MsgBox("please enter the customer's
End Structure Address")
Structure drinkStruct Return False
Dim Drink00 As Integer ElseIf txtPostcode.Text = "" Then
Dim Drink01 As Integer MsgBox("please enter the customer's
Dim Drink02 As Integer PIN Code")
Dim Drink03 As Integer Return False
End Structure Else
Sub enableCustomerInput() Return True
'Allow new customer details to be
enterd End If
cmdSave.Enabled = True End Function
txtSurname.Enabled = True
txtForename.Enabled = True Private Sub Form1_Load(ByVal sender
STC/SPRT/CSE/2022-2023 Page 8
Pizza ordering system in VB.NET
As System.Object, ByVal e As RadioArrayTopping(i).Checked =
System.EventArgs) Handles MyBase.Load False
RadioArrayTopping(0) = radTop00 RadioArrayBase(i).Checked = False
RadioArrayTopping(1) = radTop01
RadioArrayTopping(2) = radTop02 Next
RadioArrayBase(0) = radBas00 For i = 0 To 3
RadioArrayBase(1) = radBas01 CheckArrayExtras(i).Checked =
RadioArrayBase(2) = radBas02 False
CheckArrayExtras(0) = chkExt00
CheckArrayExtras(1) = chkExt01 Next
CheckArrayExtras(2) = chkExt02 End Sub
CheckArrayExtras(3) = chkExt03
'Initialise order Private Sub cmdSave_Click(ByVal sender
clearOder() As System.Object, ByVal e As
System.EventArgs) Handles cmdSave.Click
End Sub Dim count As Integer = 0
If checkCustomer() = False Then Exit
Sub clearOder() Sub
'Reset Program variable and control con.Open()
ds.Clear() sql = "INSERT into Customer values('"
nudDrk00.Value = 0 + txtTel.Text + "','" + txtSurname.Text + "','"
nudDrk01.Value = 0 + txtForename.Text + "','" +
nudDrk02.Value = 0 txtAddress01.Text + "','" +
nudDrk03.Value = 0 txtAddress02.Text + "','" + txtTown.Text +
"','" + txtPostcode.Text + "')"
txtTel.Clear() cmd = New
txtSurname.Clear() OleDb.OleDbCommand(sql, con)
txtForename.Clear() count = cmd.ExecuteNonQuery()
txtAddress01.Clear() If count > 0 Then
txtAddress02.Clear() MsgBox("Customer Record Saved
txtTown.Clear() successfully", MsgBoxStyle.Information)
txtPostcode.Clear() disableCustomerInput()
strOrder01 = "" End If
txtOrder.Text = "" con.Close()
lblOderValue.Text = ""
lblDeliveryCharge.Text = "" End Sub
lblOderTotal.Text = "" Function addItem() As Boolean
itemNo = -1 'Declare local variables
orderVal = 0 Dim toppingSelected As Boolean =
delivery = 0 False
total = 0 Dim baseSelected As Boolean = False
enablePizzaInput() Dim top, bas As Integer
clearItem() 'Check that a base and a topping are
selected and get choices
For i = 0 To 2
End Sub If RadioArrayTopping(i).Checked =
True Then
Sub clearItem() toppingSelected = True
top = i
'clear current pizza selection End If
For i = 0 To 2 If RadioArrayBase(i).Checked =
STC/SPRT/CSE/2022-2023 Page 9
Pizza ordering system in VB.NET
True Then If pizzaArray(itemNo).Ex02 = True
baseSelected = True Then pizzaVal += ExtraPrice(2)
bas = i If pizzaArray(itemNo).Ex03 = True
End If Then pizzaVal += ExtraPrice(3)
Next Next
'If either base or topping not selected,
prompt user orderVal = pizzaVal + drinkVal
If toppingSelected = False Then 'Calculate order value
MsgBox("You have not selected a
topping.") If orderVal >= 10.0 Then
Return False 'If order value is £10.00 or more
End If delivery is free
If baseSelected = False Then delivery = 0.0
MsgBox("You have not selected a Else
base.") 'If order value is less than £10.00
Return False delivery is £2.00
Else delivery = 2.0
'Increment item number End If
itemNo += 1
'If this is first pizza item enable total = orderVal + delivery 'Calculate
drinks panel total to pay
If itemNo = 0 Then
pnlDrinks.Enabled = True 'Update order display
'Increase the size of the pizza item txtOrder.Text = strOrder01
array dynamically lblOderValue.Text = Format(orderVal,
ReDim Preserve pizzaArray(itemNo) "currency")
'Save user choices lblDeliveryCharge.Text =
pizzaArray(itemNo).Topp = top Format(delivery, "currency")
pizzaArray(itemNo).Base = bas lblOderTotal.Text = Format(total,
pizzaArray(itemNo).Ex00 = "currency")
CheckArrayExtras(0).Checked clearItem() 'clear pizza selection ready
pizzaArray(itemNo).Ex01 = for next selection
CheckArrayExtras(1).Checked If itemNo > 14 Then
pizzaArray(itemNo).Ex02 = 'Number of items per order is limited
CheckArrayExtras(2).Checked to 15 - disable input of further items
pizzaArray(itemNo).Ex03 = MsgBox("You have reached the
CheckArrayExtras(3).Checked maximum number of items for a single
End If order.")
cmdAddItem.Enabled = False
pizzaVal = 0 'Reset pizza item value pnlTopping.Enabled = False
pnlBase.Enabled = False
For i = 0 To itemNo pnlExtras.Enabled = False
'Calculate total value of pizzas End If
currently selected Return True 'Item was added to order
pizzaVal += End Function
PizzaPrice(pizzaArray(i).Topp, Sub writeOrder()
pizzaArray(i).Base) 'Construct order string - if order has
If pizzaArray(itemNo).Ex00 = True more than 7 items not including drinks,
Then pizzaVal += ExtraPrice(0) 'create a second order string to enable
If pizzaArray(itemNo).Ex01 = True printing of delivery note on two pages
Then pizzaVal += ExtraPrice(1) Dim limit As Integer
STC/SPRT/CSE/2022-2023 Page 10
Pizza ordering system in VB.NET
txtOrder.Text = "" And pizzaArray(i).Ex03 = False) Then
strOrder01 = "" strOrder02 &= ", no extras."
strOrder02 = "" Else
If itemNo > -1 Then strOrder02 &= ", with extra: "
If itemNo > 6 Then End If
limit = 6 'Limit first page of If pizzaArray(i).Ex00 = True
delivery note to 7 items Then strOrder02 &= vbNewLine & " " &
Else Extras(0)
limit = itemNo If pizzaArray(i).Ex01 = True
End If Then strOrder02 &= vbNewLine & " " &
For i = 0 To limit 'Create order string Extras(1)
for first page of delivery note If pizzaArray(i).Ex02 = True
strOrder01 &= "1 x " Then strOrder02 &= vbNewLine & " " &
strOrder01 &= Extras(2)
Base(pizzaArray(i).Base) & " " If pizzaArray(i).Ex03 = True
strOrder01 &= Then strOrder02 &= vbNewLine & " " &
Topping(pizzaArray(i).Topp) Extras(3)
If (pizzaArray(i).Ex00 = False And strOrder02 &= vbNewLine &
pizzaArray(i).Ex01 = False And _ vbNewLine
pizzaArray(i).Ex02 = False And Next
pizzaArray(i).Ex03 = False) Then End If
strOrder01 &= ", no extras." End If
Else writeDrinks() 'Call procedure to create
strOrder01 &= ", with extra: " list of drinks ordered
End If txtOrder.Text = strOrder01 &
If pizzaArray(i).Ex00 = True Then strOrder02 & strDrinks 'Concatenate strings
strOrder01 &= vbNewLine & " " & for screen output
Extras(0) 'Update display values for goods value,
If pizzaArray(i).Ex01 = True Then delivery charge and total order value
strOrder01 &= vbNewLine & " " & lblOderValue.Text = Format(orderVal,
Extras(1) "currency")
If pizzaArray(i).Ex02 = True Then lblDeliveryCharge.Text =
strOrder01 &= vbNewLine & " " & Format(delivery, "currency")
Extras(2) lblOderTotal.Text = Format(total,
If pizzaArray(i).Ex03 = True Then "currency")
strOrder01 &= vbNewLine & " " & End Sub
Extras(3)
strOrder01 &= vbNewLine & Sub writeDrinks()
vbNewLine 'Construct list of drinks and quantities
Next ordered (appended to order string)
If itemNo > 6 Then 'Create order If drinkSelection.Drink00 = 0 And
string for second page of delivery note drinkSelection.Drink01 = 0 And _
For i = 7 To itemNo drinkSelection.Drink02 = 0 And
strOrder02 &= "1 x " drinkSelection.Drink03 = 0 Then
strOrder02 &= Exit Sub
Base(pizzaArray(i).Base) & " " End If
strOrder02 &= strDrinks = "Drinks:" & vbNewLine
Topping(pizzaArray(i).Topp) If drinkSelection.Drink00 > 0 Then
If (pizzaArray(i).Ex00 = False strDrinks &= " " &
And pizzaArray(i).Ex01 = False And _ drinkSelection.Drink00 & " x " & Drinks(0)
pizzaArray(i).Ex02 = False & vbNewLine
STC/SPRT/CSE/2022-2023 Page 11
Pizza ordering system in VB.NET
End If 'Get quantities of each drink selected
If drinkSelection.Drink01 > 0 Then drinkSelection.Drink00 =
strDrinks &= " " & nudDrk00.Value
drinkSelection.Drink01 & " x " & Drinks(1) drinkSelection.Drink01 =
& vbNewLine nudDrk01.Value
End If drinkSelection.Drink02 =
If drinkSelection.Drink02 > 0 Then nudDrk02.Value
strDrinks &= " " & drinkSelection.Drink03 =
drinkSelection.Drink02 & " x " & Drinks(2) nudDrk03.Value
& vbNewLine
End If drinkVal = 0 'Initialise value of drinks
If drinkSelection.Drink03 > 0 Then to zero
strDrinks &= " " &
drinkSelection.Drink03 & " x " & Drinks(3) 'Calculate total value of drinks selected
& vbNewLine drinkVal += DrinkPrice(0) *
End If drinkSelection.Drink00
strDrinks &= vbNewLine & drinkVal += DrinkPrice(1) *
vbNewLine drinkSelection.Drink01
End Sub drinkVal += DrinkPrice(2) *
drinkSelection.Drink02
Private Sub cmdAddItem_Click(ByVal drinkVal += DrinkPrice(3) *
sender As System.Object, ByVal e As drinkSelection.Drink03
System.EventArgs) Handles
cmdAddItem.Click orderVal = pizzaVal + drinkVal
If addItem() = False Then 'calculate order value
Exit Sub
Else 'Determine whether delivery charge
writeOrder() should be applied
End If If orderVal >= 10.0 Then
End Sub delivery = 0.0
Else
Private Sub cmdClear_Click(ByVal delivery = 2.0
sender As System.Object, ByVal e As End If
System.EventArgs) Handles cmdClear.Click
clearOder() total = orderVal + delivery 'calculate
cmdContinue.Enabled = True total to pay
txtTel.Enabled = True
pnlLeft.Enabled = False 'Update order details and clear current
pnlRight.Enabled = False pizza item
End Sub txtOrder.Text = strOrder01
lblOderValue.Text = Format(orderVal,
Private Sub "currency")
nudDrk00_ValueChanged(ByVal sender As lblDeliveryCharge.Text =
System.Object, ByVal e As Format(delivery, "currency")
System.EventArgs) Handles lblOderTotal.Text = Format(total,
nudDrk00.ValueChanged "currency")
addDrinks() clearItem()
writeOrder() End Sub

End Sub Private Sub


Sub addDrinks() nudDrk01_ValueChanged(ByVal sender As
STC/SPRT/CSE/2022-2023 Page 12
Pizza ordering system in VB.NET
System.Object, ByVal e As Dim headerFont As Font = New
System.EventArgs) Handles Font("Arial", 24, GraphicsUnit.Point)
nudDrk01.ValueChanged Dim detailFontBold As Font = New
addDrinks() Font("Arial", 10, FontStyle.Bold,
writeOrder() GraphicsUnit.Point)
End Sub Dim detailFont As Font = New
Font("Arial", 10, GraphicsUnit.Point)
Private Sub Dim headerBrush As Brush =
nudDrk02_ValueChanged(ByVal sender As Brushes.Blue
System.Object, ByVal e As Dim detailBrush As Brush =
System.EventArgs) Handles Brushes.Red
nudDrk02.ValueChanged Dim x As Single
addDrinks() Dim y As Single
writeOrder() Dim strOutput As String
End Sub e.Graphics.PageUnit =
GraphicsUnit.Inch 'set Print Units
Private Sub Label1_Click(sender As 'write method to send them to the
Object, e As EventArgs) Handles printer
Label1.Click strOutput = "CODER PIZZA Delivery
Service"
End Sub x = (e.MarginBounds.Left /
e.Graphics.DpiX) + 0.5
Private Sub y = (e.MarginBounds.Top /
nudDrk03_ValueChanged(ByVal sender As e.Graphics.DpiY) + 0.5
System.Object, ByVal e As e.Graphics.DrawString(strOutput,
System.EventArgs) Handles headerFont, headerBrush, x, y)
nudDrk03.ValueChanged y += 1
addDrinks() strOutput = "Delivery Address:"
writeOrder() e.Graphics.DrawString(strOutput,
End Sub detailFontBold, detailBrush, x, y)
x += 1.5
Private Sub cmdPrint_Click(ByVal sender strOutput = txtForename.Text & "" &
As System.Object, ByVal e As txtSurname.Text
System.EventArgs) Handles cmdPrint.Click e.Graphics.DrawString(strOutput,
If checkCustomer() = False Then Exit detailFont, detailBrush, x, y)
Sub strOutput = txtAddress01.Text
prtDeliveryNote.Print() y +=
If itemNo > 6 Then (e.Graphics.MeasureString(strOutput,
prtContinuation.Print() detailFont).Height)
e.Graphics.DrawString(strOutput,
End If detailFont, detailBrush, x, y)
End Sub If txtAddress02.Text <> "" Then
strOutput = txtAddress02.Text
Private Sub y +=
prtDeliveryNote_PrintPage(ByVal sender As (e.Graphics.MeasureString(strOutput,
System.Object, ByVal e As detailFont).Height)
System.Drawing.Printing.PrintPageEventAr e.Graphics.DrawString(strOutput,
gs) Handles prtDeliveryNote.PrintPage detailFont, detailBrush, x, y)

'Declare variable for delivery note print End If


procedure strOutput = txtTown.Text & "" &
STC/SPRT/CSE/2022-2023 Page 13
Pizza ordering system in VB.NET
txtPostcode.Text x -= 1.5
y +=
(e.Graphics.MeasureString(strOutput, strOutput = "Total Rs."
detailFont).Height) e.Graphics.DrawString(strOutput,
e.Graphics.DrawString(strOutput, detailFontBold, detailBrush, x, y)
detailFont, detailBrush, x, y) x += 1.5
y += 0.5 strOutput = "Rs." & "" &
x -= 1.5 CStr(Format(total, "Fixed")).PadLeft(4)
strOutput = "Telephone:" e.Graphics.DrawString(strOutput,
e.Graphics.DrawString(strOutput, detailFontBold, detailBrush, x, y)
detailFont, detailBrush, x, y)
x += 1.5 'Return false when no more pages...
strOutput = txtTel.Text e.HasMorePages = False
e.Graphics.DrawString(strOutput,
detailFontBold, detailBrush, x, y)
y += 0.5
x -= 1.5
strOutput = "Order:"
e.Graphics.DrawString(strOutput, End Sub
detailFontBold, detailBrush, x, y)
x += 1.5 Private Sub
If itemNo <= 6 Then prtContinuation_PrintPage(ByVal sender As
strOutput = strOrder01 & strDrinks System.Object, ByVal e As
Else System.Drawing.Printing.PrintPageEventAr
strOutput = strOrder01 & vbNewLine gs) Handles prtContinuation.PrintPage
& vbNewLine & "Continued" 'Print continuation page if more than 7
End If items ordered (not including drinks)
e.Graphics.DrawString(strOutput, Dim headerFont As Font = New
detailFont, detailBrush, x, y) Font("Arial", 24, GraphicsUnit.Point)
y=9 Dim detailFontBold As Font = New
x = 5.5 Font("Arial", 10, FontStyle.Bold,
strOutput = "Order value:" GraphicsUnit.Point)
e.Graphics.DrawString(strOutput, Dim detailFont As Font = New
detailFontBold, detailBrush, x, y) Font("Arial", 10, GraphicsUnit.Point)
x += 1.5 Dim headerBrush As Brush =
strOutput = "Rs." & Brushes.Blue
CStr(Format(orderVal, "Fixed")).PadLeft(4) Dim detailBrush As Brush =
e.Graphics.DrawString(strOutput, Brushes.Red
detailFont, detailBrush, x, y) Dim x As Single
y += 0.5 Dim y As Single
x -= 1.5 Dim strOutput As String
strOutput = "Delivery:" e.Graphics.PageUnit =
e.Graphics.DrawString(strOutput, GraphicsUnit.Inch
detailFont, detailBrush, x, y) strOutput = "CODER PIZZA Delivery
Service"
x += 1.5 x = (e.MarginBounds.Left /
strOutput = "Rs." & e.Graphics.DpiX) + 0.5
CStr(Format(delivery, "Fixed")).PadLeft(4) y = (e.MarginBounds.Left /
e.Graphics.DrawString(strOutput, e.Graphics.DpiY) + 0.5
detailFont, detailBrush, x, y) e.Graphics.DrawString(strOutput,
y += 0.5 headerFont, headerBrush, x, y)
STC/SPRT/CSE/2022-2023 Page 14
Pizza ordering system in VB.NET
y += 1 e.HasMorePages = False
strOutput = "Order Continued" 'Now Code complete
e.Graphics.DrawString(strOutput,
detailFontBold, detailBrush, x, y) End Sub
x += 1.5 End Class
strOutput = strOrder01 & strDrinks
e.Graphics.DrawString(strOutput,
detailFont, detailBrush, x, y)

STC/SPRT/CSE/2022-2023 Page 15
Pizza ordering system in VB.NET

Chapter 6
Output
l

STC/SPRT/CSE/2022-2023 Page 16
Pizza ordering system in VB.NET
Conclusion
This was all about the online pizza ordering system. You know the importance of this system in
our day-to-day lives as we all prefer online ordering over-ordering on phone. All these modules can be
implemented in the web application or a mobile application (Android, iOS, and windows). This project can
be developed in any technology or programming language.

STC/SPRT/CSE/2022-2023 Page 17

You might also like