-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathburger.vb
More file actions
147 lines (136 loc) · 6.1 KB
/
Copy pathburger.vb
File metadata and controls
147 lines (136 loc) · 6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Imports Microsoft.SqlServer
Imports MySql.Data.MySqlClient
Imports Mysqlx
Imports System.Data.SqlTypes
'Imports Microsoft.SqlServer
'Imports MySql.Data.MySqlClient
'Imports Mysqlx
'Imports System.Data.SqlTypes
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
'Imports MySql.Data.MySqlClient
Imports Microsoft.VisualBasic.ApplicationServices
Imports Microsoft.Win32
Imports System.Drawing.Printing
Public Class Burger
Dim sqlconn As New MySqlConnection
Dim sqlcmd As New MySqlCommand
Dim sqlrd As MySqlDataReader
Dim sqldt As New DataTable
Dim dataadp As New MySqlDataAdapter
Dim sqlquery As String
Dim server As String = "localhost"
Dim uname As String = "root"
Dim pass As String = "syco2@9"
Dim dbname As String = "myconnector1"
Private Sub Button1_Click(sender As Object, e As EventArgs)
' switchPanel(AboutUs)
End Sub
Sub switchPanel(ByVal panel As Burger)
Panel1.Controls.Clear()
panel.TopLevel = False
Panel1.Controls.Add(panel)
panel.Show()
End Sub
Private Sub Burger_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Me.Size = New System.Drawing.Size(500, 500)
MaximizeBox = False
MinimizeBox = False
ControlBox = False
End Sub
Private Sub Button1_Click_1(sender As Object, e As EventArgs)
'Me.Visible = False
Form1.Show()
End Sub
Private Sub Button1_Click_2(sender As Object, e As EventArgs) Handles Button1.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label1.Text & "','" & Integer.Parse(Label6.Text) & "','" & TextBox1.Text & "','" & (Val(Label6.Text * Val(TextBox1.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label10.Text & "','" & Integer.Parse(Label5.Text) & "','" & TextBox2.Text & "','" & (Val(Label5.Text * Val(TextBox2.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label15.Text & "','" & Integer.Parse(Label11.Text) & "','" & TextBox3.Text & "','" & (Val(Label11.Text * Val(TextBox3.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label30.Text & "','" & Integer.Parse(Label26.Text) & "','" & TextBox4.Text & "','" & (Val(Label26.Text * Val(TextBox4.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label25.Text & "','" & Integer.Parse(Label16.Text) & "','" & TextBox5.Text & "','" & (Val(Label16.Text * Val(TextBox5.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
sqlconn.ConnectionString = "server=" + server + ";" + "user id =" + uname + ";" + "password=" + pass + ";" + "database=" + dbname
Try
sqlconn.Open()
sqlquery = "Insert into myconnector1.receipt(ProdName,Price,Qty,Total)
values('" & Label20.Text & "','" & Integer.Parse(Label21.Text) & "','" & TextBox6.Text & "','" & (Val(Label21.Text * Val(TextBox6.Text))) & "')"
sqlcmd = New MySqlCommand(sqlquery, sqlconn)
sqlrd = sqlcmd.ExecuteReader
sqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
sqlconn.Close()
End Try
End Sub
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
End Sub
End Class