CodesChart Batch File C++ Flowchart VB6 Others About Privacy Policy

Tuesday, February 14, 2017

Ordering System with Simple Database

Ordering system with simple database is a good practice as where most beginners will try to find the most easiest system that will not take a lot of time in development. One of the simplest form of database system is ordering where the user acts as a cashier. Also as we think about ordering system or cashiering system, what will think is about fast foods computerize applications which setting your order to their databases. Cashiering and ordering system is very alike but that is not the topic, what I gonna tell here is the knowledge to make an ordering system for those who don't have yet any kind of idea of how it works. 

Ordering System
Sample Ordering System with names and captions (Form1)
What you see in above image is Form1 of my ordering system I made it simple and easy to understand. As you may see I used tabs with different buttons inside and each buttons has a command where every time it was press it triggers that a transaction has being started. Each buttons inside the tab area will produce product names in the listbox it name as List1 as you may see on above image. Everytime you press each buttons inside a tab area it also show a product value or price in the textbox name as txtPrice as you may see on above image. You may also track the total value or price of all item sellected or pressed in the textbox name as txttotal as you may see in above image. I made this ordering system or cashiering seemingly alike to those we can see in most fast foods chain giants that we almost went a lot.

As most ordering system I added an area where you can place the customers money on hand or the money that his going to give you as a payment. You will also find a textbox where you can see the total change that you'll give back to the customer as if he pay you more than enough. Also a textbox that will show the date today you need as much information to be stored in the database so you're not going to lose track of your earnings. Because the main process of every ordering systems or cashiering systems is about calculating each amount of money of our costumer and make a difference with all the products he choose to buy.



You can also use a remove button if ever you have mispress an item to be included in ordering process, as you may see a command button named cmdRemove in above image. Once a transaction has been done you'll want to clear the entire list for new list of orders, just pree the clear command named cmdClear as you may see at the above image. What you will see below is my sample ordering system source code of above image I prefer to use a VB6 as you will understand the code easily. The below code is solely to be coded in Form1 which means this is the entire code of the above image.

Source Codes For Those Using Mobile Phone Please Check if your browser request for Desktop site "WEB" or WWW so you can view the entire codes, or Highlight all codes and copy in your mobile text editor). Like what you see in the image below just simple click it.
Click "View web version"



Private total As Currency

Private Sub cmdClear_Click()
List1.Clear
txtPrice.Text = "0.00"
txttotal.Text = "0.00"
End Sub

Private Sub cmdRemove_Click()
If List1.Text = "Krubby Patty" Then
    txttotal = Val(txttotal) - 35
ElseIf List1.Text = "Big Penny" Then
    txttotal = Val(txttotal) - 75
ElseIf List1.Text = "Big Mouth" Then
    txttotal = Val(txttotal) - 55
ElseIf List1.Text = "Big Time" Then
    txttotal = Val(txttotal) - 30
End If
If List1.Text = "Coffe Lava" Then
    txttotal = Val(txttotal) - 35
ElseIf List1.Text = "Red Love Tea" Then
    txttotal = Val(txttotal) - 75
ElseIf List1.Text = "For D Bitter" Then
    txttotal = Val(txttotal) - 55
End If
For i = 0 To List1.ListIndex
If List1.Selected(i) Then
    List1.RemoveItem (i)
End If
Next i
End Sub

Private Sub cmdSell_Click()
txtchange.Text = Val(txtcash.Text) - Val(txttotal.Text)
Dim msg As String
msg = MsgBox("Record current order?", vbYesNo, "MENSAHE")
If msg = vbYes Then
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields(0) = txttotal.Text
    Adodc1.Recordset.Fields(1) = txtdate.Text
    Adodc1.Recordset.Update
    Adodc1.Refresh
    MsgBox "Order has been saved!!", , "MENSAHE"
Else
    MsgBox "Order not save!", , "MENSAHE"
End If
End Sub

Private Sub Command1_Click()
If Command1.Value = True Then
        With List1
            .AddItem "Krubby Patty"
        End With
    txtPrice.Text = "35.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
 End If
End Sub

Private Sub Command10_Click()
Form2.Show
End Sub

Private Sub Command2_Click()
If Command2.Value = True Then
        With List1
            .AddItem "Big Penny"
        End With
    txtPrice.Text = "75.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
 End If
End Sub

Private Sub Command3_Click()
If Command3.Value = True Then
        With List1
            .AddItem "Big Mouth"
        End With
    txtPrice.Text = "55.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total 
End If
End Sub

Private Sub Command4_Click()
If Command4.Value = True Then
        With List1
            .AddItem "Big Time"
        End With
    txtPrice.Text = "30.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
 End If
End Sub

Private Sub Command5_Click()
If Command5.Value = True Then
        With List1
            .AddItem "Coffe Lava"
        End With
    txtPrice.Text = "35.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
End If
End Sub

Private Sub Command6_Click()
If Command6.Value = True Then
        With List1
            .AddItem "Red Love Tea"
        End With
    txtPrice.Text = "75.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
End If
End Sub

Private Sub Command7_Click()
If Command7.Value = True Then
        With List1
            .AddItem "For D Bitter"
        End With
    txtPrice.Text = "55.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
End If
End Sub

Private Sub Command8_Click()
If Command8.Value = True Then
        With List1
            .AddItem "Healty Tea"
        End With
    txtPrice.Text = "55.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
End If
End Sub

Private Sub Command9_Click()
If Command9.Value = True Then
        With List1
            .AddItem "Sandwich Time"
        End With
    txtPrice.Text = "60.00"
    total = Format(Val(txttotal) + Val(txtPrice), "###,##0.00")
    txttotal = total
End If
End Sub

Private Sub Timer1_Timer()
txtdate.Text = Format(Now, "dd/mm/yyyy")
End Sub

As you see inside at Private Sub cmdSell_Click() its the command that will stored the total earnings per transaction. The Adodc1.Recordset.AddNew is used to declare that you are adding new data inside the database. If you are been thinking about the adodc I used it so you will not taking a hard-time trying to understand on how I connect the database. The  Private Sub Timer1_Timer() is the code that will trigger to show the date today and Private Sub Command10_Click() is the command used to show the Form2, where you see at the image below. As most ordering systems or cashiering systems we need a form to locate all our transactions or orders of our costumers. To easily count our earnings for each day of transaction with our beloved costumers.


Income Records
Sample Ordering system with names and captions (Form2)

What you will see on above image is the Form2, you may see in above image the order list where you can see the entire transaction that has been done. You can also delete records that you no longer needed in the list just by clicking the delete record button named as Command1 on above image. You can also classify it as admin form on other types of system, because only admins should the only one that can access this form, What you will see below is the source code of Form2.

Private Sub Command1_Click()
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub

What is the best specs of ordering or cashiering systems?

The main capability of every ordering or cashiering systems is that it counts the total value of all the products that has been ordered by the costumers and give out the change if have. It is a wise decision to have ordering system or cashiering system, if you are having a lot of costumers so you can entertain other costumer fast and efficiently. 

Where can I use Ordering or Cashiering systems?

You can use ordering systems in most systems that making a transactions related to counts and dates like we see in fast foods, warehouses, real-states etc... you can use cashiering systems also in fast foods, and departments stores.
  
On my next blog it will take a couple of weeks before to be done because I planning to post about a simple Ticketing System to follow this post, where I plan to guide beginners that don't have any idea of different systems that exist. Also if your thinking about the Flowchart of this Ordering System I plan to update this post to add it if its really necessary.  

If you found this article useful feel free to Click the Button below.

Buy Me A Coffee

3 comments: