123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980 |
- Imports System.Data.SqlClient
- Public Class 訂單確認
- Dim conn As New SqlConnection("Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\奕穎\Documents\資管\大三上\系分\謎鹿\謎鹿.mdf;Integrated Security=True;Connect Timeout=30")
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- 購物車.Show()
- Me.Visible = False
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- '新增訂單
- conn.Open()
- Dim t As Date
- t = Today
- Dim m_訂單編號 = 耳環.Label6.Text + 耳環.Label20.Text
- Dim m_付款方式 = ComboBox1.Text
- Dim m_取貨方式 = ComboBox2.Text
- Dim m_訂單日期 = t
- Dim m_會員編號 = 耳環.Label6.Text
- Dim m_購物車編號 = 耳環.Label6.Text + "cart"
- Dim sqladd As String = "INSERT INTO 訂單(訂單編號,付款方式,取貨方式,訂單日期,會員編號,購物車編號) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text & "',N'" & ComboBox1.Text & "',N'" & ComboBox2.Text & "','" & t & "','" & 耳環.Label6.Text & "','" & 耳環.Label6.Text + "cart" & "')"
- Dim add = New SqlCommand(sqladd, conn)
- add.ExecuteNonQuery()
- 訂單.Show()
- Me.Visible = False
- MsgBox("購買成功!")
- conn.Close()
- Try
- Me.訂單TableAdapter.InsertQuery(m_訂單編號, m_付款方式, m_取貨方式, m_訂單日期, m_會員編號, m_購物車編號)
- Catch ex1 As Exception
- End Try
- Me.訂單DataGridView.Refresh()
- Me.訂單BindingSource.DataSource = 訂單TableAdapter.GetData()
- Me.訂單BindingSource.ResetBindings(False)
- '新增商品編號1紀錄
- conn.Open()
- Dim m_訂單編號1 = 耳環.Label6.Text + 耳環.Label20.Text + "a"
- Dim m_商品編號1 = 耳環.Label25.Text
- Dim m_訂購數量1 = 耳環.TextBox2.Text
- Dim m_價錢1 = 290 * Val(耳環.TextBox2.Text)
- Dim sqladd1 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "a" & "','" & 耳環.Label25.Text & "','" & 耳環.TextBox2.Text & "','" & 290 * Val(耳環.TextBox2.Text) & "')"
- Dim add1 = New SqlCommand(sqladd1, conn)
- add1.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號1, m_商品編號1, m_訂購數量1, m_價錢1)
- Catch ex2 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號1)
- conn.Open()
- Dim m_會員編號1 = 耳環.Label6.Text + "a" + 耳環.Label20.Text
- Dim m_商品編號1a = 耳環.Label25.Text
- Dim m_訂購數量1a = 耳環.TextBox2.Text
- Dim sqladd1a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "a" + 耳環.Label20.Text & "','" & 耳環.Label25.Text & "','" & 耳環.TextBox2.Text & "')"
- Dim add1a = New SqlCommand(sqladd1a, conn)
- add1a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號1, m_商品編號1a, m_訂購數量1a)
- Catch ex3 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號2紀錄
- conn.Open()
- Dim m_訂單編號2 = 耳環.Label6.Text + 耳環.Label20.Text + "b"
- Dim m_商品編號2 = 耳環.Label26.Text
- Dim m_訂購數量2 = 耳環.TextBox3.Text
- Dim m_價錢2 = 190 * Val(耳環.TextBox3.Text)
- Dim sqladd2 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "b" & "','" & 耳環.Label26.Text & "','" & 耳環.TextBox3.Text & "','" & 190 * Val(耳環.TextBox3.Text) & "')"
- Dim add2 = New SqlCommand(sqladd2, conn)
- add2.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號2, m_商品編號2, m_訂購數量2, m_價錢2)
- Catch ex4 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號2)
- conn.Open()
- Dim m_會員編號2 = 耳環.Label6.Text + "b" + 耳環.Label20.Text
- Dim m_商品編號2a = 耳環.Label26.Text
- Dim m_訂購數量2a = 耳環.TextBox3.Text
- Dim sqladd2a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "b" + 耳環.Label20.Text & "','" & 耳環.Label26.Text & "','" & 耳環.TextBox3.Text & "')"
- Dim add2a = New SqlCommand(sqladd2a, conn)
- add2a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號2, m_商品編號2a, m_訂購數量2a)
- Catch ex5 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號3紀錄
- conn.Open()
- Dim m_訂單編號3 = 耳環.Label6.Text + 耳環.Label20.Text + "c"
- Dim m_商品編號3 = 耳環.Label27.Text
- Dim m_訂購數量3 = 耳環.TextBox4.Text
- Dim m_價錢3 = 190 * Val(耳環.TextBox4.Text)
- Dim sqladd3 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "c" & "','" & 耳環.Label27.Text & "','" & 耳環.TextBox4.Text & "','" & 190 * Val(耳環.TextBox4.Text) & "')"
- Dim add3 = New SqlCommand(sqladd3, conn)
- add3.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號3, m_商品編號3, m_訂購數量3, m_價錢3)
- Catch ex6 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號3)
- conn.Open()
- Dim m_會員編號3 = 耳環.Label6.Text + "c" + 耳環.Label20.Text
- Dim m_商品編號3a = 耳環.Label27.Text
- Dim m_訂購數量3a = 耳環.TextBox4.Text
- Dim sqladd3a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "c" + 耳環.Label20.Text & "','" & 耳環.Label27.Text & "','" & 耳環.TextBox4.Text & "')"
- Dim add3a = New SqlCommand(sqladd3a, conn)
- add3a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號3, m_商品編號3a, m_訂購數量3a)
- Catch ex7 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號4紀錄
- conn.Open()
- Dim m_訂單編號4 = 耳環.Label6.Text + 耳環.Label20.Text + "d"
- Dim m_商品編號4 = 耳環.Label28.Text
- Dim m_訂購數量4 = 耳環.TextBox5.Text
- Dim m_價錢4 = 290 * Val(耳環.TextBox5.Text)
- Dim sqladd4 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "d" & "','" & 耳環.Label28.Text & "','" & 耳環.TextBox5.Text & "','" & 290 * Val(耳環.TextBox5.Text) & "')"
- Dim add4 = New SqlCommand(sqladd4, conn)
- add4.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號4, m_商品編號4, m_訂購數量4, m_價錢4)
- Catch ex8 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號4)
- conn.Open()
- Dim m_會員編號4 = 耳環.Label6.Text + "d" + 耳環.Label20.Text
- Dim m_商品編號4a = 耳環.Label28.Text
- Dim m_訂購數量4a = 耳環.TextBox5.Text
- Dim sqladd4a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "d" + 耳環.Label20.Text & "','" & 耳環.Label28.Text & "','" & 耳環.TextBox5.Text & "')"
- Dim add4a = New SqlCommand(sqladd4a, conn)
- add4a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號4, m_商品編號4a, m_訂購數量4a)
- Catch ex9 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號5紀錄
- conn.Open()
- Dim m_訂單編號5 = 耳環.Label6.Text + 耳環.Label20.Text + "e"
- Dim m_商品編號5 = 吊飾.Label12.Text
- Dim m_訂購數量5 = 吊飾.TextBox2.Text
- Dim m_價錢5 = 200 * Val(吊飾.TextBox2.Text)
- Dim sqladd5 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "e" & "','" & 吊飾.Label12.Text & "','" & 吊飾.TextBox2.Text & "','" & 200 * Val(吊飾.TextBox2.Text) & "')"
- Dim add5 = New SqlCommand(sqladd5, conn)
- add5.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號5, m_商品編號5, m_訂購數量5, m_價錢5)
- Catch ex10 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號5)
- conn.Open()
- Dim m_會員編號5 = 耳環.Label6.Text + "e" + 耳環.Label20.Text
- Dim m_商品編號5a = 吊飾.Label12.Text
- Dim m_訂購數量5a = 吊飾.TextBox2.Text
- Dim sqladd5a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "e" + 耳環.Label20.Text & "','" & 吊飾.Label12.Text & "','" & 吊飾.TextBox2.Text & "')"
- Dim add5a = New SqlCommand(sqladd5a, conn)
- add5a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號5, m_商品編號5a, m_訂購數量5a)
- Catch ex11 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號6紀錄
- conn.Open()
- Dim m_訂單編號6 = 耳環.Label6.Text + 耳環.Label20.Text + "f"
- Dim m_商品編號6 = 吊飾.Label13.Text
- Dim m_訂購數量6 = 吊飾.TextBox3.Text
- Dim m_價錢6 = 200 * Val(吊飾.TextBox3.Text)
- Dim sqladd6 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "f" & "','" & 吊飾.Label13.Text & "','" & 吊飾.TextBox3.Text & "','" & 200 * Val(吊飾.TextBox3.Text) & "')"
- Dim add6 = New SqlCommand(sqladd6, conn)
- add6.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號6, m_商品編號6, m_訂購數量6, m_價錢6)
- Catch ex12 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號6)
- conn.Open()
- Dim m_會員編號6 = 耳環.Label6.Text + "f" + 耳環.Label20.Text
- Dim m_商品編號6a = 吊飾.Label13.Text
- Dim m_訂購數量6a = 吊飾.TextBox3.Text
- Dim sqladd6a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "f" + 耳環.Label20.Text & "','" & 吊飾.Label13.Text & "','" & 吊飾.TextBox3.Text & "')"
- Dim add6a = New SqlCommand(sqladd6a, conn)
- add6a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號6, m_商品編號6a, m_訂購數量6a)
- Catch ex13 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號7紀錄
- conn.Open()
- Dim m_訂單編號7 = 耳環.Label6.Text + 耳環.Label20.Text + "g"
- Dim m_商品編號7 = 吊飾.Label14.Text
- Dim m_訂購數量7 = 吊飾.TextBox4.Text
- Dim m_價錢7 = 200 * Val(吊飾.TextBox4.Text)
- Dim sqladd7 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "g" & "','" & 吊飾.Label14.Text & "','" & 吊飾.TextBox4.Text & "','" & 200 * Val(吊飾.TextBox4.Text) & "')"
- Dim add7 = New SqlCommand(sqladd7, conn)
- add7.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號7, m_商品編號7, m_訂購數量7, m_價錢7)
- Catch ex14 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號7)
- conn.Open()
- Dim m_會員編號7 = 耳環.Label6.Text + "g" + 耳環.Label20.Text
- Dim m_商品編號7a = 吊飾.Label14.Text
- Dim m_訂購數量7a = 吊飾.TextBox4.Text
- Dim sqladd7a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "g" + 耳環.Label20.Text & "','" & 吊飾.Label14.Text & "','" & 吊飾.TextBox4.Text & "')"
- Dim add7a = New SqlCommand(sqladd7a, conn)
- add7a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號7, m_商品編號7a, m_訂購數量7a)
- Catch ex15 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號8紀錄
- conn.Open()
- Dim m_訂單編號8 = 耳環.Label6.Text + 耳環.Label20.Text + "h"
- Dim m_商品編號8 = 吊飾.Label15.Text
- Dim m_訂購數量8 = 吊飾.TextBox5.Text
- Dim m_價錢8 = 200 * Val(吊飾.TextBox5.Text)
- Dim sqladd8 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "h" & "','" & 吊飾.Label15.Text & "','" & 吊飾.TextBox5.Text & "','" & 200 * Val(吊飾.TextBox5.Text) & "')"
- Dim add8 = New SqlCommand(sqladd8, conn)
- add8.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號8, m_商品編號8, m_訂購數量8, m_價錢8)
- Catch ex16 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號8)
- conn.Open()
- Dim m_會員編號8 = 耳環.Label6.Text + "h" + 耳環.Label20.Text
- Dim m_商品編號8a = 吊飾.Label15.Text
- Dim m_訂購數量8a = 吊飾.TextBox5.Text
- Dim sqladd8a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "h" + 耳環.Label20.Text & "','" & 吊飾.Label15.Text & "','" & 吊飾.TextBox5.Text & "')"
- Dim add8a = New SqlCommand(sqladd8a, conn)
- add8a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號8, m_商品編號8a, m_訂購數量8a)
- Catch ex17 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號9紀錄
- conn.Open()
- Dim m_訂單編號9 = 耳環.Label6.Text + 耳環.Label20.Text + "i"
- Dim m_商品編號9 = 指甲油.Label12.Text
- Dim m_訂購數量9 = 指甲油.TextBox3.Text
- Dim m_價錢9 = 380 * Val(指甲油.TextBox3.Text)
- Dim sqladd9 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "i" & "','" & 指甲油.Label12.Text & "','" & 指甲油.TextBox3.Text & "','" & 380 * Val(指甲油.TextBox3.Text) & "')"
- Dim add9 = New SqlCommand(sqladd9, conn)
- add9.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號9, m_商品編號9, m_訂購數量9, m_價錢9)
- Catch ex18 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號9)
- conn.Open()
- Dim m_會員編號9 = 耳環.Label6.Text + "i" + 耳環.Label20.Text
- Dim m_商品編號9a = 指甲油.Label12.Text
- Dim m_訂購數量9a = 指甲油.TextBox3.Text
- Dim sqladd9a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "i" + 耳環.Label20.Text & "','" & 指甲油.Label12.Text & "','" & 指甲油.TextBox3.Text & "')"
- Dim add9a = New SqlCommand(sqladd9a, conn)
- add9a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號9, m_商品編號9a, m_訂購數量9a)
- Catch ex19 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號10紀錄
- conn.Open()
- Dim m_訂單編號10 = 耳環.Label6.Text + 耳環.Label20.Text + "j"
- Dim m_商品編號10 = 指甲油.Label13.Text
- Dim m_訂購數量10 = 指甲油.TextBox2.Text
- Dim m_價錢10 = 380 * Val(指甲油.TextBox2.Text)
- Dim sqladd10 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "j" & "','" & 指甲油.Label13.Text & "','" & 指甲油.TextBox2.Text & "','" & 380 * Val(指甲油.TextBox2.Text) & "')"
- Dim add10 = New SqlCommand(sqladd10, conn)
- add10.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號10, m_商品編號10, m_訂購數量10, m_價錢10)
- Catch ex20 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號10)
- conn.Open()
- Dim m_會員編號10 = 耳環.Label6.Text + "j" + 耳環.Label20.Text
- Dim m_商品編號10a = 指甲油.Label13.Text
- Dim m_訂購數量10a = 指甲油.TextBox2.Text
- Dim sqladd10a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "j" + 耳環.Label20.Text & "','" & 指甲油.Label13.Text & "','" & 指甲油.TextBox2.Text & "')"
- Dim add10a = New SqlCommand(sqladd10a, conn)
- add10a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號10, m_商品編號10a, m_訂購數量10a)
- Catch ex21 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號11紀錄
- conn.Open()
- Dim m_訂單編號11 = 耳環.Label6.Text + 耳環.Label20.Text + "k"
- Dim m_商品編號11 = 指甲油.Label14.Text
- Dim m_訂購數量11 = 指甲油.TextBox4.Text
- Dim m_價錢11 = 380 * Val(指甲油.TextBox4.Text)
- Dim sqladd11 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "k" & "','" & 指甲油.Label14.Text & "','" & 指甲油.TextBox4.Text & "','" & 380 * Val(指甲油.TextBox4.Text) & "')"
- Dim add11 = New SqlCommand(sqladd11, conn)
- add11.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號11, m_商品編號11, m_訂購數量11, m_價錢11)
- Catch ex22 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號11)
- conn.Open()
- Dim m_會員編號11 = 耳環.Label6.Text + "k" + 耳環.Label20.Text
- Dim m_商品編號11a = 指甲油.Label14.Text
- Dim m_訂購數量11a = 指甲油.TextBox4.Text
- Dim sqladd11a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "k" + 耳環.Label20.Text & "','" & 指甲油.Label14.Text & "','" & 指甲油.TextBox4.Text & "')"
- Dim add11a = New SqlCommand(sqladd11a, conn)
- add11a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號11, m_商品編號11a, m_訂購數量11a)
- Catch ex23 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號12紀錄
- conn.Open()
- Dim m_訂單編號12 = 耳環.Label6.Text + 耳環.Label20.Text + "l"
- Dim m_商品編號12 = 指甲油.Label15.Text
- Dim m_訂購數量12 = 指甲油.TextBox5.Text
- Dim m_價錢12 = 290 * Val(指甲油.TextBox5.Text)
- Dim sqladd12 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "l" & "','" & 指甲油.Label15.Text & "','" & 指甲油.TextBox5.Text & "','" & 290 * Val(指甲油.TextBox5.Text) & "')"
- Dim add12 = New SqlCommand(sqladd12, conn)
- add12.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號12, m_商品編號12, m_訂購數量12, m_價錢12)
- Catch ex24 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號12)
- conn.Open()
- Dim m_會員編號12 = 耳環.Label6.Text + "l" + 耳環.Label20.Text
- Dim m_商品編號12a = 指甲油.Label15.Text
- Dim m_訂購數量12a = 指甲油.TextBox5.Text
- Dim sqladd12a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "l" + 耳環.Label20.Text & "','" & 指甲油.Label15.Text & "','" & 指甲油.TextBox5.Text & "')"
- Dim add12a = New SqlCommand(sqladd12a, conn)
- add12a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號12, m_商品編號12a, m_訂購數量12a)
- Catch ex25 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號13紀錄
- conn.Open()
- Dim m_訂單編號13 = 耳環.Label6.Text + 耳環.Label20.Text + "m"
- Dim m_商品編號13 = 便籤夾.Label2.Text
- Dim m_訂購數量13 = 便籤夾.TextBox3.Text
- Dim m_價錢13 = 85 * Val(便籤夾.TextBox3.Text)
- Dim sqladd13 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "m" & "','" & 便籤夾.Label2.Text & "','" & 便籤夾.TextBox3.Text & "','" & 85 * Val(便籤夾.TextBox3.Text) & "')"
- Dim add13 = New SqlCommand(sqladd13, conn)
- add13.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號13, m_商品編號13, m_訂購數量13, m_價錢13)
- Catch ex26 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號13)
- conn.Open()
- Dim m_會員編號13 = 耳環.Label6.Text + "m" + 耳環.Label20.Text
- Dim m_商品編號13a = 便籤夾.Label2.Text
- Dim m_訂購數量13a = 便籤夾.TextBox3.Text
- Dim sqladd13a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "m" + 耳環.Label20.Text & "','" & 便籤夾.Label2.Text & "','" & 便籤夾.TextBox3.Text & "')"
- Dim add13a = New SqlCommand(sqladd13a, conn)
- add13a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號13, m_商品編號13a, m_訂購數量13a)
- Catch ex27 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '新增商品編號14紀錄
- conn.Open()
- Dim m_訂單編號14 = 耳環.Label6.Text + 耳環.Label20.Text + "n"
- Dim m_商品編號14 = 手工餅乾.Label2.Text
- Dim m_訂購數量14 = 手工餅乾.TextBox3.Text
- Dim m_價錢14 = 30 * Val(手工餅乾.TextBox3.Text)
- Dim sqladd14 As String = "INSERT INTO 紀錄(訂單編號,商品編號,訂購數量,價錢) VALUES('" & 耳環.Label6.Text + 耳環.Label20.Text + "n" & "','" & 手工餅乾.Label2.Text & "','" & 手工餅乾.TextBox3.Text & "','" & 30 * Val(手工餅乾.TextBox3.Text) & "')"
- Dim add14 = New SqlCommand(sqladd14, conn)
- add14.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.紀錄TableAdapter.InsertQuery(m_訂單編號14, m_商品編號14, m_訂購數量14, m_價錢14)
- Catch ex28 As Exception
- End Try
- Me.紀錄DataGridView.Refresh()
- Me.紀錄BindingSource.DataSource = 紀錄TableAdapter.GetData()
- Me.紀錄BindingSource.ResetBindings(False)
- '新增會員購買紀錄(商品編號14)
- conn.Open()
- Dim m_會員編號14 = 耳環.Label6.Text + "n" + 耳環.Label20.Text
- Dim m_商品編號14a = 手工餅乾.Label2.Text
- Dim m_訂購數量14a = 手工餅乾.TextBox3.Text
- Dim sqladd14a As String = "INSERT INTO 訂購(會員編號,商品編號,訂購數量) VALUES('" & 耳環.Label6.Text + "n" + 耳環.Label20.Text & "','" & 手工餅乾.Label2.Text & "','" & 手工餅乾.TextBox3.Text & "')"
- Dim add14a = New SqlCommand(sqladd14a, conn)
- add14a.ExecuteNonQuery()
- Me.Visible = False
- conn.Close()
- Try
- Me.訂購TableAdapter.InsertQuery(m_會員編號14, m_商品編號14a, m_訂購數量14a)
- Catch ex29 As Exception
- End Try
- Me.訂購DataGridView.Refresh()
- Me.訂購BindingSource.DataSource = 訂購TableAdapter.GetData()
- Me.訂購BindingSource.ResetBindings(False)
- '修改商品編號1庫存數量
- conn.Open()
- Dim m_庫存數量1 = Val(耳環.Label21.Text) - Val(耳環.TextBox2.Text)
- Dim m_商品編號1b = 耳環.Label25.Text
- Dim sqlupd1 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(耳環.Label21.Text) - Val(耳環.TextBox2.Text) & "' WHERE 商品編號 ='" & 耳環.Label25.Text & "'"
- Dim upd1 = New SqlCommand(sqlupd1, conn)
- Try
- upd1.ExecuteNonQuery()
- Catch ex30 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量1, m_商品編號1b)
- Catch ex31 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號2庫存數量
- conn.Open()
- Dim m_庫存數量2 = Val(耳環.Label22.Text) - Val(耳環.TextBox3.Text)
- Dim m_商品編號2b = 耳環.Label26.Text
- Dim sqlupd2 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(耳環.Label22.Text) - Val(耳環.TextBox3.Text) & "' WHERE 商品編號 ='" & 耳環.Label26.Text & "'"
- Dim upd2 = New SqlCommand(sqlupd2, conn)
- Try
- upd2.ExecuteNonQuery()
- Catch ex32 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量2, m_商品編號2b)
- Catch ex33 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號3庫存數量
- conn.Open()
- Dim m_庫存數量3 = Val(耳環.Label23.Text) - Val(耳環.TextBox4.Text)
- Dim m_商品編號3b = 耳環.Label27.Text
- Dim sqlupd3 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(耳環.Label23.Text) - Val(耳環.TextBox4.Text) & "' WHERE 商品編號 ='" & 耳環.Label27.Text & "'"
- Dim upd3 = New SqlCommand(sqlupd3, conn)
- Try
- upd3.ExecuteNonQuery()
- Catch ex34 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量3, m_商品編號3b)
- Catch ex35 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號4庫存數量
- conn.Open()
- Dim m_庫存數量4 = Val(耳環.Label24.Text) - Val(耳環.TextBox5.Text)
- Dim m_商品編號4b = 耳環.Label28.Text
- Dim sqlupd4 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(耳環.Label24.Text) - Val(耳環.TextBox5.Text) & "' WHERE 商品編號 ='" & 耳環.Label28.Text & "'"
- Dim upd4 = New SqlCommand(sqlupd4, conn)
- Try
- upd4.ExecuteNonQuery()
- Catch ex36 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量4, m_商品編號4b)
- Catch ex37 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號5庫存數量
- conn.Open()
- Dim m_庫存數量5 = Val(吊飾.Label20.Text) - Val(吊飾.TextBox2.Text)
- Dim m_商品編號5b = 吊飾.Label12.Text
- Dim sqlupd5 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(吊飾.Label20.Text) - Val(吊飾.TextBox2.Text) & "' WHERE 商品編號 ='" & 吊飾.Label12.Text & "'"
- Dim upd5 = New SqlCommand(sqlupd5, conn)
- Try
- upd5.ExecuteNonQuery()
- Catch ex38 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量5, m_商品編號5b)
- Catch ex39 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號6庫存數量
- conn.Open()
- Dim m_庫存數量6 = Val(吊飾.Label21.Text) - Val(吊飾.TextBox3.Text)
- Dim m_商品編號6b = 吊飾.Label13.Text
- Dim sqlupd6 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(吊飾.Label21.Text) - Val(吊飾.TextBox3.Text) & "' WHERE 商品編號 ='" & 吊飾.Label13.Text & "'"
- Dim upd6 = New SqlCommand(sqlupd6, conn)
- Try
- upd6.ExecuteNonQuery()
- Catch ex40 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量6, m_商品編號6b)
- Catch ex41 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號7庫存數量
- conn.Open()
- Dim m_庫存數量7 = Val(吊飾.Label22.Text) - Val(吊飾.TextBox4.Text)
- Dim m_商品編號7b = 吊飾.Label14.Text
- Dim sqlupd7 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(吊飾.Label22.Text) - Val(吊飾.TextBox4.Text) & "' WHERE 商品編號 ='" & 吊飾.Label14.Text & "'"
- Dim upd7 = New SqlCommand(sqlupd7, conn)
- Try
- upd7.ExecuteNonQuery()
- Catch ex42 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量7, m_商品編號7b)
- Catch ex43 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號8庫存數量
- conn.Open()
- Dim m_庫存數量8 = Val(吊飾.Label23.Text) - Val(吊飾.TextBox5.Text)
- Dim m_商品編號8b = 吊飾.Label15.Text
- Dim sqlupd8 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(吊飾.Label23.Text) - Val(吊飾.TextBox5.Text) & "' WHERE 商品編號 ='" & 吊飾.Label15.Text & "'"
- Dim upd8 = New SqlCommand(sqlupd8, conn)
- Try
- upd8.ExecuteNonQuery()
- Catch ex44 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量8, m_商品編號8b)
- Catch ex45 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號9庫存數量
- conn.Open()
- Dim m_庫存數量9 = Val(指甲油.Label20.Text) - Val(指甲油.TextBox3.Text)
- Dim m_商品編號9b = 指甲油.Label12.Text
- Dim sqlupd9 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(指甲油.Label20.Text) - Val(指甲油.TextBox3.Text) & "' WHERE 商品編號 ='" & 指甲油.Label12.Text & "'"
- Dim upd9 = New SqlCommand(sqlupd9, conn)
- Try
- upd9.ExecuteNonQuery()
- Catch ex46 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量9, m_商品編號9b)
- Catch ex47 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號10庫存數量
- conn.Open()
- Dim m_庫存數量10 = Val(指甲油.Label21.Text) - Val(指甲油.TextBox2.Text)
- Dim m_商品編號10b = 指甲油.Label13.Text
- Dim sqlupd10 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(指甲油.Label21.Text) - Val(指甲油.TextBox2.Text) & "' WHERE 商品編號 ='" & 指甲油.Label13.Text & "'"
- Dim upd10 = New SqlCommand(sqlupd10, conn)
- Try
- upd10.ExecuteNonQuery()
- Catch ex48 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量10, m_商品編號10b)
- Catch ex49 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號11庫存數量
- conn.Open()
- Dim m_庫存數量11 = Val(指甲油.Label22.Text) - Val(指甲油.TextBox4.Text)
- Dim m_商品編號11b = 指甲油.Label14.Text
- Dim sqlupd11 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(指甲油.Label22.Text) - Val(指甲油.TextBox4.Text) & "' WHERE 商品編號 ='" & 指甲油.Label14.Text & "'"
- Dim upd11 = New SqlCommand(sqlupd11, conn)
- Try
- upd11.ExecuteNonQuery()
- Catch ex50 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量11, m_商品編號11b)
- Catch ex51 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號12庫存數量
- conn.Open()
- Dim m_庫存數量12 = Val(指甲油.Label23.Text) - Val(指甲油.TextBox5.Text)
- Dim m_商品編號12b = 指甲油.Label15.Text
- Dim sqlupd12 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(指甲油.Label23.Text) - Val(指甲油.TextBox5.Text) & "' WHERE 商品編號 ='" & 指甲油.Label15.Text & "'"
- Dim upd12 = New SqlCommand(sqlupd12, conn)
- Try
- upd12.ExecuteNonQuery()
- Catch ex52 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量12, m_商品編號12b)
- Catch ex53 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號13庫存數量
- conn.Open()
- Dim m_庫存數量13 = Val(便籤夾.Label5.Text) - Val(便籤夾.TextBox3.Text)
- Dim m_商品編號13b = 便籤夾.Label2.Text
- Dim sqlupd13 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(便籤夾.Label5.Text) - Val(便籤夾.TextBox3.Text) & "' WHERE 商品編號 ='" & 便籤夾.Label2.Text & "'"
- Dim upd13 = New SqlCommand(sqlupd13, conn)
- Try
- upd13.ExecuteNonQuery()
- Catch ex54 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量13, m_商品編號13b)
- Catch ex55 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- '修改商品編號14庫存數量
- conn.Open()
- Dim m_庫存數量14 = Val(手工餅乾.Label5.Text) - Val(手工餅乾.TextBox3.Text)
- Dim m_商品編號14b = 手工餅乾.Label2.Text
- Dim sqlupd14 As String = "UPDATE 商品 Set 商品編號 = 庫存數量 = '" & Val(手工餅乾.Label5.Text) - Val(手工餅乾.TextBox3.Text) & "' WHERE 商品編號 ='" & 手工餅乾.Label2.Text & "'"
- Dim upd14 = New SqlCommand(sqlupd14, conn)
- Try
- upd14.ExecuteNonQuery()
- Catch ex56 As Exception
- End Try
- conn.Close()
- Try
- 商品TableAdapter.UpdateQueryNumber(m_庫存數量14, m_商品編號14b)
- Catch ex57 As Exception
- End Try
- Me.商品DataGridView.Refresh()
- Me.商品BindingSource.DataSource = 商品TableAdapter.GetData()
- Me.商品BindingSource.ResetBindings(False)
- End Sub
- Private Sub 訂單確認_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'TODO: 這行程式碼會將資料載入 '謎鹿DataSet.商品' 資料表。您可以視需要進行移動或移除。
- Me.商品TableAdapter.Fill(Me.謎鹿DataSet.商品)
- 'TODO: 這行程式碼會將資料載入 '謎鹿DataSet.訂購' 資料表。您可以視需要進行移動或移除。
- Me.訂購TableAdapter.Fill(Me.謎鹿DataSet.訂購)
- 'TODO: 這行程式碼會將資料載入 '謎鹿DataSet.紀錄' 資料表。您可以視需要進行移動或移除。
- Me.紀錄TableAdapter.Fill(Me.謎鹿DataSet.紀錄)
- 'TODO: 這行程式碼會將資料載入 '謎鹿DataSet.訂單' 資料表。您可以視需要進行移動或移除。
- Me.訂單TableAdapter.Fill(Me.謎鹿DataSet.訂單)
- 'TODO: 這行程式碼會將資料載入 '謎鹿DataSet.訂單' 資料表。您可以視需要進行移動或移除。
- Me.訂單TableAdapter.Fill(Me.謎鹿DataSet.訂單)
- Label6.Text = 購物車.Label48.Text
- End Sub
- End Class
|