0% found this document useful (0 votes)
183 views50 pages

Master Siomai POS System Overview

The document outlines the design and development of a point of sale system called "Master Siomai" for a siomai business that currently tracks transactions manually. It discusses assumptions, constraints, and risks around automating the transaction processing, record keeping, and reporting capabilities through a database-driven POS system to improve efficiency and management. The system is intended to allow fast, easy transactions with receipt printing while securely storing records for future analysis.

Uploaded by

Cheramie Ortojan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
183 views50 pages

Master Siomai POS System Overview

The document outlines the design and development of a point of sale system called "Master Siomai" for a siomai business that currently tracks transactions manually. It discusses assumptions, constraints, and risks around automating the transaction processing, record keeping, and reporting capabilities through a database-driven POS system to improve efficiency and management. The system is intended to allow fast, easy transactions with receipt printing while securely storing records for future analysis.

Uploaded by

Cheramie Ortojan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

1

MASTER SIOMAI

POINT OF SALE SYSTEM

A Database Management II Project

Presented to the Faculty Department of

ACLC College Taguig

In Partial Fulfilments of the Requirements of the course

Bachelor of Science in Information Technology

Proponents:

Ditucalan, Johaira

Oducayen, Jayson

Ortojan, Chermaine J.

Tan, Dexter James

April 2017
2

ACKNOWLEDGEMENT

We would like to express our sincerest gratitude to the following people that

exerted their effort for the accomplishment of this project.

Mr Mark Umadhay for giving us helpful advises that we can finish this project.

To our dearest family, relatives and friends who inspire us to finish this project for their

endless patience, understanding, and love.

To all person who made this research possible and to our Almighty God, for the strength,

knowledge, wisdom and guidance in completion of this study.


3

Table of Contents

1. Introduction ..................................................................................................................6

2. Overview .......................................................................................................................7

3. Assumptions/Constraints/Risks ..................................................................................8

3.1 Assumptions.......................................................................................................8

3.2 Constraints .........................................................................................................8

3.3 Risks...................................................................................................................8

4. Design Decisions ...........................................................................................................9

4.1 Key Factors Influencing Design ......................................................................10

4.2 Functional Design Decisions ...........................................................................11

4.3 Database Management System Decisions .......................................................11

4.4 Security and Privacy Design Decisions ........................................................... 12

4.5 Performance and Maintenance Design Decisions............................................12

5. Detailed Database Design ..........................................................................................13

5.1 Data Software Objects and Resultant Data Structures .....................................16

5.2 Database Management System Files ...17

6. Database Administration and Monitoring .............................................................. 18

6.1 Roles and Responsibilities ...............................................................................18

6.2 System Information ..........................................................................................19


4

6.2.1 Database Management System Configuration .................................................20

6.2.2 Database Support Software ..............................................................................21

6.2.3 Security and Privacy ........................................................................................21

6.3 Performance Monitoring and Database Efficiency ..........................................21

6.3.1 Operational Implications ..................................................................................22

6.3.2 Data Transfer Requirements ............................................................................22

6.3.3 Data Formats ....................................................................................................23

6.4 Backup and Recovery ......................................................................................24

Appendix A: Suggested Appendices ........................................................................ 25-27

Appendix B: Acronyms ..................................................................................................28

Appendix C: Glossary ....................................................................................................29

Appendix D: Approvals ..................................................................................................30

Appendix E: User Manual and Screen Shots ............................................................... 31

Appendix F: Codes.................................................................................................... 32-50

List of Figures

Figure 5.1 - Logical Data Model ..................................................................................13

Figure 5.2 - Physical Data Model (Product Table) .....................................................14

Figure 5.3 - Physical Data Model (Product Stocks Table) .........................................14


5

Figure 5.4 Data Structure (Products Table) ............................................................ 16

Figure 5.5 - Data Structure (Products Stocks Table) .................................................16

Figure 5.6 Physical Schema .......................................................................................17

Figure 5.7 Physical Schema .......................................................................................17

List of Tables

Table 1 Data Dictionary (Products Table) ............................................................... 15

Table 2 - Data Dictionary (Products Stocks Table)....15

Table 3 - Acronyms .......................................................................................................28

Table 4 - Glossary ..........................................................................................................29

Table 5 - Approvals .......................................................................................................30


6

1. Introduction

Now a day, most of the business depends on the fast-phased changing of

technologies being applied in the business. A quick Point of Sale process is the way that the

business can find it easier and better way to implement the Point of Sale System. The Point

of Sale proposed system will be implementing through the use of equipment like computers

and printers. Users can use this equipment in order to be done faster and easier.

Having the right POS System to run your business is critical to your business

support and proper functioning. A good POS system will save you time and money. It

allows you and your employees to concentrate on selling your products to your customers,

The Point of Sale software was built specifically for retailers, and small businesses

that require order capture, taking payments, processing returns, tracking inventory, generate

and print bar codes, and generate reports that helps managers of owners of such businesses

to make intelligent decisions about of what to change and not to change in order to continue

growing their business . It allows you to quickly process customers purchases which keep

your customers happy.


7

2. Overview

Our proposed system can compute, cancel, refresh and save transaction. All

transaction will be stored in a database for future use. The proposed system can do easy

and faster transaction. We decide to make a system for Master Siomai because they

only using notebook on keeping their files and transactions properly stored, we also

know that there are lot of people buying siomai in master siomai so its hard for them

manage every transaction manual so we try to make a system that will be very helpful

for them to manage all their transactions. The proposed system is user friendly and its

easy to use. It can update, cancel and save transactions. It can also compute

mathematical operation and can print receipt for costumers. All records can be stored in

database for several years.


8

Assumption/Constraints/Risks

3.1 Assumption

They dont have receipt. Can you make an official receipt exclusive only for Master

Siomai?

2. The transactions are recorded using by a notebook. Can you make a system that can

store the transactions and kept it for years?

3. They are using calculator in computing. Can you make a system that can

automatically compute the bills?

3.2 Constraints

Only the administrator can manage the system.

The cashier can only view and manipulate the billing section.

The previous study does not require an internet connection.

3.3 Risks

The proposed system dont have backup.


9

4. Design Decisions

Products

There are 4 fields which are the Product Type, Price, and Quantity.

Product Type - there are seven types of product type which are the Japanese

Siomai, Chicken Siomai, Beef Siomai, Pork Siomai, Shark Fin Siomai, Black

Gulaman, Master Rice.

Price - the price of each coffee.

Quantity - the quantity stands also for the stocks of each coffee.

Sales

There are 4 fields in sales which are the Sale Id, Product Name, Product Type,

Sale Date, Sale Quantity, Sale Price, Total Sale Price, and Sale User.

Product Type - are groups of products which share the same attributes.

Sale Quantity - The quantity or number of goods sold or services sold in the

normal operations of a company in a specified period.

Sale Price - the price at which something sells or is sold at after its price has

been reduced.

Totals Sale Price - total of the price at which something sells or is sold at after

its price has been reduced.


10

4.1 Key Factors Influencing Design

Performance

The database design is not time-consuming to get information from the database.

Availability

Manageability- the system is user friendly and it give consistent and accurate data

Security

Admin-The admin can access all the transactions in the system.

Cashier- the cashier has the access to payment and orders only.

Privacy

Both users have their own password.


11

4.2 Functional Design Decisions

Cancel Use to cancel all the data you input.

Save Use to save all the records or orders

Order - Use to list all the orders and go to billing section.

4.3 Database Management System Decisions

We use Microsoft SQL Server 2008 Management Studio Express because its

free also integrated environment for accessing, configuring, managing,

administering, and developing all components of SQL Server, as well as combining a

broad group of graphical tools and rich script editors that provide access to SQL

Server to developers and administrators of all skill levels


12

4.4 Security and Privacy Design Decisions

Admin

The duties of system administrators are wide ranging. It handles all the

transactions of the whole system.

Cashier

Can access to payment and orders only.

4.5 Performance and Maintenance Design Decisions

The proponents conducted a series of tests to ensure that the performance of

the system will be approved by our client. The systems performance is simple but

functional based on the needs of our client.


13

5. Detailed Database Design

This section structured in accordance to the information to be presented, and

may include discussions about or references to the following:

Figure 5.1

Logical Data Model (LDM)

Figure 5.1 shows the two major tables of Master Siomai which are related to each

other.
14

Product Table

Figure 5.2

Product Stocks Table

Figure 5.3

Physical Data Model (PDM)

Figure 5.2 and 5.3 shows the data types of each field of the two tables of Master

Siomai
15

Products
Field name Data Types Field Size
Chicken Int 4
Beef Int 4
Pork Int 4
Sharsfin Int 4
Gulaman Int 4
Master Int 4
Rice
Japanese Int 4
Table 1

Products
Field name Data Types Field Size
Chicken Stocks Int 4
Beef Stocks Int 4
Pork Stocks Int 4
Sharsfin Stocks Int 4
Gulaman Stocks Int 4
Master Rice Stocks Int 4
Japanese Stocks Int 4

Table 2
Data Dictionary

Table 1 and Table 2 show the data dictionary of each of the two tables of Master

Siomai. It includes the data type and the field size of each field.
16

5.1 Data Software Objects and Resultant Data Structures

The data structure of our system is composed of two major tables that are

related to each other; the applicants table and the financing record table.

Figure 5.4 Figure 5.5

Data Software

Figure 5.6 and Figure 5.7 shows the two tables of Master Siomai and their fields. It

shows the primary keys of one table.


17

5.2Database Management System Files

Figure 5.6

Figure 5.7

Physical Schema

Figure 5.6 and Figure5.7 shows the physical schema of the two tables of Master

Siomai.
18

6. Database Administration and Monitoring

The Service Level Agreement (SLAs) reflects our client-focused, services-based

commitment to you. Document is our responsibilities as a services provider and the clients

receiving services documents processes for requesting services. The following sub-section

describes the requirements and strategies to maintain the database operationally.

6.1 Roles and Responsibilities

The client role in the system is administrator which means it is only the person that

can update and add transaction and also the person that can manage the system. The user is

the person that can proceed to the billing section. The system is knowledgeable, it does not

require computer skills and since the system is based on our clients business it is easy for

our client to learn.


19

6.2 System Information

Visual Basic .NET (VB.NET) is a multi-paradigm, object-oriented programming

language, implemented on the .NET Framework. Microsoft launched VB.NET in 2002 as

the successor to its original Visual Basic language. Although the ".NET" portion of the

name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual

Basic languages releases since 2002, in order to distinguish between them and the classic

Visual Basic. Along with Visual C#, it is one of the two main languages targeting the .NET

framework.

Microsoft's integrated development environment (IDE) for developing in Visual

Basic .NET language is Visual Studio. Most of Visual Studio editions are commercial; the

only exceptions are Visual Studio Express and Visual Studio Community, which

are freeware. In addition, .NET Framework SDK includes a freeware command-

line compiler called vbc.exe. Mono also includes a command-line VB.NET compiler.

We use Visual Basic because its Easy to learn. With Visual Basic you can develop

Windows based applications and games. Visual Basic is much easier to learn than other

language (like Visual C++), and yet it's powerful programming language.

Visual Basic provides more of the actual code for a programmer than any others

non-visual programming language. This makes it a widely used programming language for

visual applications.
20

6.2.1 Database Management System Configuration

Software Requirements

Windows 10 Home Versions 10607

mySql R2 2008

Vb.net 2010

Hardware Requirements

Laptop

2GB RAM

32-bit Operating System

x64-based processor

HDD Storage
21

6.2.2 Database Support Software

Microsoft Visual Basic 2010 supports windows from Windows 7 Professional,

Windows 8 and Windows 10. System allocation for windows 7 professional is 16 GB for

the 32 bit OS, and 20 GB for the 64 bit OS. For windows 8 1 GB for the 32 bit OS, 2 GB for

the 64 bit OS. And for Windows 10 is 1 GB for the 32-bit OS, 2 GB for the 64-bit OS.

6.2.3 Security and Privacy

Admin

The duties of system administrators are wide ranging. It handles all the

transactions of the whole system.

User

Only the payment can access

6.3 Performance Monitoring and Database Efficiency

Describe design decisions to support Service Level Agreements (SLAs) for

key functions supported by the database.


22

6.3.1 Operational Implications

The Visual basic 2010 and the database will not work properly if the Software

will transfer to the other version of Visual basic and the database.

6.3.2 Data Transfer Requirements

Microsoft visual basic 2010

SQL 2010 Management Visual Studio


23

6.3.3Data Formats

Column Name Data Type

Japanese Int

Chicken Int

Beef Int

Pork Int

SharkFin Int

BlackGulaman Int

MasterRice Int

Total Int

Cash Int

Change Int

JapaneseStock Int

ChickenStock Int

BeefStock Int

PorkStock Int

SharksFinStock Int

MasterRiceStock Int
24

6.4 Backup and Recovery

Our system does not include an automatic back-up and recovery feature. To

make up for this, the proponents strategy is to manually back-up the important

information and data inside the system.


25

Appendix A: Suggested Appendices


26
27
28

Appendix B: Acronyms
Table 3-Acronyms

Acronym Literal Translation

DBMS Database Management System

LDM Logical Data Model

PDM Physical Data Model

DD Data Dictionary

SLA Services Level Agreement

VB.Net Visual Basic

SQL Structured Query Language


29

Appendix C: Glossary
Table 4 Glossary

Term Definition

A set of principles or procedures according to which something is done;


System
an organized scheme or method.

A database is an organized collection of data.[1] It is the collection


Database
of schemas, tables, queries, reports, views, and other objects

Visual Basic .NET is a multi-paradigm, object-oriented programming


VB.net
language, implemented on the .NET Framework

Structured Query Language is a domain-specific language used in


SQL
programming and designed for managing data held in a relational

database management system.

A printed document with blank spaces for information to be inserted.


Form

Is a set of data elements (values) using a model of vertical columns


Table
(identifiable by name) and horizontal rows; the cell is the unit where a

row and column intersect.


30

Appendix D: Approvals
The undersigned acknowledge that they have reviewed the Database Design

Document and agree with the information presented within this document. Changes

to this Database Design Document will be coordinated with, and approved by, the

undersigned, or their designated representatives.

Table 5 Approvals

Document Approved By Date


Approved

Technical panel: Mr. Noel Mateo Date

Head Panel: Ms. Nhelly Binuya Date

Grammarian: Ms. Carmabel Tawat Date

Technical Adviser: Mr. Mark Anthony Umadhay Date


31

Appendix E: Screen Shots and User Manual

Input Username and Password


Click Login

Select your order and input the quantity


Click Order
32

Wait for the confirmation


Click/Choose Yes or No

Input your Cash


Click Order
Click Save
33

Wait for the confirmation


Click OK

Input Amount of Stock


And Click Add Button, Refresh
34

Appendix F: Codes

Log in

Public Class Login

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnLogin.Click
If (TextBox1.Text = "tan" And TextBox2.Text = "shengay") Then
payments.btnstoks.Enabled = False
payments.btnstoks.Enabled = False
MessageBox.Show("Welcome To Master Siomai")
Me.Hide()
MasterSiomaiMenu.Show()
ElseIf (TextBox1.Text = "admin" And TextBox2.Text = "admin") Then
payments.btnstoks.Enabled = True
MessageBox.Show("Welcome To Master Siomai")
Me.Hide()
MasterSiomaiMenu.Show()

ElseIf MessageBox.Show("Oops! Ussername or Password is Incorrect!") Then


End If
End Sub

Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnCancel.Click
TextBox1.Text = ""
TextBox2.Text = ""

End Sub
End Class

Main Menu
Public Class MasterSiomaiMenu
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
35

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox1.TextChanged
Dim a, b, c As Integer

a = Val(TextBox1.Text)
b = Val(36)
c=a*b
payments.TextBox1.Text = c

End Sub

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox2.TextChanged
Dim a, b, c As Integer

a = Val(TextBox2.Text)
b = Val(30)
c=a*b
payments.TextBox2.Text = c
End Sub

Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox3.TextChanged
Dim a, b, c As Integer

a = Val(TextBox3.Text)
b = Val(30)
c=a*b
payments.TextBox3.Text = c
End Sub
36

Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox4.TextChanged
Dim a, b, c As Integer

a = Val(TextBox4.Text)
b = Val(30)
c=a*b
payments.TextBox4.Text = c
End Sub

Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox5.TextChanged
Dim a, b, c As Integer

a = Val(TextBox5.Text)
b = Val(36)
c=a*b
payments.TextBox5.Text = c
End Sub

Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
37

Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox6.TextChanged
Dim a, b, c As Integer

a = Val(TextBox6.Text)
b = Val(12)
c=a*b
payments.TextBox6.Text = c
End Sub
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox7.TextChanged
Dim a, b, c As Integer

a = Val(TextBox7.Text)
b = Val(10)
c=a*b
payments.TextBox7.Text = c
End Sub
Private Sub btnOrder_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOrder.Click
Dim ask As MsgBoxResult
ask = MsgBox("Are you sure with your order?", MsgBoxStyle.YesNo, "")
If ask = MsgBoxResult.Yes Then
MsgBox("You choose yes!")
Me.Hide()
payments.Show()

Else
If ask = MsgBoxResult.No Then
MsgBox("You choose no!")

End If
End I
payments.TextBox11.Text = TextBox1.Text
payments.TextBox12.Text = TextBox2.Text
payments.TextBox13.Text = TextBox3.Text
payments.TextBox14.Text = TextBox4.Text
38

payments.TextBox15.Text = TextBox5.Text
payments.TextBox16.Text = TextBox6.Text
payments.TextBox17.Text = TextBox7.Text

End Sub
Private Sub MasterSiomaiMenu_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub
End Class
Payments
Imports System.Data.SqlClient
Imports System.IO
Imports Microsoft.VisualBasic
Public Class payments
Dim cn As New SqlConnection("Data Source=SHERLYN-PC\SQLEXPRESS;Initial
Catalog=Siomai;Integrated Security=True")
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim dt1 As New DataTable
Dim i As Integer
Dim a As New OpenFileDialog
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
Dim a, j As Integer
a = Val(TextBox1.Text)
j=a
TextBox8.Text = j
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox7.TextChanged
Dim a, b, c, d, g, h, i, j As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = Val(TextBox3.Text)
d = Val(TextBox4.Text)
g = Val(TextBox5.Text)
h = Val(TextBox6.Text)
i = Val(TextBox7.Text)
j=a+b+c+d+g+h+i
TextBox8.Text = j

End Sub
39

Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox6.TextChanged
Dim a, b, c, d, g, h, j As Integer

a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = Val(TextBox3.Text)
d = Val(TextBox4.Text)
g = Val(TextBox5.Text)
h = Val(TextBox6.Text)

j=a+b+c+d+g+h
TextBox8.Text = j
End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox5.TextChanged
Dim a, b, c, d, g, j As Integer

a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = Val(TextBox3.Text)
d = Val(TextBox4.Text)
g = Val(TextBox5.Text)
j=a+b+c+d+g
TextBox8.Text = j
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox4.TextChanged
Dim a, b, c, d, j As Integer

a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = Val(TextBox3.Text)
d = Val(TextBox4.Text)
j=a+b+c+d
TextBox8.Text = j
End Sub

Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox3.TextChanged
Dim a, b, c, j As Integer

a = Val(TextBox1.Text)
40

b = Val(TextBox2.Text)
c = Val(TextBox3.Text)

j=a+b+c
TextBox8.Text = j
End Sub

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox2.TextChanged
Dim a, b, j As Integer

a = Val(TextBox1.Text)
b = Val(TextBox2.Text)

j=a+b
TextBox8.Text = j
End Sub

Private Sub payments_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Panel1.Hide()

ShowRecord()
Show1Record()
End Sub

Private Sub btnPayments_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnPayments.Click
cn.Open()
Using cmd As New SqlClient.SqlCommand("Insert Into Master( Japanese, Chicken,
Beef, Pork, SharksFin, BlackGulaman, MasterRice,Total,Cash, Change)values('" &
TextBox11.Text & "','" & TextBox12.Text & "','" & TextBox13.Text & "','" &
TextBox14.Text & "','" & TextBox15.Text & "','" & TextBox16.Text & "','" &
TextBox17.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "','" &
TextBox10.Text & "')", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")
Clear()
End If
41

cn.Close()

End Sub
Sub Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
TextBox13.Clear()
TextBox14.Clear()
TextBox15.Clear()
TextBox16.Clear()
TextBox17.Clear()
TextBox9.Focus()
End Sub

Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Sub ShowRecord()
cn.Open()
With cmd
.Connection = cn
.CommandText = "Select * from Master"
End With

da.SelectCommand = cmd
dt.Clear()
da.Fill(dt)
dg.DataSource = dt
dg.RowTemplate.Height = 20
cn.Close()
42

End Sub

Sub Show1Record()
cn.Open()
With cmd
.Connection = cn
.CommandText = "Select * from Stock"
End With

da.SelectCommand = cmd
dt1.Clear()
da.Fill(dt1)
dg1.DataSource = dt1
dg1.RowTemplate.Height = 20
cn.Close()

End Sub

Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Private Sub dg_CellContentClick(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.DataGridViewCellEventArgs) Handles dg.CellContentClick

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
ShowRecord()
Show1Record()

End Sub

Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
43

Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox9.TextChanged

Dim a, b, c As Integer

a = Val(TextBox8.Text)
b = Val(TextBox9.Text)
c=b-a
TextBox10.Text = c

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnstoks.Click
Me.Hide()
stock.Show()

End Sub

Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox11.TextChanged

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Me.Hide()
MasterSiomaiMenu.Show()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click

Label21.Enabled = False

cn.Open()
44

Using cmd As New SqlClient.SqlCommand("Update Stock SET JapaneseStock = " &


Val(dg1.Item(0, 0).Value - Val(TextBox11.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using
Using cmd As New SqlClient.SqlCommand("Update Stock SET ChickenStock = " &
Val(dg1.Item(1, 0).Value - Val(TextBox12.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using
Using cmd As New SqlClient.SqlCommand("Update Stock SET BeefStock = " &
Val(dg1.Item(2, 0).Value - Val(TextBox13.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using
Using cmd As New SqlClient.SqlCommand("Update Stock SET PorkStock = " &
Val(dg1.Item(3, 0).Value - Val(TextBox14.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using
Using cmd As New SqlClient.SqlCommand("Update Stock SET SharksFinStock = " &
Val(dg1.Item(4, 0).Value - Val(TextBox15.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using
Using cmd As New SqlClient.SqlCommand("Update Stock SET MasterRiceStock = "
& Val(dg1.Item(5, 0).Value - Val(TextBox17.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

Dim confirm_msg = MessageBox.Show("Are you Sure ?", "Confirmation",


MessageBoxButtons.YesNo, MessageBoxIcon.Information)

If confirm_msg = Windows.Forms.DialogResult.Yes Then

End If
If Val(TextBox9.Text) < Val(TextBox8.Text) Then
MessageBox.Show("Not enough cash")

ElseIf i > 0 Then


MessageBox.Show("Save" & i & "Transuction Success")
End If

End Sub
45

Private Sub TextBox18_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
PrintDialog1.Document = PrintDocument1
PrintDialog1.ShowDialog()

End Sub

Private Sub LineShape1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles LineShape1.Click, LineShape5.Click, LineShape4.Click,
LineShape3.Click, LineShape2.Click

End Sub

Private Sub Label21_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label21.Click

End Sub
End Class

Stocks

Imports System.Data.SqlClient
Imports System.IO
Imports Microsoft.VisualBasic
Public Class stock
Dim cn As New SqlConnection("Data Source=SHERLYN-PC\SQLEXPRESS;Initial
Catalog=Siomai;Integrated Security=True")
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim i As Integer
Dim a As New OpenFileDialog

Dim p1 As Integer
46

Private Sub btnPayments_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET JapaneseStock = " &


Val(dg.Item(0, 0).Value + Val(TextBox1.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")

End If
cn.Close()

End Sub

Sub Clear()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
End Sub

Sub ShowRecord()
cn.Open()
With cmd
.Connection = cn
.CommandText = "select * from stock"
End With

da.SelectCommand = cmd
dt.Clear()
da.Fill(dt)
dg.DataSource = dt
dg.RowTemplate.Height = 20

cn.Close()

End Sub
47

Private Sub stock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

ShowRecord()

End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button6.Click
ShowRecord()
End Sub

Private Sub btnadd1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd1.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET ChickenStock = " &


Val(dg.Item(1, 0).Value + Val(TextBox2.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")

End If
cn.Close()
End Sub

Private Sub btnadd2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd2.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET BeefStock = " &


Val(dg.Item(2, 0).Value + Val(TextBox3.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")

End If
cn.Close()
End Sub
48

Private Sub btnadd3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd3.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET PorkStock = " &


Val(dg.Item(3, 0).Value + Val(TextBox4.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")

End If
cn.Close()
End Sub

Private Sub btnadd4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd4.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET SharksFinStock = " &


Val(dg.Item(4, 0).Value + Val(TextBox5.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")

End If
cn.Close()
End Sub

Private Sub btnadd5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnadd5.Click
cn.Open()

Using cmd As New SqlClient.SqlCommand("Update Stock SET MasterRiceStock = "


& Val(dg.Item(5, 0).Value + Val(TextBox6.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")
49

End If
cn.Close()

End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub
50

Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
MessageBox.Show("You can only input number!")
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Hide()
payments.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
cn.Open()
Using cmd As New SqlClient.SqlCommand("Update Stock SET JapaneseStock = " &
Val(dg.Item(0, 0).Value - Val(TextBox1.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")
Clear()
End If
cn.Close()
End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As


System.EventArgs)
cn.Open()
Using cmd As New SqlClient.SqlCommand("Update Stock SET JapaneseStock = " &
Val(dg.Item(0, 0).Value - Val(TextBox1.Text)) & "", cn)
i = cmd.ExecuteNonQuery()
End Using

If i > 0 Then
MessageBox.Show("Save" & i & "records successfully")
Clear()
End If
cn.Close()
End Sub
End Class

You might also like