|
@@ -123,8 +123,8 @@ Public Class 供應商管理_製鞋樣品
|
123
|
123
|
End If
|
124
|
124
|
End Sub
|
125
|
125
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
126
|
|
- If conn.State = ConnectionState.Closed Then : conn.Open() : End If
|
127
|
|
- SQL1 = "UPDATE 供應商清單 SET 廠商 = N'" & TextBox2.Text & "', 公司名 = N'" & TextBox3.Text & "', 公司地址 = N'" & TextBox4.Text &
|
|
126
|
+ conn.Close() : If conn.State = ConnectionState.Closed Then : conn.Open() : End If
|
|
127
|
+ SQL1 = "UPDATE 供應商清單 SET 公司名 = N'" & TextBox3.Text & "', 公司地址 = N'" & TextBox4.Text &
|
128
|
128
|
"', 公司電話1 = N'" & TextBox5.Text & "', 公司電話2 = N'" & TextBox6.Text & "', 公司電話3 = N'" & TextBox7.Text & "', 公司傳真1 = N'" & TextBox8.Text &
|
129
|
129
|
"', 公司傳真2 = N'" & TextBox9.Text & "', 公司傳真3 = N'" & ComboBox1.Text & "', 聯繫人1 = N'" & TextBox11.Text & "', 聯繫人2 = N'" & TextBox12.Text &
|
130
|
130
|
"', 聯繫人3 = N'" & TextBox13.Text & "', 聯繫人1職稱 = N'" & TextBox14.Text & "', 聯繫人2職稱 = N'" & TextBox15.Text & "', 聯繫人3職稱 = N'" & TextBox16.Text &
|
|
@@ -141,17 +141,24 @@ Public Class 供應商管理_製鞋樣品
|
141
|
141
|
TextBox21.Enabled = False : TextBox22.Enabled = False : TextBox23.Enabled = False
|
142
|
142
|
End Sub
|
143
|
143
|
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
144
|
|
- SQL1 = "DELETE FROM 供應商清單 WHERE (供應商編碼 = '" & TextBox1.Text & "')"
|
145
|
|
- cmd.CommandText = SQL1 : cmd.Connection = conn
|
146
|
144
|
If conn.State = ConnectionState.Closed Then : conn.Open() : End If
|
147
|
|
- Dim aa As MsgBoxResult
|
148
|
|
- aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
|
149
|
|
- If aa = MsgBoxResult.Ok Then
|
150
|
|
- cmd.ExecuteNonQuery() : conn.Close()
|
151
|
|
- Set_日期格式轉換()
|
152
|
|
- MsgBox("刪除完成")
|
153
|
|
- 讀取供應商料表() : Set_grid()
|
154
|
|
- End If
|
|
145
|
+ SQL1 = "SELECT 廠商 FROM 樣品訂單部件表 WHERE (廠商 = N'" & TextBox2.Text & "')"
|
|
146
|
+ cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : dr = cmd.ExecuteReader
|
|
147
|
+ If dr.Read() Then
|
|
148
|
+ MsgBox("該廠商已經有資料引用不可刪除?")
|
|
149
|
+ Else
|
|
150
|
+ conn.Close()
|
|
151
|
+ Dim aa As MsgBoxResult
|
|
152
|
+ aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
|
|
153
|
+ If aa = MsgBoxResult.Ok Then
|
|
154
|
+ If conn.State = ConnectionState.Closed Then : conn.Open() : End If
|
|
155
|
+ SQL1 = "DELETE FROM 供應商清單 WHERE (供應商編碼 = '" & TextBox1.Text & "')"
|
|
156
|
+ cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : conn.Close()
|
|
157
|
+ Set_日期格式轉換()
|
|
158
|
+ MsgBox("刪除完成")
|
|
159
|
+ 讀取供應商料表() : Set_grid()
|
|
160
|
+ End If
|
|
161
|
+ End If : conn.Close()
|
155
|
162
|
End Sub
|
156
|
163
|
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
157
|
164
|
PA = InputBox("請輸入要查詢的供應商資料") : 讀取供應商料表() : Set_grid() : PA = ""
|
|
@@ -161,7 +168,7 @@ Public Class 供應商管理_製鞋樣品
|
161
|
168
|
End Sub
|
162
|
169
|
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
163
|
170
|
Button5.Enabled = False : Button1.Enabled = False : Button7.Enabled = False : Button2.Enabled = True : Button3.Enabled = False
|
164
|
|
- TextBox2.Enabled = True : TextBox3.Enabled = True : TextBox4.Enabled = True : TextBox5.Enabled = True : TextBox6.Enabled = True : TextBox7.Enabled = True : TextBox8.Enabled = True
|
|
171
|
+ TextBox3.Enabled = True : TextBox4.Enabled = True : TextBox5.Enabled = True : TextBox6.Enabled = True : TextBox7.Enabled = True : TextBox8.Enabled = True
|
165
|
172
|
TextBox9.Enabled = True : ComboBox1.Enabled = True : TextBox11.Enabled = True : TextBox12.Enabled = True : TextBox13.Enabled = True : TextBox14.Enabled = True : TextBox15.Enabled = True
|
166
|
173
|
TextBox16.Enabled = True : TextBox17.Enabled = True : TextBox18.Enabled = True : TextBox19.Enabled = True : TextBox21.Enabled = True : TextBox22.Enabled = True : TextBox23.Enabled = True
|
167
|
174
|
End Sub
|