Browse Source

版本號 : 2021032401

更新內容如下
1、量產訂單控制表新增批量出貨功能
B70340 4 years ago
parent
commit
6a317da9b0

BIN
.vs/WINPROFIT-ERP-SYS/v16/.suo View File


+ 1
- 1
SHENKANG-MES-SYS/MyModule/全域變數.vb View File

@@ -9,7 +9,7 @@
9 9
                                  CC51, CC52, CC53, CC54, CC55, CC56, CC57, CC58, CC59, CC60, CC61, CC62, CC63, CC64, CC65, CC66, CC67, CC68, CC69, CC70, CC71, CC72, CC73, CC74, CC75, CC76, CC77, CC78, 
10 10
                                  CC79, CC80, CC81, CC82, CC83, CC84, CC85, CC86, CC87, CC88, CC89, CC90, CC91, CC92, CC93, CC94, CC95 FROM"
11 11
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12
-    Public 版本 As String = "2021032001"
12
+    Public 版本 As String = "2021032401"
13 13
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 14
     Public PA As String = "" : Public PA1 As String = "" : Public PA2 As String = "" : Public PA3 As String = "" : Public PA4 As String = "" : Public PA5 As String = "" : Public PA6 As String = ""
15 15
     Public PA7 As String = "" : Public PA8 As String = "" : Public PA9 As String = "" : Public PA10 As String = "" : Public PA11 As String = "" : Public PA12 As String = "" : Public PA13 As String = ""

+ 1
- 1
SHENKANG-MES-SYS/bin/Debug/WINPROFIT-ERP-SYS.application View File

@@ -14,7 +14,7 @@
14 14
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15 15
         </dsig:Transforms>
16 16
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17
-        <dsig:DigestValue>MwznE+t+VJ2DCVpMsYtk/4u6uNvGC9XlUrmqoqDyUYM=</dsig:DigestValue>
17
+        <dsig:DigestValue>46s1qOI2Y4vqU/CeH7jSwe0cq5XzylLjzAAMVh+NggM=</dsig:DigestValue>
18 18
       </hash>
19 19
     </dependentAssembly>
20 20
   </dependency>

BIN
SHENKANG-MES-SYS/bin/Debug/WINPROFIT-ERP-SYS.exe View File


+ 2
- 2
SHENKANG-MES-SYS/bin/Debug/WINPROFIT-ERP-SYS.exe.manifest View File

@@ -43,14 +43,14 @@
43 43
     </dependentAssembly>
44 44
   </dependency>
45 45
   <dependency>
46
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WINPROFIT-ERP-SYS.exe" size="5496832">
46
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WINPROFIT-ERP-SYS.exe" size="5495808">
47 47
       <assemblyIdentity name="WINPROFIT-ERP-SYS" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
48 48
       <hash>
49 49
         <dsig:Transforms>
50 50
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
51 51
         </dsig:Transforms>
52 52
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
53
-        <dsig:DigestValue>0Kwj9E7mYtlkQxPj7ialobYEtpkb5MybtLzGbvnL2Lc=</dsig:DigestValue>
53
+        <dsig:DigestValue>F97StZFAfkwgDW5fmSQKqyGgZVBJP5MGGwhtBnn9j9Y=</dsig:DigestValue>
54 54
       </hash>
55 55
     </dependentAssembly>
56 56
   </dependency>

BIN
SHENKANG-MES-SYS/bin/Debug/WINPROFIT-ERP-SYS.pdb View File


BIN
SHENKANG-MES-SYS/bin/Debug/app.publish/WINPROFIT-ERP-SYS.exe View File


+ 1
- 1
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.application View File

@@ -14,7 +14,7 @@
14 14
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
15 15
         </dsig:Transforms>
16 16
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
17
-        <dsig:DigestValue>MwznE+t+VJ2DCVpMsYtk/4u6uNvGC9XlUrmqoqDyUYM=</dsig:DigestValue>
17
+        <dsig:DigestValue>46s1qOI2Y4vqU/CeH7jSwe0cq5XzylLjzAAMVh+NggM=</dsig:DigestValue>
18 18
       </hash>
19 19
     </dependentAssembly>
20 20
   </dependency>

BIN
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.exe View File


+ 2
- 2
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.exe.manifest View File

@@ -43,14 +43,14 @@
43 43
     </dependentAssembly>
44 44
   </dependency>
45 45
   <dependency>
46
-    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WINPROFIT-ERP-SYS.exe" size="5496832">
46
+    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WINPROFIT-ERP-SYS.exe" size="5495808">
47 47
       <assemblyIdentity name="WINPROFIT-ERP-SYS" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
48 48
       <hash>
49 49
         <dsig:Transforms>
50 50
           <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
51 51
         </dsig:Transforms>
52 52
         <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
53
-        <dsig:DigestValue>0Kwj9E7mYtlkQxPj7ialobYEtpkb5MybtLzGbvnL2Lc=</dsig:DigestValue>
53
+        <dsig:DigestValue>F97StZFAfkwgDW5fmSQKqyGgZVBJP5MGGwhtBnn9j9Y=</dsig:DigestValue>
54 54
       </hash>
55 55
     </dependentAssembly>
56 56
   </dependency>

BIN
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.pdb View File


BIN
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.vbproj.GenerateResource.cache View File


BIN
SHENKANG-MES-SYS/obj/Debug/WINPROFIT-ERP-SYS.vbprojAssemblyReference.cache View File


+ 70
- 31
SHENKANG-MES-SYS/量產訂單管理系統/量產訂單控制表.Designer.vb View File

@@ -24,7 +24,7 @@ Partial Class 量產訂單控制表
24 24
     Private Sub InitializeComponent()
25 25
         Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26 26
         Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Me.DataGridView3 = New System.Windows.Forms.DataGridView()
27
+        Me.控制表_dgv = New System.Windows.Forms.DataGridView()
28 28
         Me.Button30 = New System.Windows.Forms.Button()
29 29
         Me.TextBox12 = New System.Windows.Forms.TextBox()
30 30
         Me.Label12 = New System.Windows.Forms.Label()
@@ -34,6 +34,9 @@ Partial Class 量產訂單控制表
34 34
         Me.CheckBox25 = New System.Windows.Forms.CheckBox()
35 35
         Me.Button38 = New System.Windows.Forms.Button()
36 36
         Me.GroupBox1 = New System.Windows.Forms.GroupBox()
37
+        Me.啟用批量出貨_ch = New System.Windows.Forms.CheckBox()
38
+        Me.批量出貨_bt = New System.Windows.Forms.Button()
39
+        Me.Label50 = New System.Windows.Forms.Label()
37 40
         Me.TextBox13 = New System.Windows.Forms.TextBox()
38 41
         Me.Label19 = New System.Windows.Forms.Label()
39 42
         Me.Label1 = New System.Windows.Forms.Label()
@@ -75,7 +78,7 @@ Partial Class 量產訂單控制表
75 78
         Me.Button5 = New System.Windows.Forms.Button()
76 79
         Me.PictureBox2 = New System.Windows.Forms.PictureBox()
77 80
         Me.PictureBox1 = New System.Windows.Forms.PictureBox()
78
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit()
81
+        CType(Me.控制表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
79 82
         Me.GroupBox2.SuspendLayout()
80 83
         Me.GroupBox1.SuspendLayout()
81 84
         CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -83,19 +86,19 @@ Partial Class 量產訂單控制表
83 86
         CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
84 87
         Me.SuspendLayout()
85 88
         '
86
-        'DataGridView3
89
+        '控制表_dgv
87 90
         '
88
-        Me.DataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
89
-        Me.DataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
90
-        Me.DataGridView3.Location = New System.Drawing.Point(12, 140)
91
-        Me.DataGridView3.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
92
-        Me.DataGridView3.Name = "DataGridView3"
93
-        Me.DataGridView3.RowHeadersWidth = 5
91
+        Me.控制表_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
92
+        Me.控制表_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
93
+        Me.控制表_dgv.Location = New System.Drawing.Point(12, 140)
94
+        Me.控制表_dgv.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
95
+        Me.控制表_dgv.Name = "控制表_dgv"
96
+        Me.控制表_dgv.RowHeadersWidth = 5
94 97
         DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
95
-        Me.DataGridView3.RowsDefaultCellStyle = DataGridViewCellStyle1
96
-        Me.DataGridView3.RowTemplate.Height = 24
97
-        Me.DataGridView3.Size = New System.Drawing.Size(1890, 827)
98
-        Me.DataGridView3.TabIndex = 867
98
+        Me.控制表_dgv.RowsDefaultCellStyle = DataGridViewCellStyle1
99
+        Me.控制表_dgv.RowTemplate.Height = 24
100
+        Me.控制表_dgv.Size = New System.Drawing.Size(1890, 827)
101
+        Me.控制表_dgv.TabIndex = 867
99 102
         '
100 103
         'Button30
101 104
         '
@@ -141,7 +144,7 @@ Partial Class 量產訂單控制表
141 144
         Me.GroupBox2.Controls.Add(Me.CheckBox24)
142 145
         Me.GroupBox2.Controls.Add(Me.CheckBox25)
143 146
         Me.GroupBox2.Controls.Add(Me.Button38)
144
-        Me.GroupBox2.Location = New System.Drawing.Point(755, 5)
147
+        Me.GroupBox2.Location = New System.Drawing.Point(723, 5)
145 148
         Me.GroupBox2.Name = "GroupBox2"
146 149
         Me.GroupBox2.Size = New System.Drawing.Size(124, 128)
147 150
         Me.GroupBox2.TabIndex = 873
@@ -182,6 +185,9 @@ Partial Class 量產訂單控制表
182 185
         '
183 186
         'GroupBox1
184 187
         '
188
+        Me.GroupBox1.Controls.Add(Me.啟用批量出貨_ch)
189
+        Me.GroupBox1.Controls.Add(Me.批量出貨_bt)
190
+        Me.GroupBox1.Controls.Add(Me.Label50)
185 191
         Me.GroupBox1.Controls.Add(Me.TextBox13)
186 192
         Me.GroupBox1.Controls.Add(Me.Label19)
187 193
         Me.GroupBox1.Controls.Add(Me.Label1)
@@ -193,17 +199,47 @@ Partial Class 量產訂單控制表
193 199
         Me.GroupBox1.Controls.Add(Me.DateTimePicker30)
194 200
         Me.GroupBox1.Controls.Add(Me.CheckBox11)
195 201
         Me.GroupBox1.Controls.Add(Me.Label56)
196
-        Me.GroupBox1.Location = New System.Drawing.Point(885, 5)
202
+        Me.GroupBox1.Location = New System.Drawing.Point(853, 5)
197 203
         Me.GroupBox1.Name = "GroupBox1"
198
-        Me.GroupBox1.Size = New System.Drawing.Size(350, 128)
204
+        Me.GroupBox1.Size = New System.Drawing.Size(382, 128)
199 205
         Me.GroupBox1.TabIndex = 872
200 206
         Me.GroupBox1.TabStop = False
201 207
         Me.GroupBox1.Text = "出貨操作"
202 208
         '
209
+        '啟用批量出貨_ch
210
+        '
211
+        Me.啟用批量出貨_ch.AutoSize = True
212
+        Me.啟用批量出貨_ch.Location = New System.Drawing.Point(276, 38)
213
+        Me.啟用批量出貨_ch.Name = "啟用批量出貨_ch"
214
+        Me.啟用批量出貨_ch.Size = New System.Drawing.Size(99, 20)
215
+        Me.啟用批量出貨_ch.TabIndex = 1090
216
+        Me.啟用批量出貨_ch.Text = "啟用批量出貨"
217
+        Me.啟用批量出貨_ch.UseVisualStyleBackColor = True
218
+        '
219
+        '批量出貨_bt
220
+        '
221
+        Me.批量出貨_bt.ForeColor = System.Drawing.Color.Black
222
+        Me.批量出貨_bt.Location = New System.Drawing.Point(275, 63)
223
+        Me.批量出貨_bt.Name = "批量出貨_bt"
224
+        Me.批量出貨_bt.Size = New System.Drawing.Size(98, 27)
225
+        Me.批量出貨_bt.TabIndex = 1089
226
+        Me.批量出貨_bt.Text = "批量出貨"
227
+        Me.批量出貨_bt.UseVisualStyleBackColor = True
228
+        '
229
+        'Label50
230
+        '
231
+        Me.Label50.AutoSize = True
232
+        Me.Label50.ForeColor = System.Drawing.Color.Red
233
+        Me.Label50.Location = New System.Drawing.Point(6, 15)
234
+        Me.Label50.Name = "Label50"
235
+        Me.Label50.Size = New System.Drawing.Size(367, 16)
236
+        Me.Label50.TabIndex = 1088
237
+        Me.Label50.Text = "注意 : 先打勾 [啟用量出貨] 按鈕在選資料,系統讀取速度會比較快。"
238
+        '
203 239
         'TextBox13
204 240
         '
205 241
         Me.TextBox13.ForeColor = System.Drawing.Color.Red
206
-        Me.TextBox13.Location = New System.Drawing.Point(176, 69)
242
+        Me.TextBox13.Location = New System.Drawing.Point(176, 66)
207 243
         Me.TextBox13.Name = "TextBox13"
208 244
         Me.TextBox13.Size = New System.Drawing.Size(93, 23)
209 245
         Me.TextBox13.TabIndex = 879
@@ -212,7 +248,7 @@ Partial Class 量產訂單控制表
212 248
         'Label19
213 249
         '
214 250
         Me.Label19.AutoSize = True
215
-        Me.Label19.Location = New System.Drawing.Point(102, 73)
251
+        Me.Label19.Location = New System.Drawing.Point(102, 70)
216 252
         Me.Label19.Name = "Label19"
217 253
         Me.Label19.Size = New System.Drawing.Size(68, 16)
218 254
         Me.Label19.TabIndex = 878
@@ -221,7 +257,7 @@ Partial Class 量產訂單控制表
221 257
         'Label1
222 258
         '
223 259
         Me.Label1.AutoSize = True
224
-        Me.Label1.Location = New System.Drawing.Point(114, 96)
260
+        Me.Label1.Location = New System.Drawing.Point(114, 99)
225 261
         Me.Label1.Name = "Label1"
226 262
         Me.Label1.Size = New System.Drawing.Size(56, 16)
227 263
         Me.Label1.TabIndex = 344
@@ -230,9 +266,9 @@ Partial Class 量產訂單控制表
230 266
         'Button15
231 267
         '
232 268
         Me.Button15.ForeColor = System.Drawing.Color.Black
233
-        Me.Button15.Location = New System.Drawing.Point(275, 14)
269
+        Me.Button15.Location = New System.Drawing.Point(275, 92)
234 270
         Me.Button15.Name = "Button15"
235
-        Me.Button15.Size = New System.Drawing.Size(66, 102)
271
+        Me.Button15.Size = New System.Drawing.Size(98, 27)
236 272
         Me.Button15.TabIndex = 343
237 273
         Me.Button15.Text = "確定出貨"
238 274
         Me.Button15.UseVisualStyleBackColor = True
@@ -240,7 +276,7 @@ Partial Class 量產訂單控制表
240 276
         'TextBox1
241 277
         '
242 278
         Me.TextBox1.ForeColor = System.Drawing.Color.Red
243
-        Me.TextBox1.Location = New System.Drawing.Point(176, 93)
279
+        Me.TextBox1.Location = New System.Drawing.Point(176, 96)
244 280
         Me.TextBox1.Name = "TextBox1"
245 281
         Me.TextBox1.Size = New System.Drawing.Size(93, 23)
246 282
         Me.TextBox1.TabIndex = 342
@@ -249,7 +285,7 @@ Partial Class 量產訂單控制表
249 285
         'Button27
250 286
         '
251 287
         Me.Button27.ForeColor = System.Drawing.Color.Black
252
-        Me.Button27.Location = New System.Drawing.Point(228, 16)
288
+        Me.Button27.Location = New System.Drawing.Point(228, 36)
253 289
         Me.Button27.Name = "Button27"
254 290
         Me.Button27.Size = New System.Drawing.Size(41, 24)
255 291
         Me.Button27.TabIndex = 323
@@ -259,7 +295,7 @@ Partial Class 量產訂單控制表
259 295
         'Label57
260 296
         '
261 297
         Me.Label57.AutoSize = True
262
-        Me.Label57.Location = New System.Drawing.Point(10, 19)
298
+        Me.Label57.Location = New System.Drawing.Point(10, 39)
263 299
         Me.Label57.Name = "Label57"
264 300
         Me.Label57.Size = New System.Drawing.Size(89, 16)
265 301
         Me.Label57.TabIndex = 269
@@ -268,7 +304,7 @@ Partial Class 量產訂單控制表
268 304
         'CheckBox10
269 305
         '
270 306
         Me.CheckBox10.AutoSize = True
271
-        Me.CheckBox10.Location = New System.Drawing.Point(6, 95)
307
+        Me.CheckBox10.Location = New System.Drawing.Point(11, 98)
272 308
         Me.CheckBox10.Name = "CheckBox10"
273 309
         Me.CheckBox10.Size = New System.Drawing.Size(75, 20)
274 310
         Me.CheckBox10.TabIndex = 341
@@ -278,7 +314,7 @@ Partial Class 量產訂單控制表
278 314
         'DateTimePicker30
279 315
         '
280 316
         Me.DateTimePicker30.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
281
-        Me.DateTimePicker30.Location = New System.Drawing.Point(117, 16)
317
+        Me.DateTimePicker30.Location = New System.Drawing.Point(117, 36)
282 318
         Me.DateTimePicker30.Name = "DateTimePicker30"
283 319
         Me.DateTimePicker30.Size = New System.Drawing.Size(105, 23)
284 320
         Me.DateTimePicker30.TabIndex = 268
@@ -288,7 +324,7 @@ Partial Class 量產訂單控制表
288 324
         Me.CheckBox11.AutoSize = True
289 325
         Me.CheckBox11.Checked = True
290 326
         Me.CheckBox11.CheckState = System.Windows.Forms.CheckState.Checked
291
-        Me.CheckBox11.Location = New System.Drawing.Point(6, 72)
327
+        Me.CheckBox11.Location = New System.Drawing.Point(11, 69)
292 328
         Me.CheckBox11.Name = "CheckBox11"
293 329
         Me.CheckBox11.Size = New System.Drawing.Size(75, 20)
294 330
         Me.CheckBox11.TabIndex = 340
@@ -298,7 +334,7 @@ Partial Class 量產訂單控制表
298 334
         'Label56
299 335
         '
300 336
         Me.Label56.AutoSize = True
301
-        Me.Label56.Location = New System.Drawing.Point(97, 19)
337
+        Me.Label56.Location = New System.Drawing.Point(97, 39)
302 338
         Me.Label56.Name = "Label56"
303 339
         Me.Label56.Size = New System.Drawing.Size(20, 16)
304 340
         Me.Label56.TabIndex = 271
@@ -631,13 +667,13 @@ Partial Class 量產訂單控制表
631 667
         Me.Controls.Add(Me.TextBox12)
632 668
         Me.Controls.Add(Me.Label12)
633 669
         Me.Controls.Add(Me.Button30)
634
-        Me.Controls.Add(Me.DataGridView3)
670
+        Me.Controls.Add(Me.控制表_dgv)
635 671
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
636 672
         Me.ForeColor = System.Drawing.Color.Black
637 673
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
638 674
         Me.Name = "量產訂單控制表"
639 675
         Me.Text = "量產訂單控制表"
640
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).EndInit()
676
+        CType(Me.控制表_dgv, System.ComponentModel.ISupportInitialize).EndInit()
641 677
         Me.GroupBox2.ResumeLayout(False)
642 678
         Me.GroupBox2.PerformLayout()
643 679
         Me.GroupBox1.ResumeLayout(False)
@@ -650,7 +686,7 @@ Partial Class 量產訂單控制表
650 686
 
651 687
     End Sub
652 688
 
653
-    Friend WithEvents DataGridView3 As DataGridView
689
+    Friend WithEvents 控制表_dgv As DataGridView
654 690
     Friend WithEvents Button30 As Button
655 691
     Friend WithEvents TextBox12 As TextBox
656 692
     Friend WithEvents Label12 As Label
@@ -701,4 +737,7 @@ Partial Class 量產訂單控制表
701 737
     Friend WithEvents Button4 As Button
702 738
     Friend WithEvents Button6 As Button
703 739
     Friend WithEvents Button5 As Button
740
+    Friend WithEvents 啟用批量出貨_ch As CheckBox
741
+    Friend WithEvents 批量出貨_bt As Button
742
+    Friend WithEvents Label50 As Label
704 743
 End Class

+ 177
- 158
SHENKANG-MES-SYS/量產訂單管理系統/量產訂單控制表.vb View File

@@ -9,19 +9,13 @@ Public Class 量產訂單控制表
9 9
     Dim dr As SqlDataReader
10 10
     Dim GHJK As String : Dim ESTR As String
11 11
     Dim aa As MsgBoxResult
12
-    Private Sub Set_DGV3載入前設定()
13
-        DataGridView3.DataSource = Nothing : ds3.Clear()
14
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
15
-        DataGridView3.ColumnHeadersHeight = 25
16
-        DataGridView3.AllowUserToAddRows = False
17
-        DataGridView3.RowTemplate.Height = 35
18
-        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
19
-    End Sub
20
-    Private Sub Set_DGV3載入後設定()
21
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds3) : DataGridView3.DataSource = ds3.Tables(0) : conn.Close() : Set_grid4()
22
-    End Sub
23 12
     Private Sub Set_清單3()
24
-        Set_DGV3載入前設定()
13
+        控制表_dgv.DataSource = Nothing : ds3.Clear()
14
+        控制表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
15
+        控制表_dgv.ColumnHeadersHeight = 25
16
+        控制表_dgv.AllowUserToAddRows = False
17
+        控制表_dgv.RowTemplate.Height = 35
18
+        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
25 19
         If PA = "" Then
26 20
             SQL1 = "SELECT  訂單流水號, 年份季度, 客戶訂單號, 型體號碼, GOODBOX AS 型體名稱, APMA確認 AS 顏色, TVW AS 楦型, 訂單數量, 工廠回復交期 AS 工廠交期, 客戶交期 AS 交期開始, 
27 21
                             客戶交期1 AS 交期結束, 單價, 總金額, 備註, 生產工廠, 訂單種類, BUYER, CFMSPEC AS 訂單屬性, 明細建檔, 材質, 東莞業務備註, LEATHER AS 手剪全套, LEA_Note AS 斬刀全套, 
@@ -46,119 +40,78 @@ Public Class 量產訂單控制表
46 40
                           備註 LIKE N'%" & PA & "%' OR 生產工廠 LIKE N'%" & PA & "%' OR 訂單種類 LIKE N'%" & PA & "%' OR BUYER LIKE N'%" & PA & "%' OR CFMSPEC LIKE N'%" & PA & "%')
47 41
                     ORDER BY 訂單流水號 DESC, 型體號碼, APMA確認, TVW"
48 42
         End If
49
-        Set_DGV3載入後設定()
43
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds3) : 控制表_dgv.DataSource = ds3.Tables(0) : conn.Close() : Set_grid4()
44
+    End Sub
45
+    Private Sub Set_控制表_dgv_插入勾選控件清單()
46
+        Dim Col As New DataGridViewCheckBoxColumn With {
47
+            .FillWeight = 40,
48
+            .DataPropertyName = "選擇"
49
+        }
50
+        Col.HeaderText = "選擇" : Col.Name = "選擇"
51
+        控制表_dgv.Columns.Insert(0, Col)
50 52
     End Sub
51 53
     Private Sub Set_grid4()
52
-        DataGridView3.Columns(0).FillWeight = 140 : DataGridView3.Columns(1).FillWeight = 80 : DataGridView3.Columns(2).FillWeight = 140 : DataGridView3.Columns(3).FillWeight = 130
53
-        DataGridView3.Columns(4).FillWeight = 140 : DataGridView3.Columns(5).FillWeight = 90 : DataGridView3.Columns(6).FillWeight = 60 : DataGridView3.Columns(7).FillWeight = 90
54
-        DataGridView3.Columns(8).FillWeight = 100 : DataGridView3.Columns(9).FillWeight = 100 : DataGridView3.Columns(10).FillWeight = 100 : DataGridView3.Columns(11).FillWeight = 90
55
-        DataGridView3.Columns(12).FillWeight = 90 : DataGridView3.Columns(13).FillWeight = 270 : DataGridView3.Columns(14).FillWeight = 90 : DataGridView3.Columns(15).FillWeight = 120
56
-        DataGridView3.Columns(16).FillWeight = 140 : DataGridView3.Columns(17).FillWeight = 115 : DataGridView3.Columns(18).FillWeight = 50 : DataGridView3.Columns(19).FillWeight = 60
57
-        DataGridView3.Columns(20).FillWeight = 495 : DataGridView3.Columns(21).FillWeight = 120 : DataGridView3.Columns(22).FillWeight = 120 : DataGridView3.Columns(23).FillWeight = 113
58
-        DataGridView3.Columns(24).FillWeight = 113 : DataGridView3.Columns(25).FillWeight = 113 : DataGridView3.Columns(26).FillWeight = 114 : DataGridView3.Columns(27).FillWeight = 114
59
-        DataGridView3.Columns(28).FillWeight = 114 : DataGridView3.Columns(29).FillWeight = 114 : DataGridView3.Columns(30).FillWeight = 120 : DataGridView3.Columns(31).FillWeight = 120
60
-        DataGridView3.Columns(32).FillWeight = 120 : DataGridView3.Columns(33).FillWeight = 120 : DataGridView3.Columns(34).FillWeight = 120 : DataGridView3.Columns(35).FillWeight = 195
61
-        DataGridView3.Columns(36).FillWeight = 123 : DataGridView3.Columns(37).FillWeight = 123 : DataGridView3.Columns(38).FillWeight = 123 : DataGridView3.Columns(39).FillWeight = 60
62
-        DataGridView3.Columns(41).FillWeight = 123 : DataGridView3.Columns(41).FillWeight = 123
54
+        If 控制表_dgv.Columns.Count.ToString > 60 Then
55
+            控制表_dgv.Columns.Remove("選擇")
56
+        End If
57
+        Set_控制表_dgv_插入勾選控件清單()
58
+        控制表_dgv.Columns(0).FillWeight = 40 : 控制表_dgv.Columns(1).FillWeight = 140 : 控制表_dgv.Columns(2).FillWeight = 80 : 控制表_dgv.Columns(3).FillWeight = 140
59
+        控制表_dgv.Columns(4).FillWeight = 130 : 控制表_dgv.Columns(5).FillWeight = 140 : 控制表_dgv.Columns(6).FillWeight = 90 : 控制表_dgv.Columns(7).FillWeight = 60
60
+        控制表_dgv.Columns(8).FillWeight = 90 : 控制表_dgv.Columns(9).FillWeight = 100 : 控制表_dgv.Columns(10).FillWeight = 100 : 控制表_dgv.Columns(11).FillWeight = 100
61
+        控制表_dgv.Columns(12).FillWeight = 90 : 控制表_dgv.Columns(13).FillWeight = 90 : 控制表_dgv.Columns(14).FillWeight = 270 : 控制表_dgv.Columns(15).FillWeight = 90
62
+        控制表_dgv.Columns(16).FillWeight = 120 : 控制表_dgv.Columns(17).FillWeight = 140 : 控制表_dgv.Columns(18).FillWeight = 115 : 控制表_dgv.Columns(19).FillWeight = 50
63
+        控制表_dgv.Columns(20).FillWeight = 60 : 控制表_dgv.Columns(21).FillWeight = 495 : 控制表_dgv.Columns(22).FillWeight = 120 : 控制表_dgv.Columns(23).FillWeight = 120
64
+        控制表_dgv.Columns(24).FillWeight = 113 : 控制表_dgv.Columns(25).FillWeight = 113 : 控制表_dgv.Columns(26).FillWeight = 113 : 控制表_dgv.Columns(27).FillWeight = 114
65
+        控制表_dgv.Columns(28).FillWeight = 114 : 控制表_dgv.Columns(29).FillWeight = 114 : 控制表_dgv.Columns(30).FillWeight = 114 : 控制表_dgv.Columns(31).FillWeight = 120
66
+        控制表_dgv.Columns(32).FillWeight = 120 : 控制表_dgv.Columns(33).FillWeight = 120 : 控制表_dgv.Columns(34).FillWeight = 120 : 控制表_dgv.Columns(35).FillWeight = 120
67
+        控制表_dgv.Columns(36).FillWeight = 195 : 控制表_dgv.Columns(37).FillWeight = 123 : 控制表_dgv.Columns(38).FillWeight = 123 : 控制表_dgv.Columns(39).FillWeight = 123
68
+        控制表_dgv.Columns(40).FillWeight = 60 : 控制表_dgv.Columns(41).FillWeight = 123 : 控制表_dgv.Columns(42).FillWeight = 123
63 69
         '795
64 70
         If Button3.Enabled = False And Button34.Enabled = True And Button35.Enabled = True And Button4.Enabled = True And Button6.Enabled = True Then
65
-            DataGridView3.Columns(8).Visible = True : DataGridView3.Columns(9).Visible = True : DataGridView3.Columns(10).Visible = True : DataGridView3.Columns(11).Visible = True
66
-            DataGridView3.Columns(12).Visible = True : DataGridView3.Columns(13).Visible = True : DataGridView3.Columns(14).Visible = True : DataGridView3.Columns(17).Visible = True
67
-
68
-            DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False : DataGridView3.Columns(21).Visible = False : DataGridView3.Columns(15).Visible = False
69
-            DataGridView3.Columns(22).Visible = False : DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False
70
-            DataGridView3.Columns(26).Visible = False : DataGridView3.Columns(27).Visible = False : DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False
71
-            DataGridView3.Columns(30).Visible = False : DataGridView3.Columns(31).Visible = False : DataGridView3.Columns(32).Visible = False : DataGridView3.Columns(33).Visible = False
72
-            DataGridView3.Columns(34).Visible = False : DataGridView3.Columns(35).Visible = False : DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False
73
-            DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(39).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
74
-            DataGridView3.Columns(42).Visible = False : DataGridView3.Columns(43).Visible = False : DataGridView3.Columns(44).Visible = False : DataGridView3.Columns(45).Visible = False
75
-            DataGridView3.Columns(46).Visible = False : DataGridView3.Columns(47).Visible = False : DataGridView3.Columns(48).Visible = False : DataGridView3.Columns(49).Visible = False
76
-            DataGridView3.Columns(50).Visible = False : DataGridView3.Columns(51).Visible = False : DataGridView3.Columns(52).Visible = False : DataGridView3.Columns(53).Visible = False
77
-            DataGridView3.Columns(54).Visible = False : DataGridView3.Columns(55).Visible = False : DataGridView3.Columns(56).Visible = False : DataGridView3.Columns(57).Visible = False
78
-            DataGridView3.Columns(58).Visible = False : DataGridView3.Columns(59).Visible = False
71
+            For i As Integer = 9 To 15 : 控制表_dgv.Columns(i).Visible = True : Next
72
+            For i As Integer = 20 To 60 : 控制表_dgv.Columns(i).Visible = False : Next
73
+            控制表_dgv.Columns(18).Visible = True : 控制表_dgv.Columns(15).Visible = False
79 74
         ElseIf Button3.Enabled = True And Button34.Enabled = False And Button35.Enabled = True And Button4.Enabled = True And Button6.Enabled = True Then
80
-            DataGridView3.Columns(8).Visible = False : DataGridView3.Columns(9).Visible = False : DataGridView3.Columns(10).Visible = False : DataGridView3.Columns(11).Visible = False
81
-            DataGridView3.Columns(12).Visible = False : DataGridView3.Columns(13).Visible = False : DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(17).Visible = False
82
-
83
-            DataGridView3.Columns(19).Visible = True : DataGridView3.Columns(20).Visible = True : DataGridView3.Columns(21).Visible = True : DataGridView3.Columns(22).Visible = True
84
-
85
-            DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False : DataGridView3.Columns(15).Visible = False
86
-            DataGridView3.Columns(26).Visible = False : DataGridView3.Columns(27).Visible = False : DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False
87
-            DataGridView3.Columns(30).Visible = False : DataGridView3.Columns(31).Visible = False : DataGridView3.Columns(32).Visible = False : DataGridView3.Columns(33).Visible = False
88
-            DataGridView3.Columns(34).Visible = False : DataGridView3.Columns(35).Visible = False : DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False
89
-            DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(39).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
90
-            DataGridView3.Columns(42).Visible = False : DataGridView3.Columns(43).Visible = False : DataGridView3.Columns(44).Visible = False : DataGridView3.Columns(45).Visible = False
91
-            DataGridView3.Columns(46).Visible = False : DataGridView3.Columns(47).Visible = False : DataGridView3.Columns(48).Visible = False : DataGridView3.Columns(49).Visible = False
92
-            DataGridView3.Columns(50).Visible = False : DataGridView3.Columns(51).Visible = False : DataGridView3.Columns(52).Visible = False : DataGridView3.Columns(53).Visible = False
93
-            DataGridView3.Columns(54).Visible = False : DataGridView3.Columns(55).Visible = False : DataGridView3.Columns(56).Visible = False : DataGridView3.Columns(57).Visible = False
94
-            DataGridView3.Columns(58).Visible = False : DataGridView3.Columns(59).Visible = False
75
+            For i As Integer = 9 To 16 : 控制表_dgv.Columns(i).Visible = False : Next
76
+            For i As Integer = 20 To 23 : 控制表_dgv.Columns(i).Visible = True : Next
77
+            For i As Integer = 24 To 60 : 控制表_dgv.Columns(i).Visible = False : Next
78
+            控制表_dgv.Columns(18).Visible = False
95 79
         ElseIf Button3.Enabled = True And Button34.Enabled = True And Button35.Enabled = False And Button4.Enabled = True And Button6.Enabled = True Then
96
-            DataGridView3.Columns(8).Visible = False : DataGridView3.Columns(9).Visible = False : DataGridView3.Columns(10).Visible = False : DataGridView3.Columns(11).Visible = False
97
-            DataGridView3.Columns(12).Visible = False : DataGridView3.Columns(13).Visible = False : DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(17).Visible = False
98
-            DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False : DataGridView3.Columns(21).Visible = False : DataGridView3.Columns(22).Visible = False
99
-
100
-            DataGridView3.Columns(23).Visible = True : DataGridView3.Columns(24).Visible = True : DataGridView3.Columns(25).Visible = True : DataGridView3.Columns(26).Visible = True
101
-            DataGridView3.Columns(27).Visible = True : DataGridView3.Columns(28).Visible = True : DataGridView3.Columns(29).Visible = True
102
-
103
-            DataGridView3.Columns(30).Visible = False : DataGridView3.Columns(31).Visible = False : DataGridView3.Columns(32).Visible = False : DataGridView3.Columns(33).Visible = False
104
-            DataGridView3.Columns(34).Visible = False : DataGridView3.Columns(35).Visible = False : DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False
105
-            DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(39).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
106
-            DataGridView3.Columns(42).Visible = False : DataGridView3.Columns(43).Visible = False : DataGridView3.Columns(44).Visible = False : DataGridView3.Columns(45).Visible = False
107
-            DataGridView3.Columns(46).Visible = False : DataGridView3.Columns(47).Visible = False : DataGridView3.Columns(48).Visible = False : DataGridView3.Columns(49).Visible = False
108
-            DataGridView3.Columns(50).Visible = False : DataGridView3.Columns(51).Visible = False : DataGridView3.Columns(52).Visible = False : DataGridView3.Columns(53).Visible = False
109
-            DataGridView3.Columns(54).Visible = False : DataGridView3.Columns(55).Visible = False : DataGridView3.Columns(56).Visible = False : DataGridView3.Columns(57).Visible = False
110
-            DataGridView3.Columns(58).Visible = False : DataGridView3.Columns(59).Visible = False : DataGridView3.Columns(15).Visible = False
80
+            For i As Integer = 9 To 16 : 控制表_dgv.Columns(i).Visible = False : Next
81
+            For i As Integer = 20 To 23 : 控制表_dgv.Columns(i).Visible = False : Next
82
+            For i As Integer = 24 To 30 : 控制表_dgv.Columns(i).Visible = True : Next
83
+            For i As Integer = 31 To 60 : 控制表_dgv.Columns(i).Visible = False : Next
84
+            控制表_dgv.Columns(18).Visible = False
111 85
         ElseIf Button3.Enabled = True And Button34.Enabled = True And Button35.Enabled = True And Button4.Enabled = False And Button6.Enabled = True Then
112
-            DataGridView3.Columns(8).Visible = False : DataGridView3.Columns(9).Visible = False : DataGridView3.Columns(10).Visible = False : DataGridView3.Columns(11).Visible = False
113
-            DataGridView3.Columns(12).Visible = False : DataGridView3.Columns(13).Visible = False : DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(17).Visible = False
114
-            DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False : DataGridView3.Columns(21).Visible = False : DataGridView3.Columns(22).Visible = False
115
-            DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False : DataGridView3.Columns(26).Visible = False
116
-            DataGridView3.Columns(27).Visible = False : DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False
117
-
118
-            DataGridView3.Columns(30).Visible = True : DataGridView3.Columns(31).Visible = True : DataGridView3.Columns(32).Visible = True : DataGridView3.Columns(33).Visible = True
119
-            DataGridView3.Columns(34).Visible = True : DataGridView3.Columns(35).Visible = True
120
-
121
-            DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False : DataGridView3.Columns(15).Visible = False
122
-            DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(39).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
123
-            DataGridView3.Columns(42).Visible = False : DataGridView3.Columns(43).Visible = False : DataGridView3.Columns(44).Visible = False : DataGridView3.Columns(45).Visible = False
124
-            DataGridView3.Columns(46).Visible = False : DataGridView3.Columns(47).Visible = False : DataGridView3.Columns(48).Visible = False : DataGridView3.Columns(49).Visible = False
125
-            DataGridView3.Columns(50).Visible = False : DataGridView3.Columns(51).Visible = False : DataGridView3.Columns(52).Visible = False : DataGridView3.Columns(53).Visible = False
126
-            DataGridView3.Columns(54).Visible = False : DataGridView3.Columns(55).Visible = False : DataGridView3.Columns(56).Visible = False : DataGridView3.Columns(57).Visible = False
127
-            DataGridView3.Columns(58).Visible = False : DataGridView3.Columns(59).Visible = False
86
+            For i As Integer = 9 To 16 : 控制表_dgv.Columns(i).Visible = False : Next
87
+            For i As Integer = 20 To 30 : 控制表_dgv.Columns(i).Visible = False : Next
88
+            For i As Integer = 31 To 36 : 控制表_dgv.Columns(i).Visible = True : Next
89
+            For i As Integer = 37 To 60 : 控制表_dgv.Columns(i).Visible = False : Next
90
+            控制表_dgv.Columns(18).Visible = False
128 91
         ElseIf Button3.Enabled = True And Button34.Enabled = True And Button35.Enabled = True And Button4.Enabled = True And Button6.Enabled = False Then
129
-            DataGridView3.Columns(8).Visible = False : DataGridView3.Columns(9).Visible = False : DataGridView3.Columns(10).Visible = False : DataGridView3.Columns(11).Visible = False
130
-            DataGridView3.Columns(12).Visible = False : DataGridView3.Columns(13).Visible = False : DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(17).Visible = False
131
-            DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False : DataGridView3.Columns(21).Visible = False : DataGridView3.Columns(22).Visible = False
132
-            DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False : DataGridView3.Columns(26).Visible = False
133
-            DataGridView3.Columns(27).Visible = False : DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False : DataGridView3.Columns(30).Visible = False
134
-            DataGridView3.Columns(31).Visible = False : DataGridView3.Columns(32).Visible = False : DataGridView3.Columns(33).Visible = False : DataGridView3.Columns(34).Visible = False
135
-            DataGridView3.Columns(35).Visible = False
136
-
137
-            DataGridView3.Columns(15).Visible = True : DataGridView3.Columns(36).Visible = True : DataGridView3.Columns(37).Visible = True : DataGridView3.Columns(38).Visible = True
138
-            DataGridView3.Columns(39).Visible = True : DataGridView3.Columns(40).Visible = True : DataGridView3.Columns(41).Visible = True
139
-
140
-            DataGridView3.Columns(42).Visible = False : DataGridView3.Columns(43).Visible = False : DataGridView3.Columns(44).Visible = False : DataGridView3.Columns(45).Visible = False
141
-            DataGridView3.Columns(46).Visible = False : DataGridView3.Columns(47).Visible = False : DataGridView3.Columns(48).Visible = False : DataGridView3.Columns(49).Visible = False
142
-            DataGridView3.Columns(50).Visible = False : DataGridView3.Columns(51).Visible = False : DataGridView3.Columns(52).Visible = False : DataGridView3.Columns(53).Visible = False
143
-            DataGridView3.Columns(54).Visible = False : DataGridView3.Columns(55).Visible = False : DataGridView3.Columns(56).Visible = False : DataGridView3.Columns(57).Visible = False
144
-            DataGridView3.Columns(58).Visible = False : DataGridView3.Columns(59).Visible = False
92
+            For i As Integer = 9 To 15 : 控制表_dgv.Columns(i).Visible = False : Next
93
+            For i As Integer = 20 To 36 : 控制表_dgv.Columns(i).Visible = False : Next
94
+            For i As Integer = 37 To 42 : 控制表_dgv.Columns(i).Visible = True : Next
95
+            For i As Integer = 43 To 60 : 控制表_dgv.Columns(i).Visible = False : Next
96
+            控制表_dgv.Columns(17).Visible = False : 控制表_dgv.Columns(15).Visible = True
145 97
         End If
146 98
 
147
-        DataGridView3.Columns(7).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(11).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(12).DefaultCellStyle.Format = "#,##0.00"
148
-        DataGridView3.Columns(7).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
149
-        DataGridView3.Columns(11).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
150
-        DataGridView3.Columns(7).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
151
-        DataGridView3.Columns(11).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
99
+        控制表_dgv.Columns(8).DefaultCellStyle.Format = "#,##0" : 控制表_dgv.Columns(12).DefaultCellStyle.Format = "#,##0.00" : 控制表_dgv.Columns(13).DefaultCellStyle.Format = "#,##0.00"
100
+        控制表_dgv.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 控制表_dgv.Columns(13).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
101
+        控制表_dgv.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
102
+        控制表_dgv.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 控制表_dgv.Columns(13).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
103
+        控制表_dgv.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
152 104
 
153 105
         TextBox6.Text = "0" : TextBox3.Text = "0" : TextBox8.Text = "0" : TextBox7.Text = "0" : TextBox5.Text = "0" : TextBox4.Text = "0"
154
-        For i As Integer = 0 To DataGridView3.Rows.Count - 1
155
-            If DataGridView3.Rows(i).Cells("訂單屬性").Value.ToString = "LANDED BRANDED" Then
156
-                TextBox6.Text = Val(TextBox6.Text) + DataGridView3.Rows(i).Cells("訂單數量").Value
157
-                TextBox5.Text = Val(TextBox5.Text) + DataGridView3.Rows(i).Cells("總金額").Value
106
+        For i As Integer = 0 To 控制表_dgv.Rows.Count - 1
107
+            If 控制表_dgv.Rows(i).Cells("訂單屬性").Value.ToString = "LANDED BRANDED" Then
108
+                TextBox6.Text = Val(TextBox6.Text) + 控制表_dgv.Rows(i).Cells("訂單數量").Value
109
+                TextBox5.Text = Val(TextBox5.Text) + 控制表_dgv.Rows(i).Cells("總金額").Value
158 110
             Else
159
-                TextBox3.Text = Val(TextBox3.Text) + DataGridView3.Rows(i).Cells("訂單數量").Value
160
-                TextBox4.Text = Val(TextBox4.Text) + DataGridView3.Rows(i).Cells("總金額").Value
111
+                TextBox3.Text = Val(TextBox3.Text) + 控制表_dgv.Rows(i).Cells("訂單數量").Value
112
+                TextBox4.Text = Val(TextBox4.Text) + 控制表_dgv.Rows(i).Cells("總金額").Value
161 113
             End If
114
+            控制表_dgv("選擇", i).Value = False
162 115
         Next
163 116
         TextBox8.Text = Val(TextBox6.Text) + Val(TextBox3.Text) : TextBox7.Text = Val(TextBox5.Text) + Val(TextBox4.Text)
164 117
         TextBox7.Text = Format(Val(TextBox7.Text), "#,##0") : TextBox5.Text = Format(Val(TextBox5.Text), "#,##0") : TextBox4.Text = Format(Val(TextBox4.Text), "#,##0")
@@ -166,93 +119,108 @@ Public Class 量產訂單控制表
166 119
     End Sub
167 120
     Private Sub 量產訂單控制表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
168 121
         Me.MdiParent = WINPROFIT_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
169
-        DataGridView2.Visible = False : TextBox13.Enabled = False : Button3.Enabled = False
122
+        DataGridView2.Visible = False : TextBox13.Enabled = False : Button3.Enabled = False : 批量出貨_bt.Enabled = False
170 123
         Set_清單3()
171 124
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
172 125
         SQL1 = "DELETE FROM 貨款匯入出款明細表 WHERE (出貨數量 = 0)"
173 126
         cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader : conn.Close()
174 127
     End Sub
175
-    Private Sub DataGridView3_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView3.CellClick
176
-        If e.RowIndex = -1 Then : Else
177
-            TextBox12.Text = DataGridView3.Rows(e.RowIndex).Cells("訂單流水號").Value
178
-            TextBox2.Text = DataGridView3.Rows(e.RowIndex).Cells("資料流水號").Value
128
+    Private Sub DataGridView3_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 控制表_dgv.CellClick
129
+        If 啟用批量出貨_ch.Checked = True Then
130
+            If 控制表_dgv("選擇", e.RowIndex).Value = True Then
131
+                控制表_dgv("選擇", e.RowIndex).Value = False
132
+            Else
133
+                控制表_dgv("選擇", e.RowIndex).Value = True
134
+            End If
135
+            For i As Integer = 0 To 控制表_dgv.Rows.Count - 1
136
+                If 控制表_dgv("選擇", i).Value = True Then
137
+                    控制表_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightGreen
138
+                Else
139
+                    控制表_dgv.Rows(i).DefaultCellStyle.BackColor = Color.White
140
+                End If
141
+            Next
142
+        Else
143
+            If e.RowIndex = -1 Then : Else
144
+                TextBox12.Text = 控制表_dgv.Rows(e.RowIndex).Cells("訂單流水號").Value
145
+                TextBox2.Text = 控制表_dgv.Rows(e.RowIndex).Cells("資料流水號").Value
179 146
 
180
-            TextBox13.Text = DataGridView3.Rows(e.RowIndex).Cells("訂單數量").Value - DataGridView3.Rows(e.RowIndex).Cells("出貨數量").Value
181
-            TextBox13.Text = Format(Val(TextBox13.Text), "###0")
147
+                TextBox13.Text = 控制表_dgv.Rows(e.RowIndex).Cells("訂單數量").Value - 控制表_dgv.Rows(e.RowIndex).Cells("出貨數量").Value
148
+                TextBox13.Text = Format(Val(TextBox13.Text), "###0")
182 149
 
183
-            If DataGridView3.Rows(e.RowIndex).Cells("明細建檔").Value = True Then : Button30.Enabled = True : Else : Button30.Enabled = False : End If
150
+                If 控制表_dgv.Rows(e.RowIndex).Cells("明細建檔").Value = True Then : Button30.Enabled = True : Else : Button30.Enabled = False : End If
184 151
 
185
-            PictureBox1.Image = Nothing : conn.Close()
186
-            If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
187
-            SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'  AND 類別 LIKE N'設計圖'"
188
-            cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
189
-            If dr.Read() Then
190
-                PictureBox1.Image = Nothing : conn.Close()
191
-                If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
192
-                SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'  AND 類別 LIKE N'設計圖'"
193
-                cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
194
-                While dr.Read() = True
195
-                    Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
196
-                    Dim oStream As New MemoryStream(bytes) : PictureBox1.Image = Bitmap.FromStream(oStream)
197
-                End While
198
-                conn.Close()
199
-            Else
200 152
                 PictureBox1.Image = Nothing : conn.Close()
201 153
                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
202
-                SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
154
+                SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'  AND 類別 LIKE N'設計圖'"
203 155
                 cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
204 156
                 If dr.Read() Then
205 157
                     PictureBox1.Image = Nothing : conn.Close()
206 158
                     If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
207
-                    SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
159
+                    SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'  AND 類別 LIKE N'設計圖'"
208 160
                     cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
209 161
                     While dr.Read() = True
210
-                        Dim unused3 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
162
+                        Dim unused As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
211 163
                         Dim oStream As New MemoryStream(bytes) : PictureBox1.Image = Bitmap.FromStream(oStream)
212 164
                     End While
213 165
                     conn.Close()
214 166
                 Else
215 167
                     PictureBox1.Image = Nothing : conn.Close()
216 168
                     If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
217
-                    SQL1 = "SELECT 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
169
+                    SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
218 170
                     cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
219 171
                     If dr.Read() Then
220 172
                         PictureBox1.Image = Nothing : conn.Close()
221 173
                         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
222
-                        SQL1 = "SELECT 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & DataGridView3.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
174
+                        SQL1 = "SELECT TOP(1) 圖片 FROM 鞋型圖片資料庫 WHERE 形體號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
223 175
                         cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
224 176
                         While dr.Read() = True
225
-                            Dim unused1 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
177
+                            Dim unused3 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
226 178
                             Dim oStream As New MemoryStream(bytes) : PictureBox1.Image = Bitmap.FromStream(oStream)
227 179
                         End While
228 180
                         conn.Close()
229 181
                     Else
230
-                        conn.Close()
182
+                        PictureBox1.Image = Nothing : conn.Close()
183
+                        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
184
+                        SQL1 = "SELECT 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
185
+                        cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
186
+                        If dr.Read() Then
187
+                            PictureBox1.Image = Nothing : conn.Close()
188
+                            If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
189
+                            SQL1 = "SELECT 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & 控制表_dgv.Rows(e.RowIndex).Cells("型體號碼").Value & "'"
190
+                            cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
191
+                            While dr.Read() = True
192
+                                Dim unused1 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("圖片"), Byte())
193
+                                Dim oStream As New MemoryStream(bytes) : PictureBox1.Image = Bitmap.FromStream(oStream)
194
+                            End While
195
+                            conn.Close()
196
+                        Else
197
+                            conn.Close()
198
+                        End If
231 199
                     End If
232
-                End If
233
-            End If : PictureBox1.SizeMode = 4
200
+                End If : PictureBox1.SizeMode = 4
234 201
 
235
-            If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
236
-            SQL1 = "SELECT TOP(1) 驗貨報告 FROM 驗貨報告圖庫 WHERE 驗貨報告編號 LIKE '" & DataGridView3.Rows(e.RowIndex).Cells("驗貨報告圖片").Value & "'"
237
-            cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
238
-            PictureBox2.Image = Nothing
239
-            While dr.Read() = True
240
-                Dim unused2 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("驗貨報告"), Byte())
241
-                Dim oStream As New MemoryStream(bytes) : PictureBox2.Image = Bitmap.FromStream(oStream)
242
-            End While
243
-            conn.Close() : PictureBox2.SizeMode = 4
244
-            驗貨報告 = DataGridView3.Rows(e.RowIndex).Cells("驗貨報告圖片").Value
202
+                If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
203
+                SQL1 = "SELECT TOP(1) 驗貨報告 FROM 驗貨報告圖庫 WHERE 驗貨報告編號 LIKE '" & 控制表_dgv.Rows(e.RowIndex).Cells("驗貨報告圖片").Value & "'"
204
+                cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
205
+                PictureBox2.Image = Nothing
206
+                While dr.Read() = True
207
+                    Dim unused2 As Byte() = New Byte(-1) {} : Dim bytes As Byte() = DirectCast(dr.Item("驗貨報告"), Byte())
208
+                    Dim oStream As New MemoryStream(bytes) : PictureBox2.Image = Bitmap.FromStream(oStream)
209
+                End While
210
+                conn.Close() : PictureBox2.SizeMode = 4
211
+                驗貨報告 = 控制表_dgv.Rows(e.RowIndex).Cells("驗貨報告圖片").Value
212
+            End If
245 213
         End If
246 214
     End Sub
247
-    Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView3.RowPostPaint
215
+    Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 控制表_dgv.RowPostPaint
248 216
         Dim linePen As New Pen(Color.Blue, 2)
249
-        If e.RowIndex = DataGridView3.Rows.Count - 1 Then
217
+        If e.RowIndex = 控制表_dgv.Rows.Count - 1 Then
250 218
             Exit Sub
251 219
         Else
252
-            If DataGridView3(0, e.RowIndex).Value.ToString <> DataGridView3(0, e.RowIndex + 1).Value.ToString Then
253
-                Dim startX As Integer = IIf(DataGridView3.RowHeadersVisible, DataGridView3.RowHeadersWidth, 0)
220
+            If 控制表_dgv(1, e.RowIndex).Value.ToString <> 控制表_dgv(1, e.RowIndex + 1).Value.ToString Then
221
+                Dim startX As Integer = IIf(控制表_dgv.RowHeadersVisible, 控制表_dgv.RowHeadersWidth, 0)
254 222
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
255
-                Dim endX As Integer = startX + DataGridView3.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView3.HorizontalScrollingOffset
223
+                Dim endX As Integer = startX + 控制表_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 控制表_dgv.HorizontalScrollingOffset
256 224
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
257 225
                 Exit Sub
258 226
             End If
@@ -506,4 +474,55 @@ Public Class 量產訂單控制表
506 474
     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
507 475
         列印_量產訂單控制表.ShowDialog()
508 476
     End Sub
477
+    Private Sub 啟用批量出貨_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 啟用批量出貨_ch.Click
478
+        If 啟用批量出貨_ch.Checked = False Then
479
+            批量出貨_bt.Enabled = False
480
+        Else
481
+            批量出貨_bt.Enabled = True
482
+        End If
483
+    End Sub
484
+    Private Sub 批量出貨_bt_Click(sender As Object, e As EventArgs) Handles 批量出貨_bt.Click
485
+        aa = MsgBox("執行批量出貨之前需要在訂單控制表清單中先勾選要出貨的資料,請確定你已完成出貨資料選擇?", MsgBoxStyle.OkCancel)
486
+        If aa = MsgBoxResult.Ok Then
487
+            Dim EDR, SD As Integer
488
+            For I As Integer = 0 To 控制表_dgv.Rows.Count - 1
489
+                資料數 = 控制表_dgv.Rows.Count : MyModule1.進度條()
490
+                If 控制表_dgv("選擇", I).Value = True And 控制表_dgv("驗貨報告圖片", I).Value.ToString <> "" Then
491
+                    If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
492
+                    SQL1 = "SELECT TOP (1) 貨款流水號 FROM 貨款匯入出款明細表 ORDER BY 貨款流水號 DESC"
493
+                    cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
494
+                    If dr.Read() Then : EDR = Double.Parse(Strings.Right(dr("貨款流水號").ToString, 8)) : Else : EDR = 0 : End If
495
+                    conn.Close()
496
+                    EDR += 1
497
+                    If EDR < 10 Then : ESTR = "PG" & "0000000" & EDR
498
+                    ElseIf EDR > 9 And EDR < 100 Then : ESTR = "PG" & "000000" & EDR
499
+                    ElseIf EDR > 99 And EDR < 1000 Then : ESTR = "PG" & "00000" & EDR
500
+                    ElseIf EDR > 999 And EDR < 10000 Then : ESTR = "PG" & "0000" & EDR
501
+                    ElseIf EDR > 9999 And EDR < 100000 Then : ESTR = "PG" & "000" & EDR
502
+                    ElseIf EDR > 99999 And EDR < 100000 Then : ESTR = "PG" & "00" & EDR
503
+                    ElseIf EDR > 999999 And EDR < 1000000 Then : ESTR = "PG" & "0" & EDR
504
+                    ElseIf EDR > 9999999 Then : ESTR = "PG" & EDR
505
+                    End If
506
+
507
+                    If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
508
+                    SQL1 = "INSERT INTO 貨款匯入出款明細表 (貨款流水號, 資料流水號, 訂單流水號, 年份季度, 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 出貨數量, " &
509
+                       "工廠價格, 實際離廠日, 匯款時間, 入帳時間, 貨款備註) " &
510
+                       "VALUES ('" & ESTR & "','" & 控制表_dgv.Rows(I).Cells("資料流水號").Value & "','" & 控制表_dgv.Rows(I).Cells("訂單流水號").Value &
511
+                       "','" & 控制表_dgv.Rows(I).Cells("年份季度").Value & "','" & 控制表_dgv.Rows(I).Cells("客戶訂單號").Value &
512
+                       "','" & 控制表_dgv.Rows(I).Cells("型體名稱").Value & "','" & 控制表_dgv.Rows(I).Cells("顏色").Value &
513
+                       "','" & 控制表_dgv.Rows(I).Cells("楦型").Value & "','" & 控制表_dgv.Rows(I).Cells("訂單數量").Value &
514
+                       "','" & 控制表_dgv.Rows(I).Cells("訂單數量").Value & "', '', '" & Format(Today(), "yyyy/MM/dd") & "', '', '', '')"
515
+                    cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
516
+
517
+                    If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
518
+                    SQL1 = "UPDATE 訂單控制表 SET 實際離廠日 = '" & Format(Today(), "yyyy/MM/dd") & "', 出貨數量 = '" & 控制表_dgv.Rows(I).Cells("訂單數量").Value & "' " &
519
+                       "WHERE (資料流水號 = '" & 控制表_dgv.Rows(I).Cells("資料流水號").Value & "')"
520
+                    cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
521
+                    SD += 1
522
+                End If
523
+            Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
524
+            MsgBox("一共出貨 " & SD & " 筆資料!!")
525
+            Set_清單3() : 啟用批量出貨_ch.Checked = False : 批量出貨_bt.Enabled = False
526
+        End If
527
+    End Sub
509 528
 End Class

Loading…
Cancel
Save