CSC301 Visual Programming Group Assignment PDF

Title CSC301 Visual Programming Group Assignment
Author Syukran SJ
Course visual programming
Institution Universiti Teknologi MARA
Pages 48
File Size 1.7 MB
File Type PDF
Total Downloads 66
Total Views 116

Summary

full assignment report...


Description

CSC301 Visual Programming GROUP PROJECT

GROUP ID: CS1103C

Group Members: Student ID

Name

2019260744

Muhammad Syukran Bin Shabaruddin

2019446778

Zareef Haikal Bin Suhaimi

2019298106

Muzaffar Amir Bin AB Jalal

2019216678

Ahmad Yusuf Rahimi Bin Mohamed Rahim

Date Submitted :

0

1

0

2

2

0

2

1

Contents

1.0

Introduction…………………………………………………………………………….1-1

2.0

Objective……………………………………………………………………………......1-1

3.0

Design………………………………………………………………………………......2-2 3.1

4.0

Sketch…………………………………………………………………………..2-5

Appendices……………………………………………………………………………..6-6 4.1 User Manual……………………………………………………………………….6-16 4.2 List Of Code……………………………………………………………………...17-40 4.3 Database Tables………………………………………………………………….41-44

Rubric………………………………………………………………………………………..45-45

Page |1

1.0

Introduction

Sarah's Short Cakes is a cupcake shop that faces a range of difficulties in managing clients and orders without the correct framework. With visual basic programming, we could solve this problem by designing a framework to handle their store.

2.0

Objective The key aim of this case study is to have an incentive to solve real-life challenges by

incorporating methods for problem-solving and integrating data processing techniques in programming language and visual basic. Create an object relationship diagram to create a physical database with knowledge specifications based on a case study without any problems such as redundant records. Building a framework that uses visual programming design and development with a proper concept of artefacts, patented and visual programming approaches, as well as a userfriendly interface.

Page |2

3.0

Design 3.1

Sketch 3.1.1 Main Manu

Page |3

3.1.2 Add Customer Form

Page |4

3.1.3 Add Order Form

Page |5

3.1.4 Daily Report Form

3.1.5 Delivery Report Form

Page |6

4.0

Appendices 4.1

User Manual

4.1.1 How To Add Customer 1.

Press Add Customer From Main Manu

Page |7

2.

When AddCustomer form appear, press Insert Customer Info

Page |8

3.

Insert Customer ID,First Name,Last Name,Email Address,Phone Number,Street, Address

and City. And Press Save

4.

Message will pop up if the data has been inserted.

4.1.2 How To Add Order

Page |9

1.

Press Add Orders button from the main menu form.

2.

When AddOrders form appear, press Insert Order Info.

P a g e | 10

3.

Insert Order ID and Customer ID by using ‘’ button as references to fund

Customer ID.

4

Press Save Order Info button to add order.

P a g e | 11

5.

Message Will Pop Up if the data has been insert into records.

6.

Message for incorrect Input.

P a g e | 12

4.1.3 How to Print Daily Report 1.

Press Print Report Daily button on Main Menu form.

2.

When ReportDaily form appear, press Print button.

P a g e | 13

3.

Report ready to be Print

4.

If you wish to go back to Main Menu just press Main Menu Button.

P a g e | 14

5.

It will bring you back to Main Menu Form

P a g e | 15

4.1.4 How To Print Delivery Report 1.

Press Print Delivery button on Main Menu form.

2.

When Delivery Report Appear, Just Press Print.

P a g e | 16

3.

Delivery Report is Ready to be Print

P a g e | 17

4.2

List Of Code 4.2.1 Main Menu

Public Class MainMenu Private Sub AddCustButton_Click(sender As Object, e As EventArgs) Handles AddCustButton.Click Dim formAddCust As New AddCustomerForm formAddCust.Show() End Sub Private Sub AddOrderButton_Click(sender As Object, e As EventArgs) Handles AddOrderButton.Click Dim addOrders As New OrderForm addOrders.Show() End Sub Private Sub PrntDailyRptButton_Click(sender As Object, e As EventArgs) Handles PrntDailyRptButton.Click Dim printReport As New DailyReport printReport.Show() End Sub Private Sub PrntDeliverButton_Click(sender As Object, e As EventArgs) Handles PrntDeliverButton.Click Dim printReport As New DeliveryReport printReport.Show() End Sub End Class

P a g e | 18

4.2.2 Customer Form Public Class AddCustomerForm Private Sub CustomersBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Me.Validate() Me.CustomersBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me._Sarah_sCupcakeOrderTrackingDataSet) End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.Customers' table. You can move, or remove it, as needed. Me.CustomersTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.Customers ) End Sub Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click Dim validCustomer As String validCustomer = txtCustID.Text If validCustomer = "" Then MessageBox.Show("Please Insert Correct Input") CustomersBindingSource.CancelEdit() txtCustID.Text = String.Empty txtFname.Text = String.Empty txtLName.Text = String.Empty txtStreetAdd.Text = String.Empty txtPnum.Text = String.Empty txtEmail.Text = String.Empty txtCity.Text = String.Empty GroupBox1.Enabled = False AddInfoButton.Text = "Add New Information" Else Try CustomersBindingSource.EndEdit() CustomersTableAdapter.Update(Me._Sarah_sCupcakeOrderTrackingDataSet.Customers) AddInfoButton.Text = "Add New Information" txtCustID.Text = String.Empty txtFName.Text = String.Empty txtLName.Text = String.Empty txtStreetAdd.Text = String.Empty txtPnum.Text = String.Empty txtEmail.Text = String.Empty txtCity.Text = String.Empty MessageBox.Show("Data Saved", "Info") Catch ex As Exception

P a g e | 19 MessageBox.Show(ex.Message) End Try End If End Sub Private Sub AddInfoButton_Click(sender As Object, e As EventArgs) Handles AddInfoButton.Click If AddInfoButton.Text = "Add New Information" Then CustomersBindingSource.AddNew() AddInfoButton.Text = "Cancel" GroupBox1.Enabled = True SaveButton.Enabled = True Else CustomersBindingSource.CancelEdit() AddInfoButton.Text = "Add New Information" GroupBox1.Enabled = True SaveButton.Enabled = True End If End Sub Private Sub MainMenuButton_Click(sender As Object, e As EventArgs) Handles MainMenuButton.Click Me.Close() End Sub Private Sub PreviousButton_Click(sender As Object, e As EventArgs) Handles PreviousButton.Click CustomersBindingSource.MovePrevious() End Sub Private Sub NextButton_Click(sender As Object, e As EventArgs) Handles NextButton.Click CustomersBindingSource.MoveNext() End Sub Private Sub DeleteInfoButton_Click(sender As Object, e As EventArgs) Handles DeleteInfoButton.Click If MessageBox.Show("Are you sure you want to delete?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = DialogResult.OK Then CustomersBindingSource.RemoveCurrent() CustomersTableAdapter.Update(Me._Sarah_sCupcakeOrderTrackingDataSet.Customers) End If End Sub End Class

P a g e | 20

4.2.3 Order Form Public Class OrderForm Dim numorderloop As Integer Private Sub OrdersCustBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Me.Validate() Me.OrdersCustBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me._Sarah_sCupcakeOrderTrackingDataSet) End Sub Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.Customers' table. You can move, or remove it, as needed. Me.CustomersTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.Customers ) 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.ColourIcing' table. You can move, or remove it, as needed. Me.ColourIcingTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.ColourI cing) 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.Icing' table. You can move, or remove it, as needed. Me.IcingTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.Icing) 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.ColourCupcakes' table. You can move, or remove it, as needed. Me.ColourCupcakesTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.Colo urCupcakes) 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.Cupcakes' table. You can move, or remove it, as needed. Me.CupcakesTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.Cupcakes) 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.OrdersCust' table. You can move, or remove it, as needed. Me.OrdersCustTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.OrdersCu st) End Sub

P a g e | 21

Private Sub NewOrderButton_Click(sender As Object, e As EventArgs) Handles NewOrderButton.Click If NewOrderButton.Text = "Insert Order Information" Then OrdersCustBindingSource.AddNew() NewOrderButton.Text = "Cancel" DetailsBox.Enabled = True ColorBox.Enabled = True SaveOrderButton.Enabled = True Else OrdersCustBindingSource.CancelEdit() NewOrderButton.Text = "Insert Order Information" DetailsBox.Enabled = False ColorBox.Enabled = False SaveOrderButton.Enabled = False End If End Sub Private Sub SaveOrderButton_Click(sender As Object, e As EventArgs) Handles SaveOrderButton.Click Dim validOrder, validCustomer, cupcakeID, icingID, cupcakeColorID, icingColorID As String validOrder = OrderIDTextBox.Text validCustomer = CustIDTextBox.Text cupcakeID = CupcakeIDTextBox.Text icingID = IcingIDTextBox.Text cupcakeColorID = CupcakeIDTextBox.Text icingColorID = IcingIDTextBox.Text If validOrder = "" And validCustomer = "" And cupcakeID = "" And icingID = "" And cupcakeColorID = "" And icingColorID = "" Then MessageBox.Show("Insert all of the input correctly!") OrdersCustBindingSource.CancelEdit() OrderIDTextBox.Text = String.Empty CustIDTextBox.Text = String.Empty CupcakeIDTextBox.Text = String.Empty IcingIDTextBox.Text = String.Empty CupcakeIDTextBox.Text = String.Empty IcingIDTextBox.Text = String.Empty OrderDateTextBox.Text = String.Empty DateNeededTextBox.Text = String.Empty TimeNeededTextBox.Text = String.Empty Else Try OrdersCustBindingSource.EndEdit() OrdersCustTableAdapter.Update(Me._Sarah_sCupcakeOrderTrackingDataSet.OrdersCus t)

P a g e | 22

NewOrderButton.Text = "Insert Order Information" Catch ex As Exception MessageBox.Show(ex.Message) NewOrderButton.Text = "Cancel" End Try MessageBox.Show("Data has been inserted into the database.") OrderIDTextBox.Text = String.Empty CustIDTextBox.Text = String.Empty CupcakeIDTextBox.Text = String.Empty IcingIDTextBox.Text = String.Empty CupcakeIDTextBox.Text = String.Empty IcingIDTextBox.Text = String.Empty OrderDateTextBox.Text = String.Empty DateNeededTextBox.Text = String.Empty TimeNeededTextBox.Text = String.Empty End If End Sub Private Sub PrevButton_Click(sender As Object, e As EventArgs) Handles PrevButton.Click CustomersBindingSource.MovePrevious() End Sub Private Sub NextButton_Click(sender As Object, e As EventArgs) Handles NextButton.Click CustomersBindingSource.MoveNext() End Sub Private Sub PrevButton2_Click(sender As Object, e As EventArgs) Handles PrevButton2.Click CupcakesBindingSource.MovePrevious() End Sub Private Sub NextButton2_Click(sender As Object, e As EventArgs) Handles NextButton2.Click CupcakesBindingSource.MoveNext() End Sub Private Sub PrevButton3_Click(sender As Object, e As EventArgs) Handles PrevButton3.Click IcingBindingSource.MovePrevious() End Sub Private Sub NextButton3_Click(sender As Object, e As EventArgs) Handles NextButton3.Click IcingBindingSource.MoveNext() End Sub Private Sub PrevButton4_Click(sender As Object, e As EventArgs) Handles PrevButton4.Click ColourCupcakesBindingSource.MovePrevious() End Sub

P a g e | 23 Private Sub NextButton4_Click(sender As Object, e As EventArgs) Handles NextButton4.Click ColourCupcakesBindingSource.MoveNext() End Sub Private Sub PrevButton5_Click(sender As Object, e As EventArgs) Handles PrevButton5.Click ColourIcingBindingSource.MovePrevious() End Sub Private Sub NextButton5_Click(sender As Object, e As EventArgs) Handles NextButton5.Click ColourIcingBindingSource.MoveNext() End Sub Private Sub PrevButton6_Click(sender As Object, e As EventArgs) Handles PrevButton6.Click OrdersCustBindingSource.MovePrevious() End Sub Private Sub NextButton6_Click(sender As Object, e As EventArgs) Handles NextButton6.Click OrdersCustBindingSource.MoveNext() End Sub Private Sub DeleteInfoButton_Click(sender As Object, e As EventArgs) Handles DeleteInfoButton.Click If MessageBox.Show("Delete this data?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = DialogResult.OK Then OrdersCustBindingSource.RemoveCurrent() OrdersCustTableAdapter.Update(Me._Sarah_sCupcakeOrderTrackingDataSet.OrdersCus t) End If End Sub Private Sub MainMenuButton_Click(sender As Object, e As EventArgs) Handles MainMenuButton.Click Me.Close() End Sub Private Sub TimeNeededTextBox_TextChanged(sender As Object, e As EventArgs) Handles TimeNeededTextBox.TextChanged End Sub End Class

P a g e | 24

4.2.4 Report Daily Imports System.Data.OleDb Imports System.Data.SqlClient Public Class DailyReport Private Sub PrintButton_Click(sender As Object, e As EventArgs) Handles PrintButton.Click 'PrintPreviewDialog1.Document = PrintDocument1 'PrintPreviewDialog1.Show() PrintDocument1.DefaultPageSettings.Landscape = False PrintPreviewControl1.Document = PrintDocument1 End Sub

Private Sub OrdersCustBindingNavigatorSaveItem_Click_1(sender As Object, e As EventArgs) Handles OrdersCustBindingNavigatorSaveItem.Click Me.Validate() Me.OrdersCustBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me._Sarah_sCupcakeOrderTrackingDataSet)

End Sub

Private Sub DailyReport_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the '_Sarah_sCupcakeOrderTrackingDataSet.OrdersCust' table. You can move, or remove it, as needed. Me.OrdersCustTableAdapter.Fill(Me._Sarah_sCupcakeOrderTrackingDataSet.OrdersCu st)

End Sub

Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

P a g e | 25 Dim conn As New OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\User\Documents\Microsoft Access Database\Sarah'sCupcakeOrderTracking.accdb") Dim dt, dt2 As New DataTable() conn.Open()

Dim sql1, sql2, sql3, sql4 As String sql1 = "SELECT O.OrderID,O.CustID,O.OrderDate,O.DateNeeded,O.TimeNeeded,O.Quantity,O.CupcakeI D,O.Delivery,O.SalesOrderNote,O.ColorCupcakes,O.ColourIcing,O.IcingID,C.CustFN ame,C.CustLName FROM OrdersCust As O INNER JOIN Customers as C ON O.CustID = C.CustID ORDER BY OrderID ASC" Dim command As New OleDbCommand(sql1, conn) Dim sqlDa As New OleDbDataAdapter(command)

Dim reader As OleDbDataReader Dim numLastRow As Integer Dim startRow As Integer

sqlDa.Fill(dt)

numLastRow = CInt(dt.Rows.Count.ToString)

Dim str As String Dim row As DataRow Dim repeatHpos1, repeatHpos2, repeatHpos3, repeatHpos4, repeatHpos5 As Integer

repeatHpos1 = 30 repeatHpos2 = 70 repeatHpos3 = 100 repeatHpos4 = 170 repeatHpos5 = 130

e.Graphics.DrawString("Date Printed :", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 570, repeatHpos1)

P a g e | 26 e.Graphics.DrawString(DateTime.Now.ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 670, repeatHpos1) e.Graphics.DrawString("Report Order", New Font("Courier", 21, FontStyle.Bold), Brushes.Violet, 330, repeatHpos1)

For intcount = 0 To numLastRow - 1

row = dt.Rows(intcount) e.Graphics.DrawString("Date Ordered:", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 10, repeatHpos2) e.Graphics.DrawString("Date and Time Needed:", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 10, repeatHpos3) e.Graphics.DrawString("Customer ID:", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 600, repeatHpos2) e.Graphics.DrawString("Customer Name:", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 600, repeatHpos3) e.Graphics.DrawString("Method:", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 600, repeatHpos5) e.Graphics.DrawString("Quantity", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 40, repeatHpos4) e.Graphics.DrawString("Order ID", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 40, repeatHpos5) e.Graphics.DrawString("Cupcake Flavour", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 130, repeatHpos4) e.Graphics.DrawString("Cupcake Colour", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 300, repeatHpos4) e.Graphics.DrawString("Icing Flavour", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 450, repeatHpos4) e.Graphics.DrawString("Icing Colour", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 580, repeatHpos4) e.Graphics.DrawString("Decoration", New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 690, repeatHpos4)

e.Graphics.DrawString(row("CustFName").ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 740, repeatHpos3) e.Graphics.DrawString(FormatDateTime(row("OrderDate"), vbShortDate).ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 110, repeatHpos2)

P a g e | 27 e.Graphics.DrawString(FormatDateTime(row("DateNeeded").ToString, vbShortDate), New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 180, repeatHpos3) e.Graphics.DrawString(FormatDateTime(row("TimeNeeded").ToString, vbShortTime), New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 260, repeatHpos3) e.Graphics.DrawString(row("OrderID"), New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 110, repeatHpos5) e.Graphics.DrawString(row("CustID").ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 700, repeatHpos2)

e.Graphics.DrawString(row("Quantity").ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 70, repeatHpos4 + 20)

'Cupcake Flavour If row("CupcakeID") = "CP01" Then str = "Vanila" ElseIf row("CupcakeID") = "CP02" Then str = "French Vanilla" ElseIf row("CupcakeID") = "CP03" Then str = "Chocolate" ElseIf row("CupcakeID") = "CP04" Then str = "White Chocoloate" ElseIf row("CupcakeID") = "CP05" Then str = "Double Chocolate" ElseIf row("CupcakeID") = "CP06" Then str = "S'Mores" ElseIf row("CupcakeID") = "CP07" Then str = "Strawberry" ElseIf row("CupcakeID") = "CP08" Then str = "Peanut Butter" ElseIf row("CupcakeID") = "CP09" Then str = "Pumpkin Spice" ElseIf row("CupcakeID") = "CP010" Then str = "Blueberry" ElseIf row("CupcakeID") = "CP011" Then

P a g e | 28 str = "Apple Cinnamon" ElseIf row("CupcakeID") = "CP012" Then str = "Cookies and Cream" ElseIf row("CupcakeID") = "CP013" Then str = "Champange" ElseIf row("CupcakeID") = "CP014" Then str = "Chocolate Chip" ElseIf row("CupcakeID") = "CP015" Then str = "Mississippi Mud" ElseIf row("CupcakeID") = "CP016" Then str = "Red Velvet" ElseIf row("CupcakeID") = "CP017" Then str = "Coconut" End If

e.Graphics.DrawString(str.ToString, New Font("Courier", 11, FontStyle.Regular), Brushes.Black, 130, repeatHpos4 + 20)

'Method Dim strDelivery As Str...


Similar Free PDFs