瀏覽代碼

版本號 : 2020092501

更新內容如下 :
1、樣品單(開發介面)新增階段分類 - Proto
2、樣品單列印新增 - 後套裡印刷 - 選項
3、訂單控制表列印成EXCEL功能中新增自動彙總表功能

Signed-off-by: B70340 <b70340@gmail.com>
B70340 4 年之前
父節點
當前提交
b16b28471c
共有 37 個文件被更改,包括 4774 次插入3861 次删除
  1. 二進制
      .vs/TENDEN-MES-SYS/v16/.suo
  2. 1
    1
      TENDEN-MES-SYS/Module/Module1.vb
  3. 二進制
      TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe
  4. 二進制
      TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb
  5. 二進制
      TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe
  6. 二進制
      TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb
  7. 二進制
      TENDEN-MES-SYS/obj/Debug/天盾國際管理系統.訂單列印選擇.resources
  8. 二進制
      TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache
  9. 二進制
      TENDEN-MES-SYS/obj/Debug/天盾系統.vbprojAssemblyReference.cache
  10. 339
    339
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表一.Designer.vb
  11. 239
    204
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表一.vb
  12. 160
    160
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表七.Designer.vb
  13. 202
    138
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表七.vb
  14. 340
    340
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表三.Designer.vb
  15. 118
    118
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表三.vb
  16. 189
    189
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表二.Designer.vb
  17. 124
    124
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表二.vb
  18. 686
    686
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表五.Designer.vb
  19. 235
    230
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表五.vb
  20. 66
    66
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表四.Designer.vb
  21. 51
    51
      TENDEN-MES-SYS/彙總報表管理/訂單分析報表四.vb
  22. 1
    1
      TENDEN-MES-SYS/樣品訂單管理/中文樣品單.Designer.vb
  23. 15
    5
      TENDEN-MES-SYS/樣品訂單管理/中文樣品單.vb
  24. 1
    1
      TENDEN-MES-SYS/樣品訂單管理/中文樣品單清單.Designer.vb
  25. 15
    2
      TENDEN-MES-SYS/樣品訂單管理/中文樣品單階段.Designer.vb
  26. 14
    6
      TENDEN-MES-SYS/樣品訂單管理/中文樣品單階段.vb
  27. 15
    2
      TENDEN-MES-SYS/樣品訂單管理/列印_中文樣品單.Designer.vb
  28. 5
    2
      TENDEN-MES-SYS/樣品訂單管理/列印_中文樣品單.vb
  29. 78
    78
      TENDEN-MES-SYS/資料庫系統管理/FTP資料夾管理.Designer.vb
  30. 20
    19
      TENDEN-MES-SYS/資料庫系統管理/FTP資料夾管理.vb
  31. 52
    52
      TENDEN-MES-SYS/資料庫系統管理/人員ID卡系統配置設定.Designer.vb
  32. 16
    16
      TENDEN-MES-SYS/資料庫系統管理/人員ID卡系統配置設定.vb
  33. 477
    95
      TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.Designer.vb
  34. 3
    0
      TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.resx
  35. 526
    150
      TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.vb
  36. 515
    515
      TENDEN-MES-SYS/量產訂單管理/鞋盒資料控制表.Designer.vb
  37. 271
    271
      TENDEN-MES-SYS/量產訂單管理/鞋盒資料控制表.vb

二進制
.vs/TENDEN-MES-SYS/v16/.suo 查看文件


+ 1
- 1
TENDEN-MES-SYS/Module/Module1.vb 查看文件

4
     Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public 登入人IP As String
4
     Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public 登入人IP As String
5
     Public CC(99) As Boolean : Public AA(99) As String : Public 登入判斷 As Boolean
5
     Public CC(99) As Boolean : Public AA(99) As String : Public 登入判斷 As Boolean
6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7
-    Public 版本 As String = "2020072401"
7
+    Public 版本 As String = "2020092501"
8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9
     Public SQL1 As String
9
     Public SQL1 As String
10
     Public 匯率 As Double
10
     Public 匯率 As Double

二進制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe 查看文件


二進制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/天盾國際管理系統.訂單列印選擇.resources 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbprojAssemblyReference.cache 查看文件


+ 339
- 339
TENDEN-MES-SYS/彙總報表管理/訂單分析報表一.Designer.vb
文件差異過大導致無法顯示
查看文件


+ 239
- 204
TENDEN-MES-SYS/彙總報表管理/訂單分析報表一.vb 查看文件

9
     Dim dr As SqlDataReader
9
     Dim dr As SqlDataReader
10
     Dim 條件 As String
10
     Dim 條件 As String
11
     Private  Sub Set_DGV1載入前設定()
11
     Private  Sub Set_DGV1載入前設定()
12
-        DataGridView1.DataSource = Nothing : ds.Clear()
13
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
14
-        DataGridView1.ColumnHeadersHeight = 25
15
-        DataGridView1.AllowUserToAddRows = False
12
+        圖片資料庫_dgv.DataSource = Nothing : ds.Clear()
13
+        圖片資料庫_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
14
+        圖片資料庫_dgv.ColumnHeadersHeight = 25
15
+        圖片資料庫_dgv.AllowUserToAddRows = False
16
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
16
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
17
     End Sub
17
     End Sub
18
     Private  Sub Set_DGV1載入後設定()
18
     Private  Sub Set_DGV1載入後設定()
19
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
19
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 圖片資料庫_dgv.DataSource = ds.Tables(0) : conn.Close()
20
     End Sub
20
     End Sub
21
     Private  Sub Set_圖片清單()
21
     Private  Sub Set_圖片清單()
22
         Set_DGV1載入前設定()
22
         Set_DGV1載入前設定()
24
         Set_DGV1載入後設定()
24
         Set_DGV1載入後設定()
25
     End Sub
25
     End Sub
26
     Private  Sub Set_grid1()
26
     Private  Sub Set_grid1()
27
-        DataGridView1.Columns(0).Width = 90 : DataGridView1.Columns(1).Width = 60
28
-        DataGridView1.Columns(1).DefaultCellStyle.Format = "#,##0"
29
-        DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
27
+        圖片資料庫_dgv.Columns(0).Width = 90 : 圖片資料庫_dgv.Columns(1).Width = 60
28
+        圖片資料庫_dgv.Columns(1).DefaultCellStyle.Format = "#,##0"
29
+        圖片資料庫_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 圖片資料庫_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
30
     End Sub
30
     End Sub
31
     Private  Sub Set_DGV2載入前設定()
31
     Private  Sub Set_DGV2載入前設定()
32
-        DataGridView2.DataSource = Nothing : ds1.Clear()
33
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
34
-        DataGridView2.ColumnHeadersHeight = 25
35
-        DataGridView2.AllowUserToAddRows = False
32
+        中文樣品單資料庫_dgv.DataSource = Nothing : ds1.Clear()
33
+        中文樣品單資料庫_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
34
+        中文樣品單資料庫_dgv.ColumnHeadersHeight = 25
35
+        中文樣品單資料庫_dgv.AllowUserToAddRows = False
36
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
36
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
37
     End Sub
37
     End Sub
38
     Private  Sub Set_DGV2載入後設定()
38
     Private  Sub Set_DGV2載入後設定()
39
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
39
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : 中文樣品單資料庫_dgv.DataSource = ds1.Tables(0) : conn.Close()
40
     End Sub
40
     End Sub
41
     Private  Sub Set_樣品單清單()
41
     Private  Sub Set_樣品單清單()
42
         Set_DGV2載入前設定()
42
         Set_DGV2載入前設定()
47
         Set_DGV2載入後設定()
47
         Set_DGV2載入後設定()
48
     End Sub
48
     End Sub
49
     Private  Sub Set_grid2()
49
     Private  Sub Set_grid2()
50
-        DataGridView2.Columns(0).Width = 50 : DataGridView2.Columns(1).Width = 50 : DataGridView2.Columns(2).Width = 50 : DataGridView2.Columns(3).Width = 60 : DataGridView2.Columns(4).Width = 60
51
-        DataGridView2.Columns(3).DefaultCellStyle.Format = "#,##0"
52
-        DataGridView2.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
53
-        DataGridView2.Columns(4).DefaultCellStyle.Format = "#,##0"
54
-        DataGridView2.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
50
+        中文樣品單資料庫_dgv.Columns(0).Width = 50 : 中文樣品單資料庫_dgv.Columns(1).Width = 50 : 中文樣品單資料庫_dgv.Columns(2).Width = 50 : 中文樣品單資料庫_dgv.Columns(3).Width = 60
51
+        中文樣品單資料庫_dgv.Columns(4).Width = 60
52
+        中文樣品單資料庫_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
53
+        中文樣品單資料庫_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
54
+        中文樣品單資料庫_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
55
+        中文樣品單資料庫_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
56
+        中文樣品單資料庫_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
57
+        中文樣品單資料庫_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
55
     End Sub
58
     End Sub
56
     Private  Sub Set_DGV3載入前設定()
59
     Private  Sub Set_DGV3載入前設定()
57
-        DataGridView3.DataSource = Nothing : ds2.Clear()
58
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
59
-        DataGridView3.ColumnHeadersHeight = 25
60
-        DataGridView3.AllowUserToAddRows = False
60
+        掛牌資料庫_dgv.DataSource = Nothing : ds2.Clear()
61
+        掛牌資料庫_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
62
+        掛牌資料庫_dgv.ColumnHeadersHeight = 25
63
+        掛牌資料庫_dgv.AllowUserToAddRows = False
61
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
64
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
62
     End Sub
65
     End Sub
63
     Private  Sub Set_DGV3載入後設定()
66
     Private  Sub Set_DGV3載入後設定()
64
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
67
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : 掛牌資料庫_dgv.DataSource = ds2.Tables(0) : conn.Close()
65
     End Sub
68
     End Sub
66
     Private  Sub Set_吊牌清單()
69
     Private  Sub Set_吊牌清單()
67
         Set_DGV3載入前設定()
70
         Set_DGV3載入前設定()
72
         Set_DGV3載入後設定()
75
         Set_DGV3載入後設定()
73
     End Sub
76
     End Sub
74
     Private  Sub Set_grid3()
77
     Private  Sub Set_grid3()
75
-        DataGridView3.Columns(0).Width = 50 : DataGridView3.Columns(1).Width = 50 : DataGridView3.Columns(2).Width = 50 : DataGridView3.Columns(3).Width = 60 : DataGridView3.Columns(4).Width = 60
76
-        DataGridView3.Columns(3).DefaultCellStyle.Format = "#,##0"
77
-        DataGridView3.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
78
-        DataGridView3.Columns(4).DefaultCellStyle.Format = "#,##0"
79
-        DataGridView3.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
78
+        掛牌資料庫_dgv.Columns(0).Width = 50 : 掛牌資料庫_dgv.Columns(1).Width = 50 : 掛牌資料庫_dgv.Columns(2).Width = 50 : 掛牌資料庫_dgv.Columns(3).Width = 60
79
+        掛牌資料庫_dgv.Columns(4).Width = 60
80
+        掛牌資料庫_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
81
+        掛牌資料庫_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
82
+        掛牌資料庫_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
83
+        掛牌資料庫_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
84
+        掛牌資料庫_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
85
+        掛牌資料庫_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
80
     End Sub
86
     End Sub
81
     Private  Sub Set_DGV4載入前設定()
87
     Private  Sub Set_DGV4載入前設定()
82
-        DataGridView4.DataSource = Nothing : ds3.Clear()
83
-        DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
84
-        DataGridView4.ColumnHeadersHeight = 25
85
-        DataGridView4.AllowUserToAddRows = False
88
+        確認通知書_dgv.DataSource = Nothing : ds3.Clear()
89
+        確認通知書_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
90
+        確認通知書_dgv.ColumnHeadersHeight = 25
91
+        確認通知書_dgv.AllowUserToAddRows = False
86
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
92
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
87
     End Sub
93
     End Sub
88
     Private  Sub Set_DGV4載入後設定()
94
     Private  Sub Set_DGV4載入後設定()
89
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
95
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : 確認通知書_dgv.DataSource = ds3.Tables(0) : conn.Close()
90
     End Sub
96
     End Sub
91
     Private  Sub Set_確認通知單()
97
     Private  Sub Set_確認通知單()
92
         Set_DGV4載入前設定()
98
         Set_DGV4載入前設定()
96
         Set_DGV4載入後設定()
102
         Set_DGV4載入後設定()
97
     End Sub
103
     End Sub
98
     Private  Sub Set_grid4()
104
     Private  Sub Set_grid4()
99
-        DataGridView4.Columns(0).Width = 50 : DataGridView4.Columns(1).Width = 50 : DataGridView4.Columns(2).Width = 90 : DataGridView4.Columns(3).Width = 90
105
+        確認通知書_dgv.Columns(0).Width = 50 : 確認通知書_dgv.Columns(1).Width = 50 : 確認通知書_dgv.Columns(2).Width = 90 : 確認通知書_dgv.Columns(3).Width = 90
100
     End Sub
106
     End Sub
101
     Private  Sub Set_DGV5載入前設定()
107
     Private  Sub Set_DGV5載入前設定()
102
-        DataGridView5.DataSource = Nothing : ds4.Clear()
103
-        DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
104
-        DataGridView5.ColumnHeadersHeight = 25
105
-        DataGridView5.AllowUserToAddRows = False
108
+        量產樣品控制表未出貨數_dgv.DataSource = Nothing : ds4.Clear()
109
+        量產樣品控制表未出貨數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
110
+        量產樣品控制表未出貨數_dgv.ColumnHeadersHeight = 25
111
+        量產樣品控制表未出貨數_dgv.AllowUserToAddRows = False
106
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
112
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
107
     End Sub
113
     End Sub
108
     Private  Sub Set_DGV5載入後設定()
114
     Private  Sub Set_DGV5載入後設定()
109
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
115
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4)
116
+        量產樣品控制表未出貨數_dgv.DataSource = ds4.Tables(0) : conn.Close()
110
     End Sub
117
     End Sub
111
     Private  Sub Set_量產樣品控制表未出貨數()
118
     Private  Sub Set_量產樣品控制表未出貨數()
112
         Set_DGV5載入前設定()
119
         Set_DGV5載入前設定()
116
         Set_DGV5載入後設定()
123
         Set_DGV5載入後設定()
117
     End Sub
124
     End Sub
118
     Private  Sub Set_grid5()
125
     Private  Sub Set_grid5()
119
-        DataGridView5.Columns(0).Width = 45 : DataGridView5.Columns(1).Width = 120 : DataGridView5.Columns(2).Width = 40 : DataGridView5.Columns(3).Width = 58 : DataGridView5.Columns(4).Width = 58
120
-        DataGridView5.Columns(5).Width = 58
121
-        DataGridView5.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
122
-        DataGridView5.Columns(4).DefaultCellStyle.Format = "#,##0"
123
-        DataGridView5.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
124
-        DataGridView5.Columns(5).DefaultCellStyle.Format = "#,##0"
125
-        DataGridView5.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
126
+        量產樣品控制表未出貨數_dgv.Columns(0).Width = 45 : 量產樣品控制表未出貨數_dgv.Columns(1).Width = 120 : 量產樣品控制表未出貨數_dgv.Columns(2).Width = 40
127
+        量產樣品控制表未出貨數_dgv.Columns(3).Width = 58 : 量產樣品控制表未出貨數_dgv.Columns(4).Width = 58
128
+        量產樣品控制表未出貨數_dgv.Columns(5).Width = 58
129
+        量產樣品控制表未出貨數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
130
+        量產樣品控制表未出貨數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
131
+        量產樣品控制表未出貨數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
132
+        量產樣品控制表未出貨數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
133
+        量產樣品控制表未出貨數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
134
+        量產樣品控制表未出貨數_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
135
+        量產樣品控制表未出貨數_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
136
+        量產樣品控制表未出貨數_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
126
     End Sub
137
     End Sub
127
     Private  Sub Set_DGV6載入前設定()
138
     Private  Sub Set_DGV6載入前設定()
128
-        DataGridView6.DataSource = Nothing : ds5.Clear()
129
-        DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
130
-        DataGridView6.ColumnHeadersHeight = 25
131
-        DataGridView6.AllowUserToAddRows = False
139
+        CXL數_dgv.DataSource = Nothing : ds5.Clear()
140
+        CXL數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
141
+        CXL數_dgv.ColumnHeadersHeight = 25
142
+        CXL數_dgv.AllowUserToAddRows = False
132
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
143
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
133
     End Sub
144
     End Sub
134
-    Private  Sub Set_DGV6載入後設定()
135
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
145
+    Private Sub Set_DGV6載入後設定()
146
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : CXL數_dgv.DataSource = ds5.Tables(0) : conn.Close()
136
     End Sub
147
     End Sub
137
-    Private  Sub Set_量產樣品控制表CXL數()
148
+    Private Sub Set_量產樣品控制表CXL數()
138
         Set_DGV6載入前設定()
149
         Set_DGV6載入前設定()
139
         SQL1 = "SELECT 年份, Sample_Type, FTY, COUNT(Style) AS 樣品單數, SUM(資料筆數) AS 顏色筆數, SUM(總雙數) AS 總雙數 FROM (SELECT 年份, Sample_Type, FTY, Style, COUNT(Style) AS 資料筆數, " &
150
         SQL1 = "SELECT 年份, Sample_Type, FTY, COUNT(Style) AS 樣品單數, SUM(資料筆數) AS 顏色筆數, SUM(總雙數) AS 總雙數 FROM (SELECT 年份, Sample_Type, FTY, Style, COUNT(Style) AS 資料筆數, " &
140
                "SUM(QTY) AS 總雙數 FROM 量產樣品控制表 WHERE (CXL = 1) AND (年份 LIKE '" & 季度_cb.Text & "') GROUP BY 年份, Sample_Type, FTY, Style) AS Q " &
151
                "SUM(QTY) AS 總雙數 FROM 量產樣品控制表 WHERE (CXL = 1) AND (年份 LIKE '" & 季度_cb.Text & "') GROUP BY 年份, Sample_Type, FTY, Style) AS Q " &
141
                "GROUP BY 年份, Sample_Type, FTY"
152
                "GROUP BY 年份, Sample_Type, FTY"
142
         Set_DGV6載入後設定()
153
         Set_DGV6載入後設定()
143
     End Sub
154
     End Sub
144
-    Private  Sub Set_grid6()
145
-        DataGridView6.Columns(0).Width = 45 : DataGridView6.Columns(1).Width = 120 : DataGridView6.Columns(2).Width = 40 : DataGridView6.Columns(3).Width = 58 : DataGridView6.Columns(4).Width = 58
146
-        DataGridView6.Columns(5).Width = 58
147
-        DataGridView6.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
148
-        DataGridView6.Columns(4).DefaultCellStyle.Format = "#,##0"
149
-        DataGridView6.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
150
-        DataGridView6.Columns(5).DefaultCellStyle.Format = "#,##0"
151
-        DataGridView6.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
152
-    End Sub
153
-    Private  Sub Set_DGV7載入前設定()
154
-        DataGridView7.DataSource = Nothing : ds6.Clear()
155
-        DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
156
-        DataGridView7.ColumnHeadersHeight = 25
157
-        DataGridView7.AllowUserToAddRows = False
155
+    Private Sub Set_grid6()
156
+        CXL數_dgv.Columns(0).Width = 45 : CXL數_dgv.Columns(1).Width = 120 : CXL數_dgv.Columns(2).Width = 40 : CXL數_dgv.Columns(3).Width = 58 : CXL數_dgv.Columns(4).Width = 58
157
+        CXL數_dgv.Columns(5).Width = 58
158
+        CXL數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : CXL數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
159
+        CXL數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
160
+        CXL數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : CXL數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
161
+        CXL數_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
162
+        CXL數_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : CXL數_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
163
+    End Sub
164
+    Private Sub Set_DGV7載入前設定()
165
+        量產樣品控制表已出貨數_dgv.DataSource = Nothing : ds6.Clear()
166
+        量產樣品控制表已出貨數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
167
+        量產樣品控制表已出貨數_dgv.ColumnHeadersHeight = 25
168
+        量產樣品控制表已出貨數_dgv.AllowUserToAddRows = False
158
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
169
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
159
     End Sub
170
     End Sub
160
-    Private  Sub Set_DGV7載入後設定()
161
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6) : DataGridView7.DataSource = ds6.Tables(0) : conn.Close()
171
+    Private Sub Set_DGV7載入後設定()
172
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6)
173
+        量產樣品控制表已出貨數_dgv.DataSource = ds6.Tables(0) : conn.Close()
162
     End Sub
174
     End Sub
163
-    Private  Sub Set_量產樣品控制表已出貨數()
175
+    Private Sub Set_量產樣品控制表已出貨數()
164
         Set_DGV7載入前設定()
176
         Set_DGV7載入前設定()
165
         SQL1 = "SELECT 年份, Sample_Type, FTY, COUNT(Style) AS 樣品單數, SUM(資料筆數) AS 顏色筆數, SUM(總雙數) AS 總雙數 FROM (SELECT 年份, Sample_Type, FTY, Style, COUNT(Style) AS 資料筆數, " &
177
         SQL1 = "SELECT 年份, Sample_Type, FTY, COUNT(Style) AS 樣品單數, SUM(資料筆數) AS 顏色筆數, SUM(總雙數) AS 總雙數 FROM (SELECT 年份, Sample_Type, FTY, Style, COUNT(Style) AS 資料筆數, " &
166
                "SUM(QTY) AS 總雙數 FROM 量產樣品控制表 WHERE (CXL = 0) AND (QTY - 出貨數量 = 0) AND (年份 LIKE '" & 季度_cb.Text & "') GROUP BY 年份, Sample_Type, FTY, Style) AS Q " &
178
                "SUM(QTY) AS 總雙數 FROM 量產樣品控制表 WHERE (CXL = 0) AND (QTY - 出貨數量 = 0) AND (年份 LIKE '" & 季度_cb.Text & "') GROUP BY 年份, Sample_Type, FTY, Style) AS Q " &
167
                "GROUP BY 年份, Sample_Type, FTY"
179
                "GROUP BY 年份, Sample_Type, FTY"
168
         Set_DGV7載入後設定()
180
         Set_DGV7載入後設定()
169
     End Sub
181
     End Sub
170
-    Private  Sub Set_grid7()
171
-        DataGridView7.Columns(0).Width = 45 : DataGridView7.Columns(1).Width = 120 : DataGridView7.Columns(2).Width = 40 : DataGridView7.Columns(3).Width = 58 : DataGridView7.Columns(4).Width = 58
172
-        DataGridView7.Columns(5).Width = 58
173
-        DataGridView7.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
174
-        DataGridView7.Columns(4).DefaultCellStyle.Format = "#,##0"
175
-        DataGridView7.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
176
-    End Sub
177
-    Private  Sub Set_DGV8載入前設定()
178
-        DataGridView8.DataSource = Nothing : ds7.Clear()
179
-        DataGridView8.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
180
-        DataGridView8.ColumnHeadersHeight = 25
181
-        DataGridView8.AllowUserToAddRows = False
182
+    Private Sub Set_grid7()
183
+        量產樣品控制表已出貨數_dgv.Columns(0).Width = 45 : 量產樣品控制表已出貨數_dgv.Columns(1).Width = 120 : 量產樣品控制表已出貨數_dgv.Columns(2).Width = 40
184
+        量產樣品控制表已出貨數_dgv.Columns(3).Width = 58 : 量產樣品控制表已出貨數_dgv.Columns(4).Width = 58
185
+        量產樣品控制表已出貨數_dgv.Columns(5).Width = 58
186
+        量產樣品控制表已出貨數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
187
+        量產樣品控制表已出貨數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
188
+        量產樣品控制表已出貨數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
189
+        量產樣品控制表已出貨數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
190
+        量產樣品控制表已出貨數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
191
+    End Sub
192
+    Private Sub Set_DGV8載入前設定()
193
+        訂單控制表未出貨數_dgv.DataSource = Nothing : ds7.Clear()
194
+        訂單控制表未出貨數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
195
+        訂單控制表未出貨數_dgv.ColumnHeadersHeight = 25
196
+        訂單控制表未出貨數_dgv.AllowUserToAddRows = False
182
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
197
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
183
     End Sub
198
     End Sub
184
-    Private  Sub Set_DGV8載入後設定()
185
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds7) : DataGridView8.DataSource = ds7.Tables(0) : conn.Close()
199
+    Private Sub Set_DGV8載入後設定()
200
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds7)
201
+        訂單控制表未出貨數_dgv.DataSource = ds7.Tables(0) : conn.Close()
186
     End Sub
202
     End Sub
187
-    Private  Sub Set_訂單控制表未出貨數()
203
+    Private Sub Set_訂單控制表未出貨數()
188
         Set_DGV8載入前設定()
204
         Set_DGV8載入前設定()
189
         If 量產訂單依季度篩選_cb.Checked = True Then
205
         If 量產訂單依季度篩選_cb.Checked = True Then
190
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
206
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
204
         End If
220
         End If
205
         Set_DGV8載入後設定()
221
         Set_DGV8載入後設定()
206
     End Sub
222
     End Sub
207
-    Private  Sub Set_grid8()
208
-        DataGridView8.Columns(0).Width = 65 : DataGridView8.Columns(1).Width = 60 : DataGridView8.Columns(2).Width = 60 : DataGridView8.Columns(3).Width = 60 : DataGridView8.Columns(4).Width = 60
209
-        DataGridView8.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView8.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
210
-        DataGridView8.Columns(4).DefaultCellStyle.Format = "#,##0"
211
-        DataGridView8.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView8.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
212
-    End Sub
213
-    Private  Sub Set_DGV9載入前設定()
214
-        DataGridView9.DataSource = Nothing : ds8.Clear()
215
-        DataGridView9.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
216
-        DataGridView9.ColumnHeadersHeight = 25
217
-        DataGridView9.AllowUserToAddRows = False
223
+    Private Sub Set_grid8()
224
+        訂單控制表未出貨數_dgv.Columns(0).Width = 65 : 訂單控制表未出貨數_dgv.Columns(1).Width = 60 : 訂單控制表未出貨數_dgv.Columns(2).Width = 60
225
+        訂單控制表未出貨數_dgv.Columns(3).Width = 60 : 訂單控制表未出貨數_dgv.Columns(4).Width = 60
226
+        訂單控制表未出貨數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
227
+        訂單控制表未出貨數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
228
+        訂單控制表未出貨數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
229
+        訂單控制表未出貨數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
230
+        訂單控制表未出貨數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
231
+    End Sub
232
+    Private Sub Set_DGV9載入前設定()
233
+        訂單控制表已出貨數_dgv.DataSource = Nothing : ds8.Clear()
234
+        訂單控制表已出貨數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
235
+        訂單控制表已出貨數_dgv.ColumnHeadersHeight = 25
236
+        訂單控制表已出貨數_dgv.AllowUserToAddRows = False
218
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
237
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
219
     End Sub
238
     End Sub
220
-    Private  Sub Set_DGV9載入後設定()
221
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds8) : DataGridView9.DataSource = ds8.Tables(0) : conn.Close()
239
+    Private Sub Set_DGV9載入後設定()
240
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds8)
241
+        訂單控制表已出貨數_dgv.DataSource = ds8.Tables(0) : conn.Close()
222
     End Sub
242
     End Sub
223
-    Private  Sub Set_訂單控制表已出貨數()
243
+    Private Sub Set_訂單控制表已出貨數()
224
         Set_DGV9載入前設定()
244
         Set_DGV9載入前設定()
225
         If 量產訂單依季度篩選_cb.Checked = True Then
245
         If 量產訂單依季度篩選_cb.Checked = True Then
226
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
246
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
235
             End If
255
             End If
236
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(" & 條件 & ", 7) AS 交期, " &
256
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(" & 條件 & ", 7) AS 交期, " &
237
                    "LEFT(年份季度,4) AS 年份季度, 生產工廠, 形體號, SUM(訂單數量) AS 訂單總數 " &
257
                    "LEFT(年份季度,4) AS 年份季度, 生產工廠, 形體號, SUM(訂單數量) AS 訂單總數 " &
238
-                   "FROM 訂單控制表 WHERE (LEFT(" & 條件 & ", 4) LIKE '" & 年度_cb.Text & "%') AND (CXL = 0 OR CXL IS NULL) AND (訂單數量 - 出貨數量 = 0) GROUP BY LEFT(" & 條件 & ", 7), LEFT(年份季度,4), " &
239
-                   "生產工廠, 形體號) AS Q GROUP BY LEFT(年份季度,4), 生產工廠, 交期 ORDER BY 生產工廠, 交期 DESC"
258
+                   "FROM 訂單控制表 
259
+                   WHERE (LEFT(" & 條件 & ", 4) LIKE '" & 年度_cb.Text & "%') AND (CXL = 0 OR CXL IS NULL) AND (訂單數量 - 出貨數量 = 0) 
260
+                   GROUP BY LEFT(" & 條件 & ", 7), LEFT(年份季度,4), 生產工廠, 形體號) AS Q GROUP BY LEFT(年份季度,4), 生產工廠, 交期 ORDER BY 生產工廠, 交期 DESC"
240
         End If
261
         End If
241
         Set_DGV9載入後設定()
262
         Set_DGV9載入後設定()
242
     End Sub
263
     End Sub
243
-    Private  Sub Set_grid9()
244
-        DataGridView9.Columns(0).Width = 65 : DataGridView9.Columns(1).Width = 60 : DataGridView9.Columns(2).Width = 60 : DataGridView9.Columns(3).Width = 60 : DataGridView9.Columns(4).Width = 60
245
-        DataGridView9.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView9.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
246
-        DataGridView9.Columns(4).DefaultCellStyle.Format = "#,##0"
247
-        DataGridView9.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView9.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
248
-    End Sub
249
-    Private  Sub Set_DGV10載入前設定()
250
-        DataGridView10.DataSource = Nothing : ds9.Clear()
251
-        DataGridView10.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
252
-        DataGridView10.ColumnHeadersHeight = 25
253
-        DataGridView10.AllowUserToAddRows = False
264
+    Private Sub Set_grid9()
265
+        訂單控制表已出貨數_dgv.Columns(0).Width = 65 : 訂單控制表已出貨數_dgv.Columns(1).Width = 60 : 訂單控制表已出貨數_dgv.Columns(2).Width = 60
266
+        訂單控制表已出貨數_dgv.Columns(3).Width = 60 : 訂單控制表已出貨數_dgv.Columns(4).Width = 60
267
+        訂單控制表已出貨數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
268
+        訂單控制表已出貨數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
269
+        訂單控制表已出貨數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
270
+        訂單控制表已出貨數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
271
+        訂單控制表已出貨數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
272
+    End Sub
273
+    Private Sub Set_DGV10載入前設定()
274
+        訂單控制表CXL數_dgv.DataSource = Nothing : ds9.Clear()
275
+        訂單控制表CXL數_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
276
+        訂單控制表CXL數_dgv.ColumnHeadersHeight = 25
277
+        訂單控制表CXL數_dgv.AllowUserToAddRows = False
254
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
278
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
255
     End Sub
279
     End Sub
256
-    Private  Sub Set_DGV10載入後設定()
257
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds9) : DataGridView10.DataSource = ds9.Tables(0) : conn.Close()
280
+    Private Sub Set_DGV10載入後設定()
281
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds9)
282
+        訂單控制表CXL數_dgv.DataSource = ds9.Tables(0) : conn.Close()
258
     End Sub
283
     End Sub
259
-    Private  Sub Set_訂單控制表CXL數()
284
+    Private Sub Set_訂單控制表CXL數()
260
         Set_DGV10載入前設定()
285
         Set_DGV10載入前設定()
261
         If 量產訂單依季度篩選_cb.Checked = True Then
286
         If 量產訂單依季度篩選_cb.Checked = True Then
262
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
287
             SQL1 = "SELECT 交期, LEFT(年份季度,4) AS 季度, 生產工廠 AS 工廠, COUNT(形體號) AS 訂單數量, SUM(訂單總數) AS 訂單總數 FROM (SELECT LEFT(客戶交期, 7) AS 交期, " &
276
         End If
301
         End If
277
         Set_DGV10載入後設定()
302
         Set_DGV10載入後設定()
278
     End Sub
303
     End Sub
279
-    Private  Sub Set_grid10()
280
-        DataGridView10.Columns(0).Width = 65 : DataGridView10.Columns(1).Width = 60 : DataGridView10.Columns(2).Width = 60 : DataGridView10.Columns(3).Width = 60 : DataGridView10.Columns(4).Width = 60
281
-        DataGridView10.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView10.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
282
-        DataGridView10.Columns(4).DefaultCellStyle.Format = "#,##0"
283
-        DataGridView10.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView10.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
304
+    Private Sub Set_grid10()
305
+        訂單控制表CXL數_dgv.Columns(0).Width = 65 : 訂單控制表CXL數_dgv.Columns(1).Width = 60 : 訂單控制表CXL數_dgv.Columns(2).Width = 60
306
+        訂單控制表CXL數_dgv.Columns(3).Width = 60 : 訂單控制表CXL數_dgv.Columns(4).Width = 60
307
+        訂單控制表CXL數_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
308
+        訂單控制表CXL數_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
309
+        訂單控制表CXL數_dgv.Columns(4).DefaultCellStyle.Format = "#,##0"
310
+        訂單控制表CXL數_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
311
+        訂單控制表CXL數_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
284
     End Sub
312
     End Sub
285
-    Private  Sub ComboBox2下拉表單資料載入()
313
+    Private Sub ComboBox2下拉表單資料載入()
286
         conn.Close()
314
         conn.Close()
287
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
315
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
288
         SQL1 = "SELECT 年份季度 FROM 訂單控制表年份季度清單 ORDER BY 年份季度 DESC"
316
         SQL1 = "SELECT 年份季度 FROM 訂單控制表年份季度清單 ORDER BY 年份季度 DESC"
290
         季度_cb.Items.Clear()
318
         季度_cb.Items.Clear()
291
         While (dr.Read()) : 季度_cb.Items.Add(dr("年份季度")) : End While : conn.Close()
319
         While (dr.Read()) : 季度_cb.Items.Add(dr("年份季度")) : End While : conn.Close()
292
     End Sub
320
     End Sub
293
-    Private  Sub 查詢()
321
+    Private Sub 查詢()
294
         Set_圖片清單() : Set_grid1() : Set_樣品單清單() : Set_grid2() : Set_吊牌清單() : Set_grid3() : Set_確認通知單() : Set_grid4() : Set_量產樣品控制表未出貨數() : Set_grid5()
322
         Set_圖片清單() : Set_grid1() : Set_樣品單清單() : Set_grid2() : Set_吊牌清單() : Set_grid3() : Set_確認通知單() : Set_grid4() : Set_量產樣品控制表未出貨數() : Set_grid5()
295
         Set_量產樣品控制表CXL數() : Set_grid6() : Set_量產樣品控制表已出貨數() : Set_grid7() : Set_訂單控制表未出貨數() : Set_grid8() : Set_訂單控制表已出貨數() : Set_grid9()
323
         Set_量產樣品控制表CXL數() : Set_grid6() : Set_量產樣品控制表已出貨數() : Set_grid7() : Set_訂單控制表未出貨數() : Set_grid8() : Set_訂單控制表已出貨數() : Set_grid9()
296
         Set_訂單控制表CXL數() : Set_grid10() : Set_自動彙總1()
324
         Set_訂單控制表CXL數() : Set_grid10() : Set_自動彙總1()
297
     End Sub
325
     End Sub
298
-    Private  Sub Set_自動彙總1()
326
+    Private Sub Set_自動彙總1()
299
         Dim 加總(34) As Double
327
         Dim 加總(34) As Double
300
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
301
-            If DataGridView1.RowCount = 0 Then : 加總(0) += 0 : Else : 加總(0) += DataGridView1.Rows(i).Cells("圖片數量").Value : End If
328
+        For i As Integer = 0 To 圖片資料庫_dgv.Rows.Count - 1
329
+            If 圖片資料庫_dgv.RowCount = 0 Then : 加總(0) += 0 : Else : 加總(0) += 圖片資料庫_dgv.Rows(i).Cells("圖片數量").Value : End If
302
         Next i
330
         Next i
303
         加總(1) = 0 : 加總(2) = 0 : 加總(3) = 0 : 加總(4) = 0 : 加總(5) = 0 : 加總(6) = 0 : 加總(7) = 0 : 加總(8) = 0 : 加總(9) = 0 : 加總(10) = 0
331
         加總(1) = 0 : 加總(2) = 0 : 加總(3) = 0 : 加總(4) = 0 : 加總(5) = 0 : 加總(6) = 0 : 加總(7) = 0 : 加總(8) = 0 : 加總(9) = 0 : 加總(10) = 0
304
-        For i As Integer = 0 To DataGridView2.Rows.Count - 1
305
-            If DataGridView2.Rows(i).Cells("階段").Value = "ILR" Then
306
-                If DataGridView2.RowCount = 0 Then : 加總(1) += 0 : Else : 加總(1) += DataGridView2.Rows(i).Cells("樣品單數").Value : End If
307
-                If DataGridView2.RowCount = 0 Then : 加總(2) += 0 : Else : 加總(2) += DataGridView2.Rows(i).Cells("顏色筆數").Value : End If
308
-            ElseIf DataGridView2.Rows(i).Cells("階段").Value = "FLR" Then
309
-                If DataGridView2.RowCount = 0 Then : 加總(3) += 0 : Else : 加總(3) += DataGridView2.Rows(i).Cells("樣品單數").Value : End If
310
-                If DataGridView2.RowCount = 0 Then : 加總(4) += 0 : Else : 加總(4) += DataGridView2.Rows(i).Cells("顏色筆數").Value : End If
311
-            ElseIf DataGridView2.Rows(i).Cells("階段").Value = "SMS" Then
312
-                If DataGridView2.RowCount = 0 Then : 加總(5) += 0 : Else : 加總(5) += DataGridView2.Rows(i).Cells("樣品單數").Value : End If
313
-                If DataGridView2.RowCount = 0 Then : 加總(6) += 0 : Else : 加總(6) += DataGridView2.Rows(i).Cells("顏色筆數").Value : End If
314
-            ElseIf DataGridView2.Rows(i).Cells("階段").Value = "SMU" Then
315
-                If DataGridView2.RowCount = 0 Then : 加總(7) += 0 : Else : 加總(7) += DataGridView2.Rows(i).Cells("樣品單數").Value : End If
316
-                If DataGridView2.RowCount = 0 Then : 加總(8) += 0 : Else : 加總(8) += DataGridView2.Rows(i).Cells("顏色筆數").Value : End If
317
-            ElseIf DataGridView2.Rows(i).Cells("階段").Value = "CFM" Then
318
-                If DataGridView2.RowCount = 0 Then : 加總(9) += 0 : Else : 加總(9) += DataGridView2.Rows(i).Cells("樣品單數").Value : End If
319
-                If DataGridView2.RowCount = 0 Then : 加總(10) += 0 : Else : 加總(10) += DataGridView2.Rows(i).Cells("顏色筆數").Value : End If
332
+        For i As Integer = 0 To 中文樣品單資料庫_dgv.Rows.Count - 1
333
+            If 中文樣品單資料庫_dgv.Rows(i).Cells("階段").Value = "ILR" Then
334
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(1) += 0 : Else : 加總(1) += 中文樣品單資料庫_dgv.Rows(i).Cells("樣品單數").Value : End If
335
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(2) += 0 : Else : 加總(2) += 中文樣品單資料庫_dgv.Rows(i).Cells("顏色筆數").Value : End If
336
+            ElseIf 中文樣品單資料庫_dgv.Rows(i).Cells("階段").Value = "FLR" Then
337
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(3) += 0 : Else : 加總(3) += 中文樣品單資料庫_dgv.Rows(i).Cells("樣品單數").Value : End If
338
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(4) += 0 : Else : 加總(4) += 中文樣品單資料庫_dgv.Rows(i).Cells("顏色筆數").Value : End If
339
+            ElseIf 中文樣品單資料庫_dgv.Rows(i).Cells("階段").Value = "SMS" Then
340
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(5) += 0 : Else : 加總(5) += 中文樣品單資料庫_dgv.Rows(i).Cells("樣品單數").Value : End If
341
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(6) += 0 : Else : 加總(6) += 中文樣品單資料庫_dgv.Rows(i).Cells("顏色筆數").Value : End If
342
+            ElseIf 中文樣品單資料庫_dgv.Rows(i).Cells("階段").Value = "SMU" Then
343
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(7) += 0 : Else : 加總(7) += 中文樣品單資料庫_dgv.Rows(i).Cells("樣品單數").Value : End If
344
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(8) += 0 : Else : 加總(8) += 中文樣品單資料庫_dgv.Rows(i).Cells("顏色筆數").Value : End If
345
+            ElseIf 中文樣品單資料庫_dgv.Rows(i).Cells("階段").Value = "CFM" Then
346
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(9) += 0 : Else : 加總(9) += 中文樣品單資料庫_dgv.Rows(i).Cells("樣品單數").Value : End If
347
+                If 中文樣品單資料庫_dgv.RowCount = 0 Then : 加總(10) += 0 : Else : 加總(10) += 中文樣品單資料庫_dgv.Rows(i).Cells("顏色筆數").Value : End If
320
             End If
348
             End If
321
         Next i
349
         Next i
322
-        For i As Integer = 0 To DataGridView5.Rows.Count - 1
323
-            If DataGridView5.RowCount = 0 Then : 加總(11) += 0 : Else : 加總(11) += DataGridView5.Rows(i).Cells("樣品單數").Value : End If
324
-            If DataGridView5.RowCount = 0 Then : 加總(12) += 0 : Else : 加總(12) += DataGridView5.Rows(i).Cells("總雙數").Value : End If
350
+        For i As Integer = 0 To 量產樣品控制表未出貨數_dgv.Rows.Count - 1
351
+            If 量產樣品控制表未出貨數_dgv.RowCount = 0 Then : 加總(11) += 0 : Else : 加總(11) += 量產樣品控制表未出貨數_dgv.Rows(i).Cells("樣品單數").Value : End If
352
+            If 量產樣品控制表未出貨數_dgv.RowCount = 0 Then : 加總(12) += 0 : Else : 加總(12) += 量產樣品控制表未出貨數_dgv.Rows(i).Cells("總雙數").Value : End If
325
         Next i
353
         Next i
326
-        For i As Integer = 0 To DataGridView6.Rows.Count - 1
327
-            If DataGridView6.RowCount = 0 Then : 加總(13) += 0 : Else : 加總(13) += DataGridView6.Rows(i).Cells("樣品單數").Value : End If
328
-            If DataGridView6.RowCount = 0 Then : 加總(14) += 0 : Else : 加總(14) += DataGridView6.Rows(i).Cells("總雙數").Value : End If
354
+        For i As Integer = 0 To CXL數_dgv.Rows.Count - 1
355
+            If CXL數_dgv.RowCount = 0 Then : 加總(13) += 0 : Else : 加總(13) += CXL數_dgv.Rows(i).Cells("樣品單數").Value : End If
356
+            If CXL數_dgv.RowCount = 0 Then : 加總(14) += 0 : Else : 加總(14) += CXL數_dgv.Rows(i).Cells("總雙數").Value : End If
329
         Next i
357
         Next i
330
-        For i As Integer = 0 To DataGridView7.Rows.Count - 1
331
-            If DataGridView7.RowCount = 0 Then : 加總(15) += 0 : Else : 加總(15) += DataGridView7.Rows(i).Cells("樣品單數").Value : End If
332
-            If DataGridView7.RowCount = 0 Then : 加總(16) += 0 : Else : 加總(16) += DataGridView7.Rows(i).Cells("總雙數").Value : End If
358
+        For i As Integer = 0 To 量產樣品控制表已出貨數_dgv.Rows.Count - 1
359
+            If 量產樣品控制表已出貨數_dgv.RowCount = 0 Then : 加總(15) += 0 : Else : 加總(15) += 量產樣品控制表已出貨數_dgv.Rows(i).Cells("樣品單數").Value : End If
360
+            If 量產樣品控制表已出貨數_dgv.RowCount = 0 Then : 加總(16) += 0 : Else : 加總(16) += 量產樣品控制表已出貨數_dgv.Rows(i).Cells("總雙數").Value : End If
333
         Next i
361
         Next i
334
-        For i As Integer = 0 To DataGridView8.Rows.Count - 1
335
-            If DataGridView8.Rows(i).Cells("工廠").Value = "NJ" Then
336
-                If DataGridView8.RowCount = 0 Then : 加總(17) += 0 : Else : 加總(17) += DataGridView8.Rows(i).Cells("訂單數量").Value : End If
337
-                If DataGridView8.RowCount = 0 Then : 加總(18) += 0 : Else : 加總(18) += DataGridView8.Rows(i).Cells("訂單總數").Value : End If
338
-            ElseIf DataGridView8.Rows(i).Cells("工廠").Value = "JH" Then
339
-                If DataGridView8.RowCount = 0 Then : 加總(19) += 0 : Else : 加總(19) += DataGridView8.Rows(i).Cells("訂單數量").Value : End If
340
-                If DataGridView8.RowCount = 0 Then : 加總(20) += 0 : Else : 加總(20) += DataGridView8.Rows(i).Cells("訂單總數").Value : End If
341
-            ElseIf DataGridView8.Rows(i).Cells("工廠").Value = "SK" Then
342
-                If DataGridView8.RowCount = 0 Then : 加總(21) += 0 : Else : 加總(21) += DataGridView8.Rows(i).Cells("訂單數量").Value : End If
343
-                If DataGridView8.RowCount = 0 Then : 加總(22) += 0 : Else : 加總(22) += DataGridView8.Rows(i).Cells("訂單總數").Value : End If
362
+        For i As Integer = 0 To 訂單控制表未出貨數_dgv.Rows.Count - 1
363
+            If 訂單控制表未出貨數_dgv.Rows(i).Cells("工廠").Value = "NJ" Then
364
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(17) += 0 : Else : 加總(17) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
365
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(18) += 0 : Else : 加總(18) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
366
+            ElseIf 訂單控制表未出貨數_dgv.Rows(i).Cells("工廠").Value = "JH" Then
367
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(19) += 0 : Else : 加總(19) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
368
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(20) += 0 : Else : 加總(20) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
369
+            ElseIf 訂單控制表未出貨數_dgv.Rows(i).Cells("工廠").Value = "SK" Then
370
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(21) += 0 : Else : 加總(21) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
371
+                If 訂單控制表未出貨數_dgv.RowCount = 0 Then : 加總(22) += 0 : Else : 加總(22) += 訂單控制表未出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
344
             End If
372
             End If
345
         Next i
373
         Next i
346
-        For i As Integer = 0 To DataGridView9.Rows.Count - 1
347
-            If DataGridView9.Rows(i).Cells("工廠").Value = "NJ" Then
348
-                If DataGridView9.RowCount = 0 Then : 加總(23) += 0 : Else : 加總(23) += DataGridView9.Rows(i).Cells("訂單數量").Value : End If
349
-                If DataGridView9.RowCount = 0 Then : 加總(24) += 0 : Else : 加總(24) += DataGridView9.Rows(i).Cells("訂單總數").Value : End If
350
-            ElseIf DataGridView9.Rows(i).Cells("工廠").Value = "JH" Then
351
-                If DataGridView9.RowCount = 0 Then : 加總(25) += 0 : Else : 加總(25) += DataGridView9.Rows(i).Cells("訂單數量").Value : End If
352
-                If DataGridView9.RowCount = 0 Then : 加總(26) += 0 : Else : 加總(26) += DataGridView9.Rows(i).Cells("訂單總數").Value : End If
353
-            ElseIf DataGridView9.Rows(i).Cells("工廠").Value = "SK" Then
354
-                If DataGridView9.RowCount = 0 Then : 加總(27) += 0 : Else : 加總(27) += DataGridView9.Rows(i).Cells("訂單數量").Value : End If
355
-                If DataGridView9.RowCount = 0 Then : 加總(28) += 0 : Else : 加總(28) += DataGridView9.Rows(i).Cells("訂單總數").Value : End If
374
+        For i As Integer = 0 To 訂單控制表已出貨數_dgv.Rows.Count - 1
375
+            If 訂單控制表已出貨數_dgv.Rows(i).Cells("工廠").Value = "NJ" Then
376
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(23) += 0 : Else : 加總(23) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
377
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(24) += 0 : Else : 加總(24) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
378
+            ElseIf 訂單控制表已出貨數_dgv.Rows(i).Cells("工廠").Value = "JH" Then
379
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(25) += 0 : Else : 加總(25) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
380
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(26) += 0 : Else : 加總(26) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
381
+            ElseIf 訂單控制表已出貨數_dgv.Rows(i).Cells("工廠").Value = "SK" Then
382
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(27) += 0 : Else : 加總(27) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單數量").Value : End If
383
+                If 訂單控制表已出貨數_dgv.RowCount = 0 Then : 加總(28) += 0 : Else : 加總(28) += 訂單控制表已出貨數_dgv.Rows(i).Cells("訂單總數").Value : End If
356
             End If
384
             End If
357
         Next i
385
         Next i
358
-        For i As Integer = 0 To DataGridView10.Rows.Count - 1
359
-            If DataGridView10.Rows(i).Cells("工廠").Value = "NJ" Then
360
-                If DataGridView10.RowCount = 0 Then : 加總(29) += 0 : Else : 加總(29) += DataGridView10.Rows(i).Cells("訂單數量").Value : End If
361
-                If DataGridView10.RowCount = 0 Then : 加總(30) += 0 : Else : 加總(30) += DataGridView10.Rows(i).Cells("訂單總數").Value : End If
362
-            ElseIf DataGridView10.Rows(i).Cells("工廠").Value = "JH" Then
363
-                If DataGridView10.RowCount = 0 Then : 加總(31) += 0 : Else : 加總(31) += DataGridView10.Rows(i).Cells("訂單數量").Value : End If
364
-                If DataGridView10.RowCount = 0 Then : 加總(32) += 0 : Else : 加總(32) += DataGridView10.Rows(i).Cells("訂單總數").Value : End If
365
-            ElseIf DataGridView10.Rows(i).Cells("工廠").Value = "SK" Then
366
-                If DataGridView10.RowCount = 0 Then : 加總(33) += 0 : Else : 加總(33) += DataGridView10.Rows(i).Cells("訂單數量").Value : End If
367
-                If DataGridView10.RowCount = 0 Then : 加總(34) += 0 : Else : 加總(34) += DataGridView10.Rows(i).Cells("訂單總數").Value : End If
386
+        For i As Integer = 0 To 訂單控制表CXL數_dgv.Rows.Count - 1
387
+            If 訂單控制表CXL數_dgv.Rows(i).Cells("工廠").Value = "NJ" Then
388
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(29) += 0 : Else : 加總(29) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單數量").Value : End If
389
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(30) += 0 : Else : 加總(30) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單總數").Value : End If
390
+            ElseIf 訂單控制表CXL數_dgv.Rows(i).Cells("工廠").Value = "JH" Then
391
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(31) += 0 : Else : 加總(31) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單數量").Value : End If
392
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(32) += 0 : Else : 加總(32) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單總數").Value : End If
393
+            ElseIf 訂單控制表CXL數_dgv.Rows(i).Cells("工廠").Value = "SK" Then
394
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(33) += 0 : Else : 加總(33) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單數量").Value : End If
395
+                If 訂單控制表CXL數_dgv.RowCount = 0 Then : 加總(34) += 0 : Else : 加總(34) += 訂單控制表CXL數_dgv.Rows(i).Cells("訂單總數").Value : End If
368
             End If
396
             End If
369
         Next i
397
         Next i
370
-        TextBox1.Text = Format(Val(加總(0)), "#,##0") : TextBox2.Text = Format(Val(加總(1)), "#,##0") : TextBox38.Text = Format(Val(加總(2)), "#,##0") : TextBox3.Text = Format(Val(加總(3)), "#,##0")
371
-        TextBox39.Text = Format(Val(加總(4)), "#,##0") : TextBox4.Text = Format(Val(加總(5)), "#,##0") : TextBox40.Text = Format(Val(加總(6)), "#,##0") : TextBox5.Text = Format(Val(加總(7)), "#,##0")
372
-        TextBox41.Text = Format(Val(加總(8)), "#,##0") : TextBox6.Text = Format(Val(加總(9)), "#,##0") : TextBox42.Text = Format(Val(加總(10)), "#,##0") : TextBox7.Text = DataGridView4.Rows.Count
373
-        TextBox8.Text = Format(Val(加總(11)), "#,##0") : TextBox9.Text = Format(Val(加總(12)), "#,##0") : TextBox10.Text = Format(Val(加總(15)), "#,##0") : TextBox11.Text = Format(Val(加總(16)), "#,##0")
374
-        TextBox12.Text = Format(Val(加總(13)), "#,##0") : TextBox13.Text = Format(Val(加總(14)), "#,##0")
398
+        圖片資料庫_tb.Text = Format(Val(加總(0)), "#,##0") : 開發ILR中文樣品單數量_tb.Text = Format(Val(加總(1)), "#,##0")
399
+        開發ILR樣品單顏色總數_tb.Text = Format(Val(加總(2)), "#,##0") : 開發FLR中文樣品單數量_tb.Text = Format(Val(加總(3)), "#,##0")
400
+        開發FLR樣品單顏色總數_tb.Text = Format(Val(加總(4)), "#,##0") : 開發SMS中文樣品單數量_tb.Text = Format(Val(加總(5)), "#,##0")
401
+        開發SMS樣品單顏色總數_tb.Text = Format(Val(加總(6)), "#,##0") : 開發SMU中文樣品單數量_tb.Text = Format(Val(加總(7)), "#,##0")
402
+        開發SMU樣品單顏色總數_tb.Text = Format(Val(加總(8)), "#,##0") : 確認CFM中文樣品單數量_tb.Text = Format(Val(加總(9)), "#,##0")
403
+        確認CFM樣品單顏色總數_tb.Text = Format(Val(加總(10)), "#,##0") : 確認通知書單量_tb.Text = 確認通知書_dgv.Rows.Count
404
+        量產樣品未出貨樣品單數_tb.Text = Format(Val(加總(11)), "#,##0") : 量產樣品未出貨總雙數_tb.Text = Format(Val(加總(12)), "#,##0")
405
+        量產樣品已出貨樣品單數_tb.Text = Format(Val(加總(15)), "#,##0") : 量產樣品已出貨總雙數_tb.Text = Format(Val(加總(16)), "#,##0")
406
+        量產樣品CXL樣品單數_tb.Text = Format(Val(加總(13)), "#,##0") : 量產樣品CXL總雙數_tb.Text = Format(Val(加總(14)), "#,##0")
375
 
407
 
376
-        NJ未出貨訂單數_tb.Text = Format(Val(加總(17)), "#,##0") : NJ未出貨總雙數_tb.Text = Format(Val(加總(18)), "#,##0") : JH未出貨訂單數_tb.Text = Format(Val(加總(19)), "#,##0") : JH未出貨總雙數_tb.Text = Format(Val(加總(20)), "#,##0")
408
+        NJ未出貨訂單數_tb.Text = Format(Val(加總(17)), "#,##0") : NJ未出貨總雙數_tb.Text = Format(Val(加總(18)), "#,##0")
409
+        JH未出貨訂單數_tb.Text = Format(Val(加總(19)), "#,##0") : JH未出貨總雙數_tb.Text = Format(Val(加總(20)), "#,##0")
377
         SK未出貨訂單數_tb.Text = Format(Val(加總(21)), "#,##0") : SK未出貨總雙數_tb.Text = Format(Val(加總(22)), "#,##0")
410
         SK未出貨訂單數_tb.Text = Format(Val(加總(21)), "#,##0") : SK未出貨總雙數_tb.Text = Format(Val(加總(22)), "#,##0")
378
         未出貨訂單數_tb.Text = Format(Val(加總(17) + 加總(19) + 加總(21)), "#,##0")
411
         未出貨訂單數_tb.Text = Format(Val(加總(17) + 加總(19) + 加總(21)), "#,##0")
379
         未出貨總雙數_tb.Text = Format(Val(加總(18) + 加總(20) + 加總(22)), "#,##0")
412
         未出貨總雙數_tb.Text = Format(Val(加總(18) + 加總(20) + 加總(22)), "#,##0")
380
 
413
 
381
-        NJ已出貨訂單數_tb.Text = Format(Val(加總(23)), "#,##0") : NJ已出貨總雙數_tb.Text = Format(Val(加總(24)), "#,##0") : JH已出貨訂單數_tb.Text = Format(Val(加總(25)), "#,##0") : JH已出貨總雙數_tb.Text = Format(Val(加總(26)), "#,##0")
414
+        NJ已出貨訂單數_tb.Text = Format(Val(加總(23)), "#,##0") : NJ已出貨總雙數_tb.Text = Format(Val(加總(24)), "#,##0")
415
+        JH已出貨訂單數_tb.Text = Format(Val(加總(25)), "#,##0") : JH已出貨總雙數_tb.Text = Format(Val(加總(26)), "#,##0")
382
         SK已出貨訂單數_tb.Text = Format(Val(加總(27)), "#,##0") : SK已出貨總雙數_tb.Text = Format(Val(加總(28)), "#,##0")
416
         SK已出貨訂單數_tb.Text = Format(Val(加總(27)), "#,##0") : SK已出貨總雙數_tb.Text = Format(Val(加總(28)), "#,##0")
383
         已出貨訂單數_tb.Text = Format(Val(加總(23) + 加總(25) + 加總(27)), "#,##0")
417
         已出貨訂單數_tb.Text = Format(Val(加總(23) + 加總(25) + 加總(27)), "#,##0")
384
         已出貨總雙數_tb.Text = Format(Val(加總(24) + 加總(26) + 加總(28)), "#,##0")
418
         已出貨總雙數_tb.Text = Format(Val(加總(24) + 加總(26) + 加總(28)), "#,##0")
385
 
419
 
386
-        NJCXL訂單數_tb.Text = Format(Val(加總(29)), "#,##0") : NJCXL總雙數_tb.Text = Format(Val(加總(30)), "#,##0") : JHCXL訂單數_tb.Text = Format(Val(加總(31)), "#,##0") : JHCXL總雙數_tb.Text = Format(Val(加總(32)), "#,##0")
420
+        NJCXL訂單數_tb.Text = Format(Val(加總(29)), "#,##0") : NJCXL總雙數_tb.Text = Format(Val(加總(30)), "#,##0")
421
+        JHCXL訂單數_tb.Text = Format(Val(加總(31)), "#,##0") : JHCXL總雙數_tb.Text = Format(Val(加總(32)), "#,##0")
387
         SKCXL訂單數_tb.Text = Format(Val(加總(33)), "#,##0") : SKCXL總雙數_tb.Text = Format(Val(加總(34)), "#,##0")
422
         SKCXL訂單數_tb.Text = Format(Val(加總(33)), "#,##0") : SKCXL總雙數_tb.Text = Format(Val(加總(34)), "#,##0")
388
         CXL訂單數_tb.Text = Format(Val(加總(29) + 加總(31) + 加總(33)), "#,##0")
423
         CXL訂單數_tb.Text = Format(Val(加總(29) + 加總(31) + 加總(33)), "#,##0")
389
         CXL總雙數_tb.Text = Format(Val(加總(30) + 加總(32) + 加總(34)), "#,##0")
424
         CXL總雙數_tb.Text = Format(Val(加總(30) + 加總(32) + 加總(34)), "#,##0")
394
         ComboBox2下拉表單資料載入() : 季度_cb.SelectedIndex = 0
429
         ComboBox2下拉表單資料載入() : 季度_cb.SelectedIndex = 0
395
         年度_cb.Text = Year(Today)
430
         年度_cb.Text = Year(Today)
396
     End Sub
431
     End Sub
397
-    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
432
+    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles 樣品資料庫管理_bt.Click
398
         樣品資料庫管理.Close() : 樣品資料庫管理.Show()
433
         樣品資料庫管理.Close() : 樣品資料庫管理.Show()
399
     End Sub
434
     End Sub
400
     Private  Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 季度_cb.SelectedIndexChanged
435
     Private  Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 季度_cb.SelectedIndexChanged
422
         End If
457
         End If
423
         查詢()
458
         查詢()
424
     End Sub
459
     End Sub
425
-    Private  Sub DataGridView8_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView8.RowPostPaint
460
+    Private  Sub DataGridView8_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 訂單控制表未出貨數_dgv.RowPostPaint
426
         Dim linePen As New Pen(Color.Blue, 2)
461
         Dim linePen As New Pen(Color.Blue, 2)
427
-        If e.RowIndex = DataGridView8.Rows.Count - 1 Then
462
+        If e.RowIndex = 訂單控制表未出貨數_dgv.Rows.Count - 1 Then
428
             Exit Sub
463
             Exit Sub
429
         Else
464
         Else
430
-            If DataGridView8(2, e.RowIndex).Value.ToString <> DataGridView8(2, e.RowIndex + 1).Value.ToString Then
431
-                Dim startX As Integer = IIf(DataGridView8.RowHeadersVisible, DataGridView8.RowHeadersWidth, 0)
465
+            If 訂單控制表未出貨數_dgv(2, e.RowIndex).Value.ToString <> 訂單控制表未出貨數_dgv(2, e.RowIndex + 1).Value.ToString Then
466
+                Dim startX As Integer = IIf(訂單控制表未出貨數_dgv.RowHeadersVisible, 訂單控制表未出貨數_dgv.RowHeadersWidth, 0)
432
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
467
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
433
-                Dim endX As Integer = startX + DataGridView8.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView8.HorizontalScrollingOffset
468
+                Dim endX As Integer = startX + 訂單控制表未出貨數_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 訂單控制表未出貨數_dgv.HorizontalScrollingOffset
434
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
469
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
435
                 Exit Sub
470
                 Exit Sub
436
             End If
471
             End If
437
         End If
472
         End If
438
     End Sub
473
     End Sub
439
-    Private  Sub DataGridView9_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView9.RowPostPaint
474
+    Private  Sub DataGridView9_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 訂單控制表已出貨數_dgv.RowPostPaint
440
         Dim linePen As New Pen(Color.Blue, 2)
475
         Dim linePen As New Pen(Color.Blue, 2)
441
-        If e.RowIndex = DataGridView9.Rows.Count - 1 Then
476
+        If e.RowIndex = 訂單控制表已出貨數_dgv.Rows.Count - 1 Then
442
             Exit Sub
477
             Exit Sub
443
         Else
478
         Else
444
-            If DataGridView9(2, e.RowIndex).Value.ToString <> DataGridView9(2, e.RowIndex + 1).Value.ToString Then
445
-                Dim startX As Integer = IIf(DataGridView9.RowHeadersVisible, DataGridView9.RowHeadersWidth, 0)
479
+            If 訂單控制表已出貨數_dgv(2, e.RowIndex).Value.ToString <> 訂單控制表已出貨數_dgv(2, e.RowIndex + 1).Value.ToString Then
480
+                Dim startX As Integer = IIf(訂單控制表已出貨數_dgv.RowHeadersVisible, 訂單控制表已出貨數_dgv.RowHeadersWidth, 0)
446
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
481
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
447
-                Dim endX As Integer = startX + DataGridView9.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView9.HorizontalScrollingOffset
482
+                Dim endX As Integer = startX + 訂單控制表已出貨數_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 訂單控制表已出貨數_dgv.HorizontalScrollingOffset
448
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
483
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
449
                 Exit Sub
484
                 Exit Sub
450
             End If
485
             End If
451
         End If
486
         End If
452
     End Sub
487
     End Sub
453
-    Private  Sub DataGridView10_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView10.RowPostPaint
488
+    Private  Sub DataGridView10_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 訂單控制表CXL數_dgv.RowPostPaint
454
         Dim linePen As New Pen(Color.Blue, 2)
489
         Dim linePen As New Pen(Color.Blue, 2)
455
-        If e.RowIndex = DataGridView10.Rows.Count - 1 Then
490
+        If e.RowIndex = 訂單控制表CXL數_dgv.Rows.Count - 1 Then
456
             Exit Sub
491
             Exit Sub
457
         Else
492
         Else
458
-            If DataGridView10(2, e.RowIndex).Value.ToString <> DataGridView10(2, e.RowIndex + 1).Value.ToString Then
459
-                Dim startX As Integer = IIf(DataGridView10.RowHeadersVisible, DataGridView10.RowHeadersWidth, 0)
493
+            If 訂單控制表CXL數_dgv(2, e.RowIndex).Value.ToString <> 訂單控制表CXL數_dgv(2, e.RowIndex + 1).Value.ToString Then
494
+                Dim startX As Integer = IIf(訂單控制表CXL數_dgv.RowHeadersVisible, 訂單控制表CXL數_dgv.RowHeadersWidth, 0)
460
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
495
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
461
-                Dim endX As Integer = startX + DataGridView10.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView10.HorizontalScrollingOffset
496
+                Dim endX As Integer = startX + 訂單控制表CXL數_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 訂單控制表CXL數_dgv.HorizontalScrollingOffset
462
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
497
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
463
                 Exit Sub
498
                 Exit Sub
464
             End If
499
             End If

+ 160
- 160
TENDEN-MES-SYS/彙總報表管理/訂單分析報表七.Designer.vb 查看文件

22
     '請勿使用程式碼編輯器進行修改。
22
     '請勿使用程式碼編輯器進行修改。
23
     <System.Diagnostics.DebuggerStepThrough()> _
23
     <System.Diagnostics.DebuggerStepThrough()> _
24
     Private Sub InitializeComponent()
24
     Private Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
-        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
-        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
-        Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
-        Me.Button2 = New System.Windows.Forms.Button()
32
-        Me.Button1 = New System.Windows.Forms.Button()
25
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
+        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28
+        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
+        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
+        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
+        Me.當月_bt = New System.Windows.Forms.Button()
32
+        Me.當日_bt = New System.Windows.Forms.Button()
33
         Me.Label4 = New System.Windows.Forms.Label()
33
         Me.Label4 = New System.Windows.Forms.Label()
34
-        Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker()
35
-        Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker()
36
-        Me.DataGridView1 = New System.Windows.Forms.DataGridView()
34
+        Me.日期1_dtp = New System.Windows.Forms.DateTimePicker()
35
+        Me.日期_dtp = New System.Windows.Forms.DateTimePicker()
36
+        Me.每種形體有賺頭前50名_dgv = New System.Windows.Forms.DataGridView()
37
         Me.Label1 = New System.Windows.Forms.Label()
37
         Me.Label1 = New System.Windows.Forms.Label()
38
         Me.Label2 = New System.Windows.Forms.Label()
38
         Me.Label2 = New System.Windows.Forms.Label()
39
-        Me.DataGridView2 = New System.Windows.Forms.DataGridView()
39
+        Me.每種形體做爽的倒數50名_dgv = New System.Windows.Forms.DataGridView()
40
         Me.Label3 = New System.Windows.Forms.Label()
40
         Me.Label3 = New System.Windows.Forms.Label()
41
-        Me.DataGridView3 = New System.Windows.Forms.DataGridView()
41
+        Me.每種形體開發來玩的倒數50名_dgv = New System.Windows.Forms.DataGridView()
42
         Me.Label5 = New System.Windows.Forms.Label()
42
         Me.Label5 = New System.Windows.Forms.Label()
43
-        Me.DataGridView4 = New System.Windows.Forms.DataGridView()
43
+        Me.每種形體數量大前50名_dgv = New System.Windows.Forms.DataGridView()
44
         Me.Label6 = New System.Windows.Forms.Label()
44
         Me.Label6 = New System.Windows.Forms.Label()
45
-        Me.DataGridView5 = New System.Windows.Forms.DataGridView()
45
+        Me.時間區間內倒數50名聊尾仔_dgv = New System.Windows.Forms.DataGridView()
46
         Me.Label7 = New System.Windows.Forms.Label()
46
         Me.Label7 = New System.Windows.Forms.Label()
47
-        Me.DataGridView6 = New System.Windows.Forms.DataGridView()
48
-        Me.Button3 = New System.Windows.Forms.Button()
49
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
50
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
51
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit()
52
-        CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).BeginInit()
53
-        CType(Me.DataGridView5, System.ComponentModel.ISupportInitialize).BeginInit()
54
-        CType(Me.DataGridView6, System.ComponentModel.ISupportInitialize).BeginInit()
47
+        Me.時間區間內有前途_dgv = New System.Windows.Forms.DataGridView()
48
+        Me.列印_bt = New System.Windows.Forms.Button()
49
+        CType(Me.每種形體有賺頭前50名_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
50
+        CType(Me.每種形體做爽的倒數50名_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
51
+        CType(Me.每種形體開發來玩的倒數50名_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
52
+        CType(Me.每種形體數量大前50名_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
53
+        CType(Me.時間區間內倒數50名聊尾仔_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
54
+        CType(Me.時間區間內有前途_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
55
         Me.SuspendLayout()
55
         Me.SuspendLayout()
56
         '
56
         '
57
-        'Button2
57
+        '當月_bt
58
         '
58
         '
59
-        Me.Button2.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
60
-        Me.Button2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
61
-        Me.Button2.Location = New System.Drawing.Point(370, 6)
62
-        Me.Button2.Name = "Button2"
63
-        Me.Button2.Size = New System.Drawing.Size(117, 24)
64
-        Me.Button2.TabIndex = 1093
65
-        Me.Button2.Text = "當月"
66
-        Me.Button2.UseVisualStyleBackColor = True
59
+        Me.當月_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
60
+        Me.當月_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
61
+        Me.當月_bt.Location = New System.Drawing.Point(370, 6)
62
+        Me.當月_bt.Name = "當月_bt"
63
+        Me.當月_bt.Size = New System.Drawing.Size(117, 24)
64
+        Me.當月_bt.TabIndex = 1093
65
+        Me.當月_bt.Text = "當月"
66
+        Me.當月_bt.UseVisualStyleBackColor = True
67
         '
67
         '
68
-        'Button1
68
+        '當日_bt
69
         '
69
         '
70
-        Me.Button1.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
71
-        Me.Button1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
72
-        Me.Button1.Location = New System.Drawing.Point(249, 6)
73
-        Me.Button1.Name = "Button1"
74
-        Me.Button1.Size = New System.Drawing.Size(117, 24)
75
-        Me.Button1.TabIndex = 1092
76
-        Me.Button1.Text = "當日"
77
-        Me.Button1.UseVisualStyleBackColor = True
70
+        Me.當日_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
71
+        Me.當日_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
72
+        Me.當日_bt.Location = New System.Drawing.Point(249, 6)
73
+        Me.當日_bt.Name = "當日_bt"
74
+        Me.當日_bt.Size = New System.Drawing.Size(117, 24)
75
+        Me.當日_bt.TabIndex = 1092
76
+        Me.當日_bt.Text = "當日"
77
+        Me.當日_bt.UseVisualStyleBackColor = True
78
         '
78
         '
79
         'Label4
79
         'Label4
80
         '
80
         '
85
         Me.Label4.TabIndex = 1091
85
         Me.Label4.TabIndex = 1091
86
         Me.Label4.Text = "到"
86
         Me.Label4.Text = "到"
87
         '
87
         '
88
-        'DateTimePicker2
88
+        '日期1_dtp
89
         '
89
         '
90
-        Me.DateTimePicker2.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right
91
-        Me.DateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
92
-        Me.DateTimePicker2.Location = New System.Drawing.Point(138, 6)
93
-        Me.DateTimePicker2.Name = "DateTimePicker2"
94
-        Me.DateTimePicker2.Size = New System.Drawing.Size(105, 23)
95
-        Me.DateTimePicker2.TabIndex = 1090
90
+        Me.日期1_dtp.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right
91
+        Me.日期1_dtp.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
92
+        Me.日期1_dtp.Location = New System.Drawing.Point(138, 6)
93
+        Me.日期1_dtp.Name = "日期1_dtp"
94
+        Me.日期1_dtp.Size = New System.Drawing.Size(105, 23)
95
+        Me.日期1_dtp.TabIndex = 1090
96
         '
96
         '
97
-        'DateTimePicker1
97
+        '日期_dtp
98
         '
98
         '
99
-        Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
100
-        Me.DateTimePicker1.Location = New System.Drawing.Point(6, 6)
101
-        Me.DateTimePicker1.Name = "DateTimePicker1"
102
-        Me.DateTimePicker1.Size = New System.Drawing.Size(105, 23)
103
-        Me.DateTimePicker1.TabIndex = 1089
99
+        Me.日期_dtp.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
100
+        Me.日期_dtp.Location = New System.Drawing.Point(6, 6)
101
+        Me.日期_dtp.Name = "日期_dtp"
102
+        Me.日期_dtp.Size = New System.Drawing.Size(105, 23)
103
+        Me.日期_dtp.TabIndex = 1089
104
         '
104
         '
105
-        'DataGridView1
105
+        '每種形體有賺頭前50名_dgv
106
         '
106
         '
107
-        DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
108
-        Me.DataGridView1.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
109
-        Me.DataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
110
-        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
111
-        Me.DataGridView1.Location = New System.Drawing.Point(8, 67)
112
-        Me.DataGridView1.Name = "DataGridView1"
113
-        Me.DataGridView1.RowHeadersWidth = 5
114
-        Me.DataGridView1.RowTemplate.Height = 24
115
-        Me.DataGridView1.Size = New System.Drawing.Size(628, 435)
116
-        Me.DataGridView1.TabIndex = 1094
107
+        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
108
+        Me.每種形體有賺頭前50名_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
109
+        Me.每種形體有賺頭前50名_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
110
+        Me.每種形體有賺頭前50名_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
111
+        Me.每種形體有賺頭前50名_dgv.Location = New System.Drawing.Point(8, 67)
112
+        Me.每種形體有賺頭前50名_dgv.Name = "每種形體有賺頭前50名_dgv"
113
+        Me.每種形體有賺頭前50名_dgv.RowHeadersWidth = 5
114
+        Me.每種形體有賺頭前50名_dgv.RowTemplate.Height = 24
115
+        Me.每種形體有賺頭前50名_dgv.Size = New System.Drawing.Size(628, 435)
116
+        Me.每種形體有賺頭前50名_dgv.TabIndex = 1094
117
         '
117
         '
118
         'Label1
118
         'Label1
119
         '
119
         '
137
         Me.Label2.TabIndex = 1097
137
         Me.Label2.TabIndex = 1097
138
         Me.Label2.Text = "每種形體,加權平均利潤, (做爽的) 倒數 50 名"
138
         Me.Label2.Text = "每種形體,加權平均利潤, (做爽的) 倒數 50 名"
139
         '
139
         '
140
-        'DataGridView2
140
+        '每種形體做爽的倒數50名_dgv
141
         '
141
         '
142
-        DataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
143
-        Me.DataGridView2.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle8
144
-        Me.DataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
145
-        Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
146
-        Me.DataGridView2.Location = New System.Drawing.Point(8, 540)
147
-        Me.DataGridView2.Name = "DataGridView2"
148
-        Me.DataGridView2.RowHeadersWidth = 5
149
-        Me.DataGridView2.RowTemplate.Height = 24
150
-        Me.DataGridView2.Size = New System.Drawing.Size(628, 435)
151
-        Me.DataGridView2.TabIndex = 1096
142
+        DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
143
+        Me.每種形體做爽的倒數50名_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
144
+        Me.每種形體做爽的倒數50名_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
145
+        Me.每種形體做爽的倒數50名_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
146
+        Me.每種形體做爽的倒數50名_dgv.Location = New System.Drawing.Point(8, 540)
147
+        Me.每種形體做爽的倒數50名_dgv.Name = "每種形體做爽的倒數50名_dgv"
148
+        Me.每種形體做爽的倒數50名_dgv.RowHeadersWidth = 5
149
+        Me.每種形體做爽的倒數50名_dgv.RowTemplate.Height = 24
150
+        Me.每種形體做爽的倒數50名_dgv.Size = New System.Drawing.Size(628, 435)
151
+        Me.每種形體做爽的倒數50名_dgv.TabIndex = 1096
152
         '
152
         '
153
         'Label3
153
         'Label3
154
         '
154
         '
161
         Me.Label3.TabIndex = 1101
161
         Me.Label3.TabIndex = 1101
162
         Me.Label3.Text = "每種形體,訂單加總數, (開發來玩的) 倒數 50 名"
162
         Me.Label3.Text = "每種形體,訂單加總數, (開發來玩的) 倒數 50 名"
163
         '
163
         '
164
-        'DataGridView3
164
+        '每種形體開發來玩的倒數50名_dgv
165
         '
165
         '
166
-        DataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
167
-        Me.DataGridView3.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle9
168
-        Me.DataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
169
-        Me.DataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
170
-        Me.DataGridView3.Location = New System.Drawing.Point(642, 540)
171
-        Me.DataGridView3.Name = "DataGridView3"
172
-        Me.DataGridView3.RowHeadersWidth = 5
173
-        Me.DataGridView3.RowTemplate.Height = 24
174
-        Me.DataGridView3.Size = New System.Drawing.Size(628, 435)
175
-        Me.DataGridView3.TabIndex = 1100
166
+        DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
167
+        Me.每種形體開發來玩的倒數50名_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
168
+        Me.每種形體開發來玩的倒數50名_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
169
+        Me.每種形體開發來玩的倒數50名_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
170
+        Me.每種形體開發來玩的倒數50名_dgv.Location = New System.Drawing.Point(642, 540)
171
+        Me.每種形體開發來玩的倒數50名_dgv.Name = "每種形體開發來玩的倒數50名_dgv"
172
+        Me.每種形體開發來玩的倒數50名_dgv.RowHeadersWidth = 5
173
+        Me.每種形體開發來玩的倒數50名_dgv.RowTemplate.Height = 24
174
+        Me.每種形體開發來玩的倒數50名_dgv.Size = New System.Drawing.Size(628, 435)
175
+        Me.每種形體開發來玩的倒數50名_dgv.TabIndex = 1100
176
         '
176
         '
177
         'Label5
177
         'Label5
178
         '
178
         '
185
         Me.Label5.TabIndex = 1099
185
         Me.Label5.TabIndex = 1099
186
         Me.Label5.Text = "每種形體,訂單加總數, (數量大) 前 50 名"
186
         Me.Label5.Text = "每種形體,訂單加總數, (數量大) 前 50 名"
187
         '
187
         '
188
-        'DataGridView4
188
+        '每種形體數量大前50名_dgv
189
         '
189
         '
190
-        DataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
191
-        Me.DataGridView4.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle10
192
-        Me.DataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
193
-        Me.DataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
194
-        Me.DataGridView4.Location = New System.Drawing.Point(642, 67)
195
-        Me.DataGridView4.Name = "DataGridView4"
196
-        Me.DataGridView4.RowHeadersWidth = 5
197
-        Me.DataGridView4.RowTemplate.Height = 24
198
-        Me.DataGridView4.Size = New System.Drawing.Size(628, 435)
199
-        Me.DataGridView4.TabIndex = 1098
190
+        DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
191
+        Me.每種形體數量大前50名_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
192
+        Me.每種形體數量大前50名_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
193
+        Me.每種形體數量大前50名_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
194
+        Me.每種形體數量大前50名_dgv.Location = New System.Drawing.Point(642, 67)
195
+        Me.每種形體數量大前50名_dgv.Name = "每種形體數量大前50名_dgv"
196
+        Me.每種形體數量大前50名_dgv.RowHeadersWidth = 5
197
+        Me.每種形體數量大前50名_dgv.RowTemplate.Height = 24
198
+        Me.每種形體數量大前50名_dgv.Size = New System.Drawing.Size(628, 435)
199
+        Me.每種形體數量大前50名_dgv.TabIndex = 1098
200
         '
200
         '
201
         'Label6
201
         'Label6
202
         '
202
         '
209
         Me.Label6.TabIndex = 1105
209
         Me.Label6.TabIndex = 1105
210
         Me.Label6.Text = "時間區間內,每總形體,創造利潤,倒數 50 名 (聊尾仔)" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
210
         Me.Label6.Text = "時間區間內,每總形體,創造利潤,倒數 50 名 (聊尾仔)" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
211
         '
211
         '
212
-        'DataGridView5
212
+        '時間區間內倒數50名聊尾仔_dgv
213
         '
213
         '
214
-        DataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
215
-        Me.DataGridView5.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle11
216
-        Me.DataGridView5.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
217
-        Me.DataGridView5.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
218
-        Me.DataGridView5.Location = New System.Drawing.Point(1276, 540)
219
-        Me.DataGridView5.Name = "DataGridView5"
220
-        Me.DataGridView5.RowHeadersWidth = 5
221
-        Me.DataGridView5.RowTemplate.Height = 24
222
-        Me.DataGridView5.Size = New System.Drawing.Size(628, 435)
223
-        Me.DataGridView5.TabIndex = 1104
214
+        DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
215
+        Me.時間區間內倒數50名聊尾仔_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
216
+        Me.時間區間內倒數50名聊尾仔_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
217
+        Me.時間區間內倒數50名聊尾仔_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
218
+        Me.時間區間內倒數50名聊尾仔_dgv.Location = New System.Drawing.Point(1276, 540)
219
+        Me.時間區間內倒數50名聊尾仔_dgv.Name = "時間區間內倒數50名聊尾仔_dgv"
220
+        Me.時間區間內倒數50名聊尾仔_dgv.RowHeadersWidth = 5
221
+        Me.時間區間內倒數50名聊尾仔_dgv.RowTemplate.Height = 24
222
+        Me.時間區間內倒數50名聊尾仔_dgv.Size = New System.Drawing.Size(628, 435)
223
+        Me.時間區間內倒數50名聊尾仔_dgv.TabIndex = 1104
224
         '
224
         '
225
         'Label7
225
         'Label7
226
         '
226
         '
233
         Me.Label7.TabIndex = 1103
233
         Me.Label7.TabIndex = 1103
234
         Me.Label7.Text = "時間區間內,每總形體,創造利潤,前 50 名  (有前途)"
234
         Me.Label7.Text = "時間區間內,每總形體,創造利潤,前 50 名  (有前途)"
235
         '
235
         '
236
-        'DataGridView6
237
-        '
238
-        DataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
239
-        Me.DataGridView6.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle12
240
-        Me.DataGridView6.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
241
-        Me.DataGridView6.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
242
-        Me.DataGridView6.Location = New System.Drawing.Point(1276, 67)
243
-        Me.DataGridView6.Name = "DataGridView6"
244
-        Me.DataGridView6.RowHeadersWidth = 5
245
-        Me.DataGridView6.RowTemplate.Height = 24
246
-        Me.DataGridView6.Size = New System.Drawing.Size(628, 435)
247
-        Me.DataGridView6.TabIndex = 1102
248
-        '
249
-        'Button3
250
-        '
251
-        Me.Button3.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
252
-        Me.Button3.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
253
-        Me.Button3.Location = New System.Drawing.Point(493, 5)
254
-        Me.Button3.Name = "Button3"
255
-        Me.Button3.Size = New System.Drawing.Size(117, 24)
256
-        Me.Button3.TabIndex = 1106
257
-        Me.Button3.Text = "列印"
258
-        Me.Button3.UseVisualStyleBackColor = True
236
+        '時間區間內有前途_dgv
237
+        '
238
+        DataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
239
+        Me.時間區間內有前途_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle6
240
+        Me.時間區間內有前途_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
241
+        Me.時間區間內有前途_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
242
+        Me.時間區間內有前途_dgv.Location = New System.Drawing.Point(1276, 67)
243
+        Me.時間區間內有前途_dgv.Name = "時間區間內有前途_dgv"
244
+        Me.時間區間內有前途_dgv.RowHeadersWidth = 5
245
+        Me.時間區間內有前途_dgv.RowTemplate.Height = 24
246
+        Me.時間區間內有前途_dgv.Size = New System.Drawing.Size(628, 435)
247
+        Me.時間區間內有前途_dgv.TabIndex = 1102
248
+        '
249
+        '列印_bt
250
+        '
251
+        Me.列印_bt.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
252
+        Me.列印_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
253
+        Me.列印_bt.Location = New System.Drawing.Point(493, 5)
254
+        Me.列印_bt.Name = "列印_bt"
255
+        Me.列印_bt.Size = New System.Drawing.Size(117, 24)
256
+        Me.列印_bt.TabIndex = 1106
257
+        Me.列印_bt.Text = "列印"
258
+        Me.列印_bt.UseVisualStyleBackColor = True
259
         '
259
         '
260
         '訂單分析報表七
260
         '訂單分析報表七
261
         '
261
         '
262
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
262
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
263
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
263
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
264
         Me.ClientSize = New System.Drawing.Size(1914, 991)
264
         Me.ClientSize = New System.Drawing.Size(1914, 991)
265
-        Me.Controls.Add(Me.Button3)
265
+        Me.Controls.Add(Me.列印_bt)
266
         Me.Controls.Add(Me.Label6)
266
         Me.Controls.Add(Me.Label6)
267
-        Me.Controls.Add(Me.DataGridView5)
267
+        Me.Controls.Add(Me.時間區間內倒數50名聊尾仔_dgv)
268
         Me.Controls.Add(Me.Label7)
268
         Me.Controls.Add(Me.Label7)
269
-        Me.Controls.Add(Me.DataGridView6)
269
+        Me.Controls.Add(Me.時間區間內有前途_dgv)
270
         Me.Controls.Add(Me.Label3)
270
         Me.Controls.Add(Me.Label3)
271
-        Me.Controls.Add(Me.DataGridView3)
271
+        Me.Controls.Add(Me.每種形體開發來玩的倒數50名_dgv)
272
         Me.Controls.Add(Me.Label5)
272
         Me.Controls.Add(Me.Label5)
273
-        Me.Controls.Add(Me.DataGridView4)
273
+        Me.Controls.Add(Me.每種形體數量大前50名_dgv)
274
         Me.Controls.Add(Me.Label2)
274
         Me.Controls.Add(Me.Label2)
275
-        Me.Controls.Add(Me.DataGridView2)
275
+        Me.Controls.Add(Me.每種形體做爽的倒數50名_dgv)
276
         Me.Controls.Add(Me.Label1)
276
         Me.Controls.Add(Me.Label1)
277
-        Me.Controls.Add(Me.DataGridView1)
278
-        Me.Controls.Add(Me.Button2)
279
-        Me.Controls.Add(Me.Button1)
277
+        Me.Controls.Add(Me.每種形體有賺頭前50名_dgv)
278
+        Me.Controls.Add(Me.當月_bt)
279
+        Me.Controls.Add(Me.當日_bt)
280
         Me.Controls.Add(Me.Label4)
280
         Me.Controls.Add(Me.Label4)
281
-        Me.Controls.Add(Me.DateTimePicker2)
282
-        Me.Controls.Add(Me.DateTimePicker1)
281
+        Me.Controls.Add(Me.日期1_dtp)
282
+        Me.Controls.Add(Me.日期_dtp)
283
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
283
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
284
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
284
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
285
         Me.Name = "訂單分析報表七"
285
         Me.Name = "訂單分析報表七"
286
         Me.Text = "Product sales profit analysis table"
286
         Me.Text = "Product sales profit analysis table"
287
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
288
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit()
289
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).EndInit()
290
-        CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).EndInit()
291
-        CType(Me.DataGridView5, System.ComponentModel.ISupportInitialize).EndInit()
292
-        CType(Me.DataGridView6, System.ComponentModel.ISupportInitialize).EndInit()
287
+        CType(Me.每種形體有賺頭前50名_dgv, System.ComponentModel.ISupportInitialize).EndInit()
288
+        CType(Me.每種形體做爽的倒數50名_dgv, System.ComponentModel.ISupportInitialize).EndInit()
289
+        CType(Me.每種形體開發來玩的倒數50名_dgv, System.ComponentModel.ISupportInitialize).EndInit()
290
+        CType(Me.每種形體數量大前50名_dgv, System.ComponentModel.ISupportInitialize).EndInit()
291
+        CType(Me.時間區間內倒數50名聊尾仔_dgv, System.ComponentModel.ISupportInitialize).EndInit()
292
+        CType(Me.時間區間內有前途_dgv, System.ComponentModel.ISupportInitialize).EndInit()
293
         Me.ResumeLayout(False)
293
         Me.ResumeLayout(False)
294
         Me.PerformLayout()
294
         Me.PerformLayout()
295
 
295
 
296
     End Sub
296
     End Sub
297
 
297
 
298
-    Friend WithEvents Button2 As Button
299
-    Friend WithEvents Button1 As Button
298
+    Friend WithEvents 當月_bt As Button
299
+    Friend WithEvents 當日_bt As Button
300
     Friend WithEvents Label4 As Label
300
     Friend WithEvents Label4 As Label
301
-    Friend WithEvents DateTimePicker2 As DateTimePicker
302
-    Friend WithEvents DateTimePicker1 As DateTimePicker
303
-    Friend WithEvents DataGridView1 As DataGridView
301
+    Friend WithEvents 日期1_dtp As DateTimePicker
302
+    Friend WithEvents 日期_dtp As DateTimePicker
303
+    Friend WithEvents 每種形體有賺頭前50名_dgv As DataGridView
304
     Friend WithEvents Label1 As Label
304
     Friend WithEvents Label1 As Label
305
     Friend WithEvents Label2 As Label
305
     Friend WithEvents Label2 As Label
306
-    Friend WithEvents DataGridView2 As DataGridView
306
+    Friend WithEvents 每種形體做爽的倒數50名_dgv As DataGridView
307
     Friend WithEvents Label3 As Label
307
     Friend WithEvents Label3 As Label
308
-    Friend WithEvents DataGridView3 As DataGridView
308
+    Friend WithEvents 每種形體開發來玩的倒數50名_dgv As DataGridView
309
     Friend WithEvents Label5 As Label
309
     Friend WithEvents Label5 As Label
310
-    Friend WithEvents DataGridView4 As DataGridView
310
+    Friend WithEvents 每種形體數量大前50名_dgv As DataGridView
311
     Friend WithEvents Label6 As Label
311
     Friend WithEvents Label6 As Label
312
-    Friend WithEvents DataGridView5 As DataGridView
312
+    Friend WithEvents 時間區間內倒數50名聊尾仔_dgv As DataGridView
313
     Friend WithEvents Label7 As Label
313
     Friend WithEvents Label7 As Label
314
-    Friend WithEvents DataGridView6 As DataGridView
315
-    Friend WithEvents Button3 As Button
314
+    Friend WithEvents 時間區間內有前途_dgv As DataGridView
315
+    Friend WithEvents 列印_bt As Button
316
 End Class
316
 End Class

+ 202
- 138
TENDEN-MES-SYS/彙總報表管理/訂單分析報表七.vb 查看文件

27
                             - SUM(訂單控制表.訂單數量 * 訂單價格利潤明細表.FTYPrice)) / SUM(訂單控制表.訂單數量) AS 加權平均利潤
27
                             - SUM(訂單控制表.訂單數量 * 訂單價格利潤明細表.FTYPrice)) / SUM(訂單控制表.訂單數量) AS 加權平均利潤
28
                 FROM        訂單價格利潤明細表 FULL OUTER JOIN
28
                 FROM        訂單價格利潤明細表 FULL OUTER JOIN
29
                             訂單控制表 ON 訂單價格利潤明細表.資料流水號 = 訂單控制表.資料流水號
29
                             訂單控制表 ON 訂單價格利潤明細表.資料流水號 = 訂單控制表.資料流水號
30
-                WHERE     (訂單控制表.客戶交期 BETWEEN '" & Strings.Format(DateTimePicker1.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(DateTimePicker2.Value, "yyyy/MM/dd") & "') AND 
30
+                WHERE     (訂單控制表.客戶交期 BETWEEN '" & Strings.Format(日期_dtp.Value, "yyyy/MM/dd") & "' AND '" & Strings.Format(日期1_dtp.Value, "yyyy/MM/dd") & "') AND 
31
                           (訂單價格利潤明細表.FTYPrice > 0) AND  (訂單控制表.訂單數量 > 0)
31
                           (訂單價格利潤明細表.FTYPrice > 0) AND  (訂單控制表.訂單數量 > 0)
32
                 GROUP BY   訂單控制表.形體號"
32
                 GROUP BY   訂單控制表.形體號"
33
     End Sub
33
     End Sub
34
     Private Sub Set_訂單清單1()
34
     Private Sub Set_訂單清單1()
35
-        DataGridView1.DataSource = Nothing : ds.Clear()
36
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
37
-        DataGridView1.ColumnHeadersHeight = RR
38
-        DataGridView1.AllowUserToAddRows = False : DataGridView1.RowTemplate.Height = SS
35
+        每種形體有賺頭前50名_dgv.DataSource = Nothing : ds.Clear()
36
+        每種形體有賺頭前50名_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
37
+        每種形體有賺頭前50名_dgv.ColumnHeadersHeight = RR
38
+        每種形體有賺頭前50名_dgv.AllowUserToAddRows = False : 每種形體有賺頭前50名_dgv.RowTemplate.Height = SS
39
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
39
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
40
         Set_SQL()
40
         Set_SQL()
41
         SQL1 = MYSQL1 & " ORDER BY   加權平均利潤 DESC"
41
         SQL1 = MYSQL1 & " ORDER BY   加權平均利潤 DESC"
42
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
42
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds)
43
+        每種形體有賺頭前50名_dgv.DataSource = ds.Tables(0) : conn.Close()
43
 
44
 
44
-        DataGridView1.Columns(0).FillWeight = 40 : DataGridView1.Columns(1).FillWeight = 170 : DataGridView1.Columns(2).FillWeight = 100 : DataGridView1.Columns(3).FillWeight = 100
45
-        DataGridView1.Columns(4).FillWeight = 100 : DataGridView1.Columns(5).FillWeight = 100 : DataGridView1.Columns(6).FillWeight = 100
45
+        每種形體有賺頭前50名_dgv.Columns(0).FillWeight = 40 : 每種形體有賺頭前50名_dgv.Columns(1).FillWeight = 170 : 每種形體有賺頭前50名_dgv.Columns(2).FillWeight = 100
46
+        每種形體有賺頭前50名_dgv.Columns(4).FillWeight = 100 : 每種形體有賺頭前50名_dgv.Columns(5).FillWeight = 100 : 每種形體有賺頭前50名_dgv.Columns(6).FillWeight = 100
47
+        每種形體有賺頭前50名_dgv.Columns(3).FillWeight = 100
46
 
48
 
47
-        DataGridView1.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(3).DefaultCellStyle.Format = "#,##0"
48
-        DataGridView1.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(5).DefaultCellStyle.Format = "#,##0"
49
-        DataGridView1.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
50
-        DataGridView1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
51
-        DataGridView1.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
52
-        DataGridView1.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
53
-        DataGridView1.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
54
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
55
-            DataGridView1(0, i).Value = i + 1
49
+        每種形體有賺頭前50名_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 每種形體有賺頭前50名_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
50
+        每種形體有賺頭前50名_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 每種形體有賺頭前50名_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
51
+        每種形體有賺頭前50名_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
52
+
53
+        每種形體有賺頭前50名_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
54
+        每種形體有賺頭前50名_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
55
+        每種形體有賺頭前50名_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
56
+        每種形體有賺頭前50名_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
57
+        每種形體有賺頭前50名_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
58
+        每種形體有賺頭前50名_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
59
+        每種形體有賺頭前50名_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
60
+        每種形體有賺頭前50名_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
61
+        每種形體有賺頭前50名_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
62
+        每種形體有賺頭前50名_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
63
+        For i As Integer = 0 To 每種形體有賺頭前50名_dgv.Rows.Count - 1
64
+            每種形體有賺頭前50名_dgv(0, i).Value = i + 1
56
         Next
65
         Next
57
     End Sub
66
     End Sub
58
     Private Sub Set_訂單清單2()
67
     Private Sub Set_訂單清單2()
59
-        DataGridView2.DataSource = Nothing : ds1.Clear()
60
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
61
-        DataGridView2.ColumnHeadersHeight = RR
62
-        DataGridView2.AllowUserToAddRows = False : DataGridView2.RowTemplate.Height = SS
68
+        每種形體做爽的倒數50名_dgv.DataSource = Nothing : ds1.Clear()
69
+        每種形體做爽的倒數50名_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
70
+        每種形體做爽的倒數50名_dgv.ColumnHeadersHeight = RR
71
+        每種形體做爽的倒數50名_dgv.AllowUserToAddRows = False : 每種形體做爽的倒數50名_dgv.RowTemplate.Height = SS
63
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
72
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
64
         Set_SQL()
73
         Set_SQL()
65
         SQL1 = MYSQL1 & " ORDER BY   加權平均利潤"
74
         SQL1 = MYSQL1 & " ORDER BY   加權平均利潤"
66
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
75
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1)
76
+        每種形體做爽的倒數50名_dgv.DataSource = ds1.Tables(0) : conn.Close()
77
+
78
+        每種形體做爽的倒數50名_dgv.Columns(0).FillWeight = 40 : 每種形體做爽的倒數50名_dgv.Columns(1).FillWeight = 170 : 每種形體做爽的倒數50名_dgv.Columns(2).FillWeight = 100
79
+        每種形體做爽的倒數50名_dgv.Columns(4).FillWeight = 100 : 每種形體做爽的倒數50名_dgv.Columns(5).FillWeight = 100 : 每種形體做爽的倒數50名_dgv.Columns(6).FillWeight = 100
80
+        每種形體做爽的倒數50名_dgv.Columns(3).FillWeight = 100
67
 
81
 
68
-        DataGridView2.Columns(0).FillWeight = 40 : DataGridView2.Columns(1).FillWeight = 170 : DataGridView2.Columns(2).FillWeight = 100 : DataGridView2.Columns(3).FillWeight = 100
69
-        DataGridView2.Columns(4).FillWeight = 100 : DataGridView2.Columns(5).FillWeight = 100 : DataGridView2.Columns(6).FillWeight = 100
82
+        每種形體做爽的倒數50名_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 每種形體做爽的倒數50名_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
83
+        每種形體做爽的倒數50名_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 每種形體做爽的倒數50名_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
84
+        每種形體做爽的倒數50名_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
70
 
85
 
71
-        DataGridView2.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView2.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(3).DefaultCellStyle.Format = "#,##0"
72
-        DataGridView2.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(5).DefaultCellStyle.Format = "#,##0"
73
-        DataGridView2.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView2.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
74
-        DataGridView2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView2.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
75
-        DataGridView2.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView2.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
76
-        DataGridView2.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView2.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
77
-        DataGridView2.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView2.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
78
-        For i As Integer = 0 To DataGridView2.Rows.Count - 1
79
-            DataGridView2(0, i).Value = i + 1
86
+        每種形體做爽的倒數50名_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
87
+        每種形體做爽的倒數50名_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
88
+        每種形體做爽的倒數50名_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
89
+        每種形體做爽的倒數50名_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
90
+        每種形體做爽的倒數50名_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
91
+        每種形體做爽的倒數50名_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
92
+        每種形體做爽的倒數50名_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
93
+        每種形體做爽的倒數50名_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
94
+        每種形體做爽的倒數50名_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
95
+        每種形體做爽的倒數50名_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
96
+        For i As Integer = 0 To 每種形體做爽的倒數50名_dgv.Rows.Count - 1
97
+            每種形體做爽的倒數50名_dgv(0, i).Value = i + 1
80
         Next
98
         Next
81
     End Sub
99
     End Sub
82
     Private Sub Set_訂單清單3()
100
     Private Sub Set_訂單清單3()
83
-        DataGridView4.DataSource = Nothing : ds2.Clear()
84
-        DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
85
-        DataGridView4.ColumnHeadersHeight = RR
86
-        DataGridView4.AllowUserToAddRows = False : DataGridView4.RowTemplate.Height = SS
101
+        每種形體數量大前50名_dgv.DataSource = Nothing : ds2.Clear()
102
+        每種形體數量大前50名_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
103
+        每種形體數量大前50名_dgv.ColumnHeadersHeight = RR
104
+        每種形體數量大前50名_dgv.AllowUserToAddRows = False : 每種形體數量大前50名_dgv.RowTemplate.Height = SS
87
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
105
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
88
         Set_SQL()
106
         Set_SQL()
89
         SQL1 = MYSQL1 & " ORDER BY   訂單數量 DESC"
107
         SQL1 = MYSQL1 & " ORDER BY   訂單數量 DESC"
90
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView4.DataSource = ds2.Tables(0) : conn.Close()
108
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2)
109
+        每種形體數量大前50名_dgv.DataSource = ds2.Tables(0) : conn.Close()
110
+
111
+        每種形體數量大前50名_dgv.Columns(0).FillWeight = 40 : 每種形體數量大前50名_dgv.Columns(1).FillWeight = 170 : 每種形體數量大前50名_dgv.Columns(2).FillWeight = 100
112
+        每種形體數量大前50名_dgv.Columns(4).FillWeight = 100 : 每種形體數量大前50名_dgv.Columns(5).FillWeight = 100 : 每種形體數量大前50名_dgv.Columns(6).FillWeight = 100
113
+        每種形體數量大前50名_dgv.Columns(3).FillWeight = 100
91
 
114
 
92
-        DataGridView4.Columns(0).FillWeight = 40 : DataGridView4.Columns(1).FillWeight = 170 : DataGridView4.Columns(2).FillWeight = 100 : DataGridView4.Columns(3).FillWeight = 100
93
-        DataGridView4.Columns(4).FillWeight = 100 : DataGridView4.Columns(5).FillWeight = 100 : DataGridView4.Columns(6).FillWeight = 100
115
+        每種形體數量大前50名_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 每種形體數量大前50名_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
116
+        每種形體數量大前50名_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 每種形體數量大前50名_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
117
+        每種形體數量大前50名_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
94
 
118
 
95
-        DataGridView4.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView4.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(3).DefaultCellStyle.Format = "#,##0"
96
-        DataGridView4.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(5).DefaultCellStyle.Format = "#,##0"
97
-        DataGridView4.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView4.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
98
-        DataGridView4.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView4.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
99
-        DataGridView4.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView4.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
100
-        DataGridView4.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView4.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
101
-        DataGridView4.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView4.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
102
-        For i As Integer = 0 To DataGridView4.Rows.Count - 1
103
-            DataGridView4(0, i).Value = i + 1
119
+        每種形體數量大前50名_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
120
+        每種形體數量大前50名_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
121
+        每種形體數量大前50名_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
122
+        每種形體數量大前50名_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
123
+        每種形體數量大前50名_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
124
+        每種形體數量大前50名_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
125
+        每種形體數量大前50名_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
126
+        每種形體數量大前50名_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
127
+        每種形體數量大前50名_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
128
+        每種形體數量大前50名_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
129
+        For i As Integer = 0 To 每種形體數量大前50名_dgv.Rows.Count - 1
130
+            每種形體數量大前50名_dgv(0, i).Value = i + 1
104
         Next
131
         Next
105
     End Sub
132
     End Sub
106
     Private Sub Set_訂單清單4()
133
     Private Sub Set_訂單清單4()
107
-        DataGridView3.DataSource = Nothing : ds3.Clear()
108
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
109
-        DataGridView3.ColumnHeadersHeight = RR
110
-        DataGridView3.AllowUserToAddRows = False : DataGridView3.RowTemplate.Height = SS
134
+        每種形體開發來玩的倒數50名_dgv.DataSource = Nothing : ds3.Clear()
135
+        每種形體開發來玩的倒數50名_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
136
+        每種形體開發來玩的倒數50名_dgv.ColumnHeadersHeight = RR
137
+        每種形體開發來玩的倒數50名_dgv.AllowUserToAddRows = False : 每種形體開發來玩的倒數50名_dgv.RowTemplate.Height = SS
111
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
138
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
112
         Set_SQL()
139
         Set_SQL()
113
         SQL1 = MYSQL1 & " ORDER BY   訂單數量"
140
         SQL1 = MYSQL1 & " ORDER BY   訂單數量"
114
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : DataGridView3.DataSource = ds3.Tables(0) : conn.Close()
141
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3)
142
+        每種形體開發來玩的倒數50名_dgv.DataSource = ds3.Tables(0) : conn.Close()
115
 
143
 
116
-        DataGridView3.Columns(0).FillWeight = 40 : DataGridView3.Columns(1).FillWeight = 170 : DataGridView3.Columns(2).FillWeight = 100 : DataGridView3.Columns(3).FillWeight = 100
117
-        DataGridView3.Columns(4).FillWeight = 100 : DataGridView3.Columns(5).FillWeight = 100 : DataGridView3.Columns(6).FillWeight = 100
144
+        每種形體開發來玩的倒數50名_dgv.Columns(0).FillWeight = 40 : 每種形體開發來玩的倒數50名_dgv.Columns(1).FillWeight = 170 : 每種形體開發來玩的倒數50名_dgv.Columns(2).FillWeight = 100
145
+        每種形體開發來玩的倒數50名_dgv.Columns(4).FillWeight = 100 : 每種形體開發來玩的倒數50名_dgv.Columns(5).FillWeight = 100 : 每種形體開發來玩的倒數50名_dgv.Columns(6).FillWeight = 100
146
+        每種形體開發來玩的倒數50名_dgv.Columns(3).FillWeight = 100
118
 
147
 
119
-        DataGridView3.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(3).DefaultCellStyle.Format = "#,##0"
120
-        DataGridView3.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(5).DefaultCellStyle.Format = "#,##0"
121
-        DataGridView3.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
122
-        DataGridView3.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
123
-        DataGridView3.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
124
-        DataGridView3.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
125
-        DataGridView3.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
126
-        For i As Integer = 0 To DataGridView3.Rows.Count - 1
127
-            DataGridView3(0, i).Value = i + 1
148
+        每種形體開發來玩的倒數50名_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 每種形體開發來玩的倒數50名_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
149
+        每種形體開發來玩的倒數50名_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 每種形體開發來玩的倒數50名_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
150
+        每種形體開發來玩的倒數50名_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
151
+
152
+        每種形體開發來玩的倒數50名_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
153
+        每種形體開發來玩的倒數50名_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
154
+        每種形體開發來玩的倒數50名_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
155
+        每種形體開發來玩的倒數50名_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
156
+        每種形體開發來玩的倒數50名_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
157
+        每種形體開發來玩的倒數50名_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
158
+        每種形體開發來玩的倒數50名_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
159
+        每種形體開發來玩的倒數50名_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
160
+        每種形體開發來玩的倒數50名_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
161
+        每種形體開發來玩的倒數50名_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
162
+        For i As Integer = 0 To 每種形體開發來玩的倒數50名_dgv.Rows.Count - 1
163
+            每種形體開發來玩的倒數50名_dgv(0, i).Value = i + 1
128
         Next
164
         Next
129
     End Sub
165
     End Sub
130
     Private Sub Set_訂單清單5()
166
     Private Sub Set_訂單清單5()
131
-        DataGridView6.DataSource = Nothing : ds4.Clear()
132
-        DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
133
-        DataGridView6.ColumnHeadersHeight = RR
134
-        DataGridView6.AllowUserToAddRows = False : DataGridView6.RowTemplate.Height = SS
167
+        時間區間內有前途_dgv.DataSource = Nothing : ds4.Clear()
168
+        時間區間內有前途_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
169
+        時間區間內有前途_dgv.ColumnHeadersHeight = RR
170
+        時間區間內有前途_dgv.AllowUserToAddRows = False : 時間區間內有前途_dgv.RowTemplate.Height = SS
135
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
171
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
136
         Set_SQL()
172
         Set_SQL()
137
         SQL1 = MYSQL1 & " ORDER BY   利潤 DESC"
173
         SQL1 = MYSQL1 & " ORDER BY   利潤 DESC"
138
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : DataGridView6.DataSource = ds4.Tables(0) : conn.Close()
174
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : 時間區間內有前途_dgv.DataSource = ds4.Tables(0) : conn.Close()
175
+
176
+        時間區間內有前途_dgv.Columns(0).FillWeight = 40 : 時間區間內有前途_dgv.Columns(1).FillWeight = 170 : 時間區間內有前途_dgv.Columns(2).FillWeight = 100
177
+        時間區間內有前途_dgv.Columns(4).FillWeight = 100 : 時間區間內有前途_dgv.Columns(5).FillWeight = 100 : 時間區間內有前途_dgv.Columns(6).FillWeight = 100
178
+        時間區間內有前途_dgv.Columns(3).FillWeight = 100
139
 
179
 
140
-        DataGridView6.Columns(0).FillWeight = 40 : DataGridView6.Columns(1).FillWeight = 170 : DataGridView6.Columns(2).FillWeight = 100 : DataGridView6.Columns(3).FillWeight = 100
141
-        DataGridView6.Columns(4).FillWeight = 100 : DataGridView6.Columns(5).FillWeight = 100 : DataGridView6.Columns(6).FillWeight = 100
180
+        時間區間內有前途_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 時間區間內有前途_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
181
+        時間區間內有前途_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 時間區間內有前途_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
182
+        時間區間內有前途_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
142
 
183
 
143
-        DataGridView6.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView6.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(3).DefaultCellStyle.Format = "#,##0"
144
-        DataGridView6.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(5).DefaultCellStyle.Format = "#,##0"
145
-        DataGridView6.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
146
-        DataGridView6.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
147
-        DataGridView6.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
148
-        DataGridView6.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
149
-        DataGridView6.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView6.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
150
-        For i As Integer = 0 To DataGridView6.Rows.Count - 1
151
-            DataGridView6(0, i).Value = i + 1
184
+        時間區間內有前途_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
185
+        時間區間內有前途_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
186
+        時間區間內有前途_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
187
+        時間區間內有前途_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
188
+        時間區間內有前途_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
189
+        時間區間內有前途_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
190
+        時間區間內有前途_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
191
+        時間區間內有前途_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
192
+        時間區間內有前途_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
193
+        時間區間內有前途_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
194
+        For i As Integer = 0 To 時間區間內有前途_dgv.Rows.Count - 1
195
+            時間區間內有前途_dgv(0, i).Value = i + 1
152
         Next
196
         Next
153
     End Sub
197
     End Sub
154
     Private Sub Set_訂單清單6()
198
     Private Sub Set_訂單清單6()
155
-        DataGridView5.DataSource = Nothing : ds5.Clear()
156
-        DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
157
-        DataGridView5.ColumnHeadersHeight = RR
158
-        DataGridView5.AllowUserToAddRows = False : DataGridView5.RowTemplate.Height = SS
199
+        時間區間內倒數50名聊尾仔_dgv.DataSource = Nothing : ds5.Clear()
200
+        時間區間內倒數50名聊尾仔_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
201
+        時間區間內倒數50名聊尾仔_dgv.ColumnHeadersHeight = RR
202
+        時間區間內倒數50名聊尾仔_dgv.AllowUserToAddRows = False : 時間區間內倒數50名聊尾仔_dgv.RowTemplate.Height = SS
159
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
203
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
160
         Set_SQL()
204
         Set_SQL()
161
         SQL1 = MYSQL1 & " ORDER BY   利潤"
205
         SQL1 = MYSQL1 & " ORDER BY   利潤"
162
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : DataGridView5.DataSource = ds5.Tables(0) : conn.Close()
206
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5)
207
+        時間區間內倒數50名聊尾仔_dgv.DataSource = ds5.Tables(0) : conn.Close()
208
+
209
+        時間區間內倒數50名聊尾仔_dgv.Columns(0).FillWeight = 40 : 時間區間內倒數50名聊尾仔_dgv.Columns(1).FillWeight = 170 : 時間區間內倒數50名聊尾仔_dgv.Columns(2).FillWeight = 100
210
+        時間區間內倒數50名聊尾仔_dgv.Columns(4).FillWeight = 100 : 時間區間內倒數50名聊尾仔_dgv.Columns(5).FillWeight = 100 : 時間區間內倒數50名聊尾仔_dgv.Columns(6).FillWeight = 100
211
+        時間區間內倒數50名聊尾仔_dgv.Columns(3).FillWeight = 100
163
 
212
 
164
-        DataGridView5.Columns(0).FillWeight = 40 : DataGridView5.Columns(1).FillWeight = 170 : DataGridView5.Columns(2).FillWeight = 100 : DataGridView5.Columns(3).FillWeight = 100
165
-        DataGridView5.Columns(4).FillWeight = 100 : DataGridView5.Columns(5).FillWeight = 100 : DataGridView5.Columns(6).FillWeight = 100
213
+        時間區間內倒數50名聊尾仔_dgv.Columns(6).DefaultCellStyle.Format = "#,##0.00" : 時間區間內倒數50名聊尾仔_dgv.Columns(2).DefaultCellStyle.Format = "#,##0"
214
+        時間區間內倒數50名聊尾仔_dgv.Columns(4).DefaultCellStyle.Format = "#,##0" : 時間區間內倒數50名聊尾仔_dgv.Columns(5).DefaultCellStyle.Format = "#,##0"
215
+        時間區間內倒數50名聊尾仔_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
166
 
216
 
167
-        DataGridView5.Columns(6).DefaultCellStyle.Format = "#,##0.00" : DataGridView5.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(3).DefaultCellStyle.Format = "#,##0"
168
-        DataGridView5.Columns(4).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(5).DefaultCellStyle.Format = "#,##0"
169
-        DataGridView5.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView5.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
170
-        DataGridView5.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView5.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
171
-        DataGridView5.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView5.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
172
-        DataGridView5.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView5.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
173
-        DataGridView5.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView5.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
174
-        For i As Integer = 0 To DataGridView5.Rows.Count - 1
175
-            DataGridView5(0, i).Value = i + 1
217
+        時間區間內倒數50名聊尾仔_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
218
+        時間區間內倒數50名聊尾仔_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
219
+        時間區間內倒數50名聊尾仔_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
220
+        時間區間內倒數50名聊尾仔_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
221
+        時間區間內倒數50名聊尾仔_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
222
+        時間區間內倒數50名聊尾仔_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
223
+        時間區間內倒數50名聊尾仔_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
224
+        時間區間內倒數50名聊尾仔_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
225
+        時間區間內倒數50名聊尾仔_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
226
+        時間區間內倒數50名聊尾仔_dgv.Columns(5).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
227
+        For i As Integer = 0 To 時間區間內倒數50名聊尾仔_dgv.Rows.Count - 1
228
+            時間區間內倒數50名聊尾仔_dgv(0, i).Value = i + 1
176
         Next
229
         Next
177
     End Sub
230
     End Sub
178
     Private Sub 訂單分析報表七_Load(sender As Object, e As EventArgs) Handles MyBase.Load
231
     Private Sub 訂單分析報表七_Load(sender As Object, e As EventArgs) Handles MyBase.Load
179
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
232
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
180
-        'DataGridView1.Enabled = False : DataGridView2.Enabled = False : DataGridView3.Enabled = False : DataGridView4.Enabled = False : DataGridView5.Enabled = False : DataGridView6.Enabled = False
181
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
233
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
182
     End Sub
234
     End Sub
183
-    Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged
235
+    Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles 日期_dtp.ValueChanged
184
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
236
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
185
     End Sub
237
     End Sub
186
-    Private Sub DateTimePicker2_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker2.ValueChanged
238
+    Private Sub DateTimePicker2_ValueChanged(sender As Object, e As EventArgs) Handles 日期1_dtp.ValueChanged
187
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
239
         Set_訂單清單1() : Set_訂單清單2() : Set_訂單清單3() : Set_訂單清單4() : Set_訂單清單5() : Set_訂單清單6()
188
     End Sub
240
     End Sub
189
-    Private Sub DataGridView1_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView1.Scroll
190
-        DataGridView2.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex : DataGridView3.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex
191
-        DataGridView4.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex : DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex
192
-        DataGridView6.FirstDisplayedScrollingRowIndex = DataGridView1.FirstDisplayedScrollingRowIndex
241
+    Private Sub DataGridView1_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 每種形體有賺頭前50名_dgv.Scroll
242
+        每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex
243
+        每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex
244
+        每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex
245
+        時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex = 每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex
246
+        時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex = 每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex
193
     End Sub
247
     End Sub
194
-    Private Sub DataGridView2_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView2.Scroll
195
-        DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView2.FirstDisplayedScrollingRowIndex : DataGridView3.FirstDisplayedScrollingRowIndex = DataGridView2.FirstDisplayedScrollingRowIndex
196
-        DataGridView4.FirstDisplayedScrollingRowIndex = DataGridView2.FirstDisplayedScrollingRowIndex : DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView2.FirstDisplayedScrollingRowIndex
197
-        DataGridView6.FirstDisplayedScrollingRowIndex = DataGridView2.FirstDisplayedScrollingRowIndex
248
+    Private Sub DataGridView2_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 每種形體做爽的倒數50名_dgv.Scroll
249
+        每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex
250
+        每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex
251
+        每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex
252
+        時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex = 每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex
253
+        時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex = 每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex
198
     End Sub
254
     End Sub
199
-    Private Sub DataGridView3_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView3.Scroll
200
-        DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView3.FirstDisplayedScrollingRowIndex : DataGridView2.FirstDisplayedScrollingRowIndex = DataGridView3.FirstDisplayedScrollingRowIndex
201
-        DataGridView4.FirstDisplayedScrollingRowIndex = DataGridView3.FirstDisplayedScrollingRowIndex : DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView3.FirstDisplayedScrollingRowIndex
202
-        DataGridView6.FirstDisplayedScrollingRowIndex = DataGridView3.FirstDisplayedScrollingRowIndex
255
+    Private Sub DataGridView3_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 每種形體開發來玩的倒數50名_dgv.Scroll
256
+        每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex
257
+        每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex
258
+        每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex
259
+        時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex = 每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex
260
+        時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex = 每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex
203
     End Sub
261
     End Sub
204
-    Private Sub DataGridView4_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView4.Scroll
205
-        DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView4.FirstDisplayedScrollingRowIndex : DataGridView2.FirstDisplayedScrollingRowIndex = DataGridView4.FirstDisplayedScrollingRowIndex
206
-        DataGridView3.FirstDisplayedScrollingRowIndex = DataGridView4.FirstDisplayedScrollingRowIndex : DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView4.FirstDisplayedScrollingRowIndex
207
-        DataGridView6.FirstDisplayedScrollingRowIndex = DataGridView4.FirstDisplayedScrollingRowIndex
262
+    Private Sub DataGridView4_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 每種形體數量大前50名_dgv.Scroll
263
+        每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex
264
+        每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex
265
+        每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex
266
+        時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex = 每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex
267
+        時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex = 每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex
208
     End Sub
268
     End Sub
209
-    Private Sub DataGridView5_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView5.Scroll
210
-        DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView5.FirstDisplayedScrollingRowIndex : DataGridView2.FirstDisplayedScrollingRowIndex = DataGridView5.FirstDisplayedScrollingRowIndex
211
-        DataGridView3.FirstDisplayedScrollingRowIndex = DataGridView5.FirstDisplayedScrollingRowIndex : DataGridView4.FirstDisplayedScrollingRowIndex = DataGridView5.FirstDisplayedScrollingRowIndex
212
-        DataGridView6.FirstDisplayedScrollingRowIndex = DataGridView5.FirstDisplayedScrollingRowIndex
269
+    Private Sub DataGridView5_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 時間區間內倒數50名聊尾仔_dgv.Scroll
270
+        每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex
271
+        每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex
272
+        每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex
273
+        每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex
274
+        時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex = 時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex
213
     End Sub
275
     End Sub
214
-    Private Sub DataGridView6_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles DataGridView6.Scroll
215
-        DataGridView1.FirstDisplayedScrollingRowIndex = DataGridView6.FirstDisplayedScrollingRowIndex : DataGridView2.FirstDisplayedScrollingRowIndex = DataGridView6.FirstDisplayedScrollingRowIndex
216
-        DataGridView3.FirstDisplayedScrollingRowIndex = DataGridView6.FirstDisplayedScrollingRowIndex : DataGridView4.FirstDisplayedScrollingRowIndex = DataGridView6.FirstDisplayedScrollingRowIndex
217
-        DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView6.FirstDisplayedScrollingRowIndex
276
+    Private Sub DataGridView6_Scroll(ByVal sender As Object, ByVal e As ScrollEventArgs) Handles 時間區間內有前途_dgv.Scroll
277
+        每種形體有賺頭前50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex
278
+        每種形體做爽的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex
279
+        每種形體開發來玩的倒數50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex
280
+        每種形體數量大前50名_dgv.FirstDisplayedScrollingRowIndex = 時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex
281
+        時間區間內倒數50名聊尾仔_dgv.FirstDisplayedScrollingRowIndex = 時間區間內有前途_dgv.FirstDisplayedScrollingRowIndex
218
     End Sub
282
     End Sub
219
 
283
 
220
-    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
284
+    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
221
         xlApp = CType(CreateObject("Excel.Application"), Application)
285
         xlApp = CType(CreateObject("Excel.Application"), Application)
222
         xlBook = xlApp.Workbooks.Add
286
         xlBook = xlApp.Workbooks.Add
223
         xlApp.DisplayAlerts = True
287
         xlApp.DisplayAlerts = True
227
         xlApp.Visible = True
291
         xlApp.Visible = True
228
         xlApp.Application.WindowState = xlMaximized
292
         xlApp.Application.WindowState = xlMaximized
229
 
293
 
230
-        xlSheet.Cells(1, 1) = Strings.Left(Strings.Format(DateTimePicker1.Value, "yyyy/MM/dd"), 10) & " 到 " & Strings.Left(Strings.Format(DateTimePicker2.Value, "yyyy/MM/dd"), 10) & " 產品營運排行榜"
294
+        xlSheet.Cells(1, 1) = Strings.Left(Strings.Format(日期_dtp.Value, "yyyy/MM/dd"), 10) & " 到 " & Strings.Left(Strings.Format(日期1_dtp.Value, "yyyy/MM/dd"), 10) & " 產品營運排行榜"
231
         xlSheet.Cells(2, 1) = Label1.Text : xlSheet.Cells(2, 5) = Label5.Text : xlSheet.Cells(2, 9) = Label7.Text
295
         xlSheet.Cells(2, 1) = Label1.Text : xlSheet.Cells(2, 5) = Label5.Text : xlSheet.Cells(2, 9) = Label7.Text
232
         xlSheet.Cells(3, 1) = "排名" : xlSheet.Cells(3, 5) = "排名" : xlSheet.Cells(3, 9) = "排名"
296
         xlSheet.Cells(3, 1) = "排名" : xlSheet.Cells(3, 5) = "排名" : xlSheet.Cells(3, 9) = "排名"
233
         xlSheet.Cells(3, 2) = "形體名稱" : xlSheet.Cells(3, 6) = "形體名稱" : xlSheet.Cells(3, 10) = "形體名稱"
297
         xlSheet.Cells(3, 2) = "形體名稱" : xlSheet.Cells(3, 6) = "形體名稱" : xlSheet.Cells(3, 10) = "形體名稱"
234
         xlSheet.Cells(3, 3) = "訂單數量" : xlSheet.Cells(3, 7) = "訂單數量" : xlSheet.Cells(3, 11) = "訂單數量"
298
         xlSheet.Cells(3, 3) = "訂單數量" : xlSheet.Cells(3, 7) = "訂單數量" : xlSheet.Cells(3, 11) = "訂單數量"
235
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
236
-            xlSheet.Cells(i + 4, 1) = DataGridView1.Rows(i).Cells("排名").Value
237
-            xlSheet.Cells(i + 4, 2) = DataGridView1.Rows(i).Cells("形體號").Value
238
-            xlSheet.Cells(i + 4, 3) = DataGridView1.Rows(i).Cells("訂單數量").Value
299
+        For i As Integer = 0 To 每種形體有賺頭前50名_dgv.Rows.Count - 1
300
+            xlSheet.Cells(i + 4, 1) = 每種形體有賺頭前50名_dgv.Rows(i).Cells("排名").Value
301
+            xlSheet.Cells(i + 4, 2) = 每種形體有賺頭前50名_dgv.Rows(i).Cells("形體號").Value
302
+            xlSheet.Cells(i + 4, 3) = 每種形體有賺頭前50名_dgv.Rows(i).Cells("訂單數量").Value
239
         Next
303
         Next
240
-        For i As Integer = 0 To DataGridView4.Rows.Count - 1
241
-            xlSheet.Cells(i + 4, 5) = DataGridView4.Rows(i).Cells("排名").Value
242
-            xlSheet.Cells(i + 4, 6) = DataGridView4.Rows(i).Cells("形體號").Value
243
-            xlSheet.Cells(i + 4, 7) = DataGridView4.Rows(i).Cells("訂單數量").Value
304
+        For i As Integer = 0 To 每種形體數量大前50名_dgv.Rows.Count - 1
305
+            xlSheet.Cells(i + 4, 5) = 每種形體數量大前50名_dgv.Rows(i).Cells("排名").Value
306
+            xlSheet.Cells(i + 4, 6) = 每種形體數量大前50名_dgv.Rows(i).Cells("形體號").Value
307
+            xlSheet.Cells(i + 4, 7) = 每種形體數量大前50名_dgv.Rows(i).Cells("訂單數量").Value
244
         Next
308
         Next
245
-        For i As Integer = 0 To DataGridView6.Rows.Count - 1
246
-            xlSheet.Cells(i + 4, 9) = DataGridView6.Rows(i).Cells("排名").Value
247
-            xlSheet.Cells(i + 4, 10) = DataGridView6.Rows(i).Cells("形體號").Value
248
-            xlSheet.Cells(i + 4, 11) = DataGridView6.Rows(i).Cells("訂單數量").Value
309
+        For i As Integer = 0 To 時間區間內有前途_dgv.Rows.Count - 1
310
+            xlSheet.Cells(i + 4, 9) = 時間區間內有前途_dgv.Rows(i).Cells("排名").Value
311
+            xlSheet.Cells(i + 4, 10) = 時間區間內有前途_dgv.Rows(i).Cells("形體號").Value
312
+            xlSheet.Cells(i + 4, 11) = 時間區間內有前途_dgv.Rows(i).Cells("訂單數量").Value
249
         Next
313
         Next
250
         AA(xlApp, xlSheet)
314
         AA(xlApp, xlSheet)
251
 
315
 

+ 340
- 340
TENDEN-MES-SYS/彙總報表管理/訂單分析報表三.Designer.vb
文件差異過大導致無法顯示
查看文件


+ 118
- 118
TENDEN-MES-SYS/彙總報表管理/訂單分析報表三.vb 查看文件

7
     Dim ds As New DataSet : Dim ds1 As New DataSet : Dim ds2 As New DataSet : Dim ds3 As New DataSet : Dim ds4 As New DataSet : Dim ds5 As New DataSet : Dim ds6 As New DataSet
7
     Dim ds As New DataSet : Dim ds1 As New DataSet : Dim ds2 As New DataSet : Dim ds3 As New DataSet : Dim ds4 As New DataSet : Dim ds5 As New DataSet : Dim ds6 As New DataSet
8
     Dim dr As SqlDataReader
8
     Dim dr As SqlDataReader
9
     Private  Sub Set_DGV1載入前設定()
9
     Private  Sub Set_DGV1載入前設定()
10
-        DataGridView1.DataSource = Nothing : ds.Clear()
11
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
-        DataGridView1.ColumnHeadersHeight = 25
13
-        DataGridView1.AllowUserToAddRows = False
10
+        IN_L_dgv.DataSource = Nothing : ds.Clear()
11
+        IN_L_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
+        IN_L_dgv.ColumnHeadersHeight = 25
13
+        IN_L_dgv.AllowUserToAddRows = False
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
15
     End Sub
15
     End Sub
16
     Private  Sub Set_DGV1載入後設定()
16
     Private  Sub Set_DGV1載入後設定()
17
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
17
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : IN_L_dgv.DataSource = ds.Tables(0) : conn.Close()
18
     End Sub
18
     End Sub
19
     Private  Sub Set_分析清單1()
19
     Private  Sub Set_分析清單1()
20
         Set_DGV1載入前設定()
20
         Set_DGV1載入前設定()
21
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
21
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
22
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
22
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
23
-               "WHERE (LEFT(客戶交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'INT-L')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
23
+               "WHERE (LEFT(客戶交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'INT-L')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
24
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
24
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
25
         Set_DGV1載入後設定()
25
         Set_DGV1載入後設定()
26
     End Sub
26
     End Sub
27
     Private  Sub Set_DGV2載入前設定()
27
     Private  Sub Set_DGV2載入前設定()
28
-        DataGridView2.DataSource = Nothing : ds1.Clear()
29
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
30
-        DataGridView2.ColumnHeadersHeight = 25
31
-        DataGridView2.AllowUserToAddRows = False
28
+        QVC_dgv.DataSource = Nothing : ds1.Clear()
29
+        QVC_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
30
+        QVC_dgv.ColumnHeadersHeight = 25
31
+        QVC_dgv.AllowUserToAddRows = False
32
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
32
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
33
     End Sub
33
     End Sub
34
     Private  Sub Set_DGV2載入後設定()
34
     Private  Sub Set_DGV2載入後設定()
35
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
35
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : QVC_dgv.DataSource = ds1.Tables(0) : conn.Close()
36
     End Sub
36
     End Sub
37
     Private  Sub Set_分析清單2()
37
     Private  Sub Set_分析清單2()
38
         Set_DGV2載入前設定()
38
         Set_DGV2載入前設定()
39
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
39
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
40
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
40
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
41
-               "WHERE (LEFT(客戶交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'QVC')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
41
+               "WHERE (LEFT(客戶交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'QVC')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
42
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
42
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
43
         Set_DGV2載入後設定()
43
         Set_DGV2載入後設定()
44
     End Sub
44
     End Sub
45
     Private  Sub Set_DGV3載入前設定()
45
     Private  Sub Set_DGV3載入前設定()
46
-        DataGridView3.DataSource = Nothing : ds2.Clear()
47
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
48
-        DataGridView3.ColumnHeadersHeight = 25
49
-        DataGridView3.AllowUserToAddRows = False
46
+        DOMESTIC_dgv.DataSource = Nothing : ds2.Clear()
47
+        DOMESTIC_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
48
+        DOMESTIC_dgv.ColumnHeadersHeight = 25
49
+        DOMESTIC_dgv.AllowUserToAddRows = False
50
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
50
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
51
     End Sub
51
     End Sub
52
     Private  Sub Set_DGV3載入後設定()
52
     Private  Sub Set_DGV3載入後設定()
53
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
53
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DOMESTIC_dgv.DataSource = ds2.Tables(0) : conn.Close()
54
     End Sub
54
     End Sub
55
     Private  Sub Set_分析清單3()
55
     Private  Sub Set_分析清單3()
56
         Set_DGV3載入前設定()
56
         Set_DGV3載入前設定()
57
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
57
         SQL1 = "SELECT LEFT(客戶交期, 7) AS CUST_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
58
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
58
                "FROM (SELECT LEFT(客戶交期, 7) AS 客戶交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
59
-               "WHERE (LEFT(客戶交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'DOMESTIC')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
59
+               "WHERE (LEFT(客戶交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (訂單種類 LIKE 'DOMESTIC')  GROUP BY LEFT(客戶交期, 7), 訂單流水號) AS Q " &
60
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
60
                "GROUP BY   LEFT(客戶交期, 7) ORDER BY CUST_XF"
61
         Set_DGV3載入後設定()
61
         Set_DGV3載入後設定()
62
     End Sub
62
     End Sub
63
     Private  Sub Set_DGV4載入前設定()
63
     Private  Sub Set_DGV4載入前設定()
64
-        DataGridView4.DataSource = Nothing : ds3.Clear()
65
-        DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
66
-        DataGridView4.ColumnHeadersHeight = 25
67
-        DataGridView4.AllowUserToAddRows = False
64
+        JH_dgv.DataSource = Nothing : ds3.Clear()
65
+        JH_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
66
+        JH_dgv.ColumnHeadersHeight = 25
67
+        JH_dgv.AllowUserToAddRows = False
68
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
68
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
69
     End Sub
69
     End Sub
70
     Private  Sub Set_DGV4載入後設定()
70
     Private  Sub Set_DGV4載入後設定()
71
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
71
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : JH_dgv.DataSource = ds3.Tables(0) : conn.Close()
72
     End Sub
72
     End Sub
73
     Private  Sub Set_分析清單4()
73
     Private  Sub Set_分析清單4()
74
         Set_DGV4載入前設定()
74
         Set_DGV4載入前設定()
75
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
75
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
76
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
76
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
77
-               "WHERE (LEFT(工廠回復交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'JH') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
77
+               "WHERE (LEFT(工廠回復交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'JH') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
78
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
78
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
79
         Set_DGV4載入後設定()
79
         Set_DGV4載入後設定()
80
     End Sub
80
     End Sub
81
     Private  Sub Set_DGV5載入前設定()
81
     Private  Sub Set_DGV5載入前設定()
82
-        DataGridView5.DataSource = Nothing : ds4.Clear()
83
-        DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
84
-        DataGridView5.ColumnHeadersHeight = 25
85
-        DataGridView5.AllowUserToAddRows = False
82
+        NJ_dgv.DataSource = Nothing : ds4.Clear()
83
+        NJ_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
84
+        NJ_dgv.ColumnHeadersHeight = 25
85
+        NJ_dgv.AllowUserToAddRows = False
86
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
86
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
87
     End Sub
87
     End Sub
88
     Private  Sub Set_DGV5載入後設定()
88
     Private  Sub Set_DGV5載入後設定()
89
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
89
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : NJ_dgv.DataSource = ds4.Tables(0) : conn.Close()
90
     End Sub
90
     End Sub
91
     Private  Sub Set_分析清單5()
91
     Private  Sub Set_分析清單5()
92
         Set_DGV5載入前設定()
92
         Set_DGV5載入前設定()
93
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
93
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
94
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
94
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
95
-               "WHERE (LEFT(工廠回復交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'NJ') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
95
+               "WHERE (LEFT(工廠回復交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'NJ') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
96
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
96
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
97
         Set_DGV5載入後設定()
97
         Set_DGV5載入後設定()
98
     End Sub
98
     End Sub
99
     Private  Sub Set_DGV6載入前設定()
99
     Private  Sub Set_DGV6載入前設定()
100
-        DataGridView6.DataSource = Nothing : ds5.Clear()
101
-        DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
102
-        DataGridView6.ColumnHeadersHeight = 25
103
-        DataGridView6.AllowUserToAddRows = False
100
+        SK_dgv.DataSource = Nothing : ds5.Clear()
101
+        SK_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
102
+        SK_dgv.ColumnHeadersHeight = 25
103
+        SK_dgv.AllowUserToAddRows = False
104
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
104
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
105
     End Sub
105
     End Sub
106
     Private  Sub Set_DGV6載入後設定()
106
     Private  Sub Set_DGV6載入後設定()
107
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
107
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : SK_dgv.DataSource = ds5.Tables(0) : conn.Close()
108
     End Sub
108
     End Sub
109
     Private  Sub Set_分析清單6()
109
     Private  Sub Set_分析清單6()
110
         Set_DGV6載入前設定()
110
         Set_DGV6載入前設定()
111
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
111
         SQL1 = "SELECT LEFT(工廠回復交期, 7) AS FTY_XF, COUNT(*) AS POS, SUM(訂單數量) AS QTY, SUM(訂單數量) / COUNT(*) AS AVG_QTY " &
112
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
112
                "FROM (SELECT LEFT(工廠回復交期, 7) AS 工廠回復交期, 訂單流水號, SUM(訂單數量) AS 訂單數量 FROM 訂單控制表 " &
113
-               "WHERE (LEFT(工廠回復交期, 4) = '" & ComboBox1.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'SK') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
113
+               "WHERE (LEFT(工廠回復交期, 4) = '" & YEAR_cb.Text & "') AND (CXL IS NULL) AND (生產工廠 LIKE 'SK') GROUP BY LEFT(工廠回復交期, 7), 訂單流水號) AS Q " &
114
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
114
                "GROUP BY   LEFT(工廠回復交期, 7) ORDER BY   FTY_XF"
115
         Set_DGV6載入後設定()
115
         Set_DGV6載入後設定()
116
     End Sub
116
     End Sub
117
     Private  Sub Set_grid()
117
     Private  Sub Set_grid()
118
-        DataGridView1.Columns(0).Width = 85 : DataGridView1.Columns(1).Width = 85 : DataGridView1.Columns(2).Width = 85 : DataGridView1.Columns(3).Width = 85
119
-        DataGridView1.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(3).DefaultCellStyle.Format = "#,##0"
120
-        DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
121
-        DataGridView1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
122
-        DataGridView1.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
123
-        DataGridView1.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
118
+        IN_L_dgv.Columns(0).Width = 85 : IN_L_dgv.Columns(1).Width = 85 : IN_L_dgv.Columns(2).Width = 85 : IN_L_dgv.Columns(3).Width = 85
119
+        IN_L_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : IN_L_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : IN_L_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
120
+        IN_L_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
121
+        IN_L_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : IN_L_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
122
+        IN_L_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
123
+        IN_L_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : IN_L_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
124
 
124
 
125
-        DataGridView2.Columns(0).Width = 85 : DataGridView2.Columns(1).Width = 85 : DataGridView2.Columns(2).Width = 85 : DataGridView2.Columns(3).Width = 85
126
-        DataGridView2.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(3).DefaultCellStyle.Format = "#,##0"
127
-        DataGridView2.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
128
-        DataGridView2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
129
-        DataGridView2.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
130
-        DataGridView2.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
125
+        QVC_dgv.Columns(0).Width = 85 : QVC_dgv.Columns(1).Width = 85 : QVC_dgv.Columns(2).Width = 85 : QVC_dgv.Columns(3).Width = 85
126
+        QVC_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : QVC_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : QVC_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
127
+        QVC_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
128
+        QVC_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : QVC_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
129
+        QVC_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
130
+        QVC_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : QVC_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
131
 
131
 
132
-        DataGridView3.Columns(0).Width = 85 : DataGridView3.Columns(1).Width = 85 : DataGridView3.Columns(2).Width = 85 : DataGridView3.Columns(3).Width = 85
133
-        DataGridView3.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(3).DefaultCellStyle.Format = "#,##0"
134
-        DataGridView3.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
135
-        DataGridView3.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
136
-        DataGridView3.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
137
-        DataGridView3.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
132
+        DOMESTIC_dgv.Columns(0).Width = 85 : DOMESTIC_dgv.Columns(1).Width = 85 : DOMESTIC_dgv.Columns(2).Width = 85 : DOMESTIC_dgv.Columns(3).Width = 85
133
+        DOMESTIC_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : DOMESTIC_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : DOMESTIC_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
134
+        DOMESTIC_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
135
+        DOMESTIC_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DOMESTIC_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
136
+        DOMESTIC_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
137
+        DOMESTIC_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DOMESTIC_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
138
 
138
 
139
-        DataGridView4.Columns(0).Width = 85 : DataGridView4.Columns(1).Width = 85 : DataGridView4.Columns(2).Width = 85 : DataGridView4.Columns(3).Width = 85
140
-        DataGridView4.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(3).DefaultCellStyle.Format = "#,##0"
141
-        DataGridView4.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
142
-        DataGridView4.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
143
-        DataGridView4.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
144
-        DataGridView4.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
139
+        JH_dgv.Columns(0).Width = 85 : JH_dgv.Columns(1).Width = 85 : JH_dgv.Columns(2).Width = 85 : JH_dgv.Columns(3).Width = 85
140
+        JH_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : JH_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : JH_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
141
+        JH_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
142
+        JH_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : JH_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
143
+        JH_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
144
+        JH_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : JH_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
145
 
145
 
146
-        DataGridView5.Columns(0).Width = 85 : DataGridView5.Columns(1).Width = 85 : DataGridView5.Columns(2).Width = 85 : DataGridView5.Columns(3).Width = 85
147
-        DataGridView5.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(3).DefaultCellStyle.Format = "#,##0"
148
-        DataGridView5.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
149
-        DataGridView5.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
150
-        DataGridView5.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
151
-        DataGridView5.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
146
+        NJ_dgv.Columns(0).Width = 85 : NJ_dgv.Columns(1).Width = 85 : NJ_dgv.Columns(2).Width = 85 : NJ_dgv.Columns(3).Width = 85
147
+        NJ_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : NJ_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : NJ_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
148
+        NJ_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
149
+        NJ_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : NJ_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
150
+        NJ_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
151
+        NJ_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : NJ_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
152
 
152
 
153
-        DataGridView6.Columns(0).Width = 85 : DataGridView6.Columns(1).Width = 85 : DataGridView6.Columns(2).Width = 85 : DataGridView6.Columns(3).Width = 85
154
-        DataGridView6.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(3).DefaultCellStyle.Format = "#,##0"
155
-        DataGridView6.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
156
-        DataGridView6.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
157
-        DataGridView6.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
158
-        DataGridView6.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
153
+        SK_dgv.Columns(0).Width = 85 : SK_dgv.Columns(1).Width = 85 : SK_dgv.Columns(2).Width = 85 : SK_dgv.Columns(3).Width = 85
154
+        SK_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : SK_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : SK_dgv.Columns(3).DefaultCellStyle.Format = "#,##0"
155
+        SK_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
156
+        SK_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : SK_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
157
+        SK_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
158
+        SK_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : SK_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
159
     End Sub
159
     End Sub
160
     Private  Sub Set_自動彙總1()
160
     Private  Sub Set_自動彙總1()
161
         Dim 金額加總(11) As Double
161
         Dim 金額加總(11) As Double
162
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
163
-            If DataGridView1.RowCount = 0 Then : 金額加總(0) += 0 : Else : 金額加總(0) += DataGridView1.Rows(i).Cells("POS").Value : End If
164
-            If DataGridView1.RowCount = 0 Then : 金額加總(1) += 0 : Else : 金額加總(1) += DataGridView1.Rows(i).Cells("QTY").Value : End If
162
+        For i As Integer = 0 To IN_L_dgv.Rows.Count - 1
163
+            If IN_L_dgv.RowCount = 0 Then : 金額加總(0) += 0 : Else : 金額加總(0) += IN_L_dgv.Rows(i).Cells("POS").Value : End If
164
+            If IN_L_dgv.RowCount = 0 Then : 金額加總(1) += 0 : Else : 金額加總(1) += IN_L_dgv.Rows(i).Cells("QTY").Value : End If
165
         Next i
165
         Next i
166
-        For i As Integer = 0 To DataGridView2.Rows.Count - 1
167
-            If DataGridView2.RowCount = 0 Then : 金額加總(2) += 0 : Else : 金額加總(2) += DataGridView2.Rows(i).Cells("POS").Value : End If
168
-            If DataGridView2.RowCount = 0 Then : 金額加總(3) += 0 : Else : 金額加總(3) += DataGridView2.Rows(i).Cells("QTY").Value : End If
166
+        For i As Integer = 0 To QVC_dgv.Rows.Count - 1
167
+            If QVC_dgv.RowCount = 0 Then : 金額加總(2) += 0 : Else : 金額加總(2) += QVC_dgv.Rows(i).Cells("POS").Value : End If
168
+            If QVC_dgv.RowCount = 0 Then : 金額加總(3) += 0 : Else : 金額加總(3) += QVC_dgv.Rows(i).Cells("QTY").Value : End If
169
         Next i
169
         Next i
170
-        For i As Integer = 0 To DataGridView3.Rows.Count - 1
171
-            If DataGridView3.RowCount = 0 Then : 金額加總(4) += 0 : Else : 金額加總(4) += DataGridView3.Rows(i).Cells("POS").Value : End If
172
-            If DataGridView3.RowCount = 0 Then : 金額加總(5) += 0 : Else : 金額加總(5) += DataGridView3.Rows(i).Cells("QTY").Value : End If
170
+        For i As Integer = 0 To DOMESTIC_dgv.Rows.Count - 1
171
+            If DOMESTIC_dgv.RowCount = 0 Then : 金額加總(4) += 0 : Else : 金額加總(4) += DOMESTIC_dgv.Rows(i).Cells("POS").Value : End If
172
+            If DOMESTIC_dgv.RowCount = 0 Then : 金額加總(5) += 0 : Else : 金額加總(5) += DOMESTIC_dgv.Rows(i).Cells("QTY").Value : End If
173
         Next i
173
         Next i
174
-        For i As Integer = 0 To DataGridView4.Rows.Count - 1
175
-            If DataGridView4.RowCount = 0 Then : 金額加總(6) += 0 : Else : 金額加總(6) += DataGridView4.Rows(i).Cells("POS").Value : End If
176
-            If DataGridView4.RowCount = 0 Then : 金額加總(7) += 0 : Else : 金額加總(7) += DataGridView4.Rows(i).Cells("QTY").Value : End If
174
+        For i As Integer = 0 To JH_dgv.Rows.Count - 1
175
+            If JH_dgv.RowCount = 0 Then : 金額加總(6) += 0 : Else : 金額加總(6) += JH_dgv.Rows(i).Cells("POS").Value : End If
176
+            If JH_dgv.RowCount = 0 Then : 金額加總(7) += 0 : Else : 金額加總(7) += JH_dgv.Rows(i).Cells("QTY").Value : End If
177
         Next i
177
         Next i
178
-        For i As Integer = 0 To DataGridView5.Rows.Count - 1
179
-            If DataGridView5.RowCount = 0 Then : 金額加總(8) += 0 : Else : 金額加總(8) += DataGridView5.Rows(i).Cells("POS").Value : End If
180
-            If DataGridView5.RowCount = 0 Then : 金額加總(9) += 0 : Else : 金額加總(9) += DataGridView5.Rows(i).Cells("QTY").Value : End If
178
+        For i As Integer = 0 To NJ_dgv.Rows.Count - 1
179
+            If NJ_dgv.RowCount = 0 Then : 金額加總(8) += 0 : Else : 金額加總(8) += NJ_dgv.Rows(i).Cells("POS").Value : End If
180
+            If NJ_dgv.RowCount = 0 Then : 金額加總(9) += 0 : Else : 金額加總(9) += NJ_dgv.Rows(i).Cells("QTY").Value : End If
181
         Next i
181
         Next i
182
-        For i As Integer = 0 To DataGridView6.Rows.Count - 1
183
-            If DataGridView6.RowCount = 0 Then : 金額加總(10) += 0 : Else : 金額加總(10) += DataGridView6.Rows(i).Cells("POS").Value : End If
184
-            If DataGridView6.RowCount = 0 Then : 金額加總(11) += 0 : Else : 金額加總(11) += DataGridView6.Rows(i).Cells("QTY").Value : End If
182
+        For i As Integer = 0 To SK_dgv.Rows.Count - 1
183
+            If SK_dgv.RowCount = 0 Then : 金額加總(10) += 0 : Else : 金額加總(10) += SK_dgv.Rows(i).Cells("POS").Value : End If
184
+            If SK_dgv.RowCount = 0 Then : 金額加總(11) += 0 : Else : 金額加總(11) += SK_dgv.Rows(i).Cells("QTY").Value : End If
185
         Next i
185
         Next i
186
-        TextBox1.Text = Format(Val(金額加總(0)), "#,##0")
187
-        TextBox2.Text = Format(Val(金額加總(1)), "#,##0")
188
-        TextBox4.Text = Format(Val(金額加總(2)), "#,##0")
189
-        TextBox5.Text = Format(Val(金額加總(3)), "#,##0")
190
-        TextBox7.Text = Format(Val(金額加總(4)), "#,##0")
191
-        TextBox8.Text = Format(Val(金額加總(5)), "#,##0")
192
-        TextBox10.Text = Format(Val(金額加總(0) + 金額加總(2) + 金額加總(4)), "#,##0")
193
-        TextBox11.Text = Format(Val(金額加總(1) + 金額加總(3) + 金額加總(5)), "#,##0")
194
-        TextBox24.Text = Format(Val(金額加總(6)), "#,##0")
195
-        TextBox23.Text = Format(Val(金額加總(7)), "#,##0")
196
-        TextBox21.Text = Format(Val(金額加總(8)), "#,##0")
197
-        TextBox20.Text = Format(Val(金額加總(9)), "#,##0")
198
-        TextBox18.Text = Format(Val(金額加總(10)), "#,##0")
199
-        TextBox17.Text = Format(Val(金額加總(11)), "#,##0")
200
-        TextBox15.Text = Format(Val(金額加總(6) + 金額加總(8) + 金額加總(10)), "#,##0")
201
-        TextBox14.Text = Format(Val(金額加總(7) + 金額加總(9) + 金額加總(11)), "#,##0")
202
-        If 金額加總(0) = 0 Then : TextBox3.Text = "0" : Else : TextBox3.Text = Format(Val(金額加總(1) / 金額加總(0)), "#,##0") : End If
203
-        If 金額加總(2) = 0 Then : TextBox6.Text = "0" : Else : TextBox6.Text = Format(Val(金額加總(3) / 金額加總(2)), "#,##0") : End If
204
-        If 金額加總(4) = 0 Then : TextBox9.Text = "0" : Else : TextBox9.Text = Format(Val(金額加總(5) / 金額加總(4)), "#,##0") : End If
205
-        If 金額加總(6) = 0 Then : TextBox22.Text = "0" : Else : TextBox22.Text = Format(Val(金額加總(7) / 金額加總(6)), "#,##0") : End If
206
-        If 金額加總(8) = 0 Then : TextBox19.Text = "0" : Else : TextBox19.Text = Format(Val(金額加總(9) / 金額加總(8)), "#,##0") : End If
207
-        If 金額加總(10) = 0 Then : TextBox16.Text = "0" : Else : TextBox16.Text = Format(Val(金額加總(11) / 金額加總(10)), "#,##0") : End If
208
-        If 金額加總(0) + 金額加總(2) + 金額加總(4) = 0 Then : TextBox12.Text = "0"
209
-        Else : TextBox12.Text = Format(Val((金額加總(1) + 金額加總(3) + 金額加總(5)) / (金額加總(0) + 金額加總(2) + 金額加總(4))), "#,##0") : End If
210
-        If 金額加總(6) + 金額加總(8) + 金額加總(10) = 0 Then : TextBox13.Text = "0"
211
-        Else : TextBox13.Text = Format(Val((金額加總(7) + 金額加總(9) + 金額加總(11)) / (金額加總(6) + 金額加總(8) + 金額加總(10))), "#,##0") : End If
186
+        INT_LTotalPOS_tb.Text = Format(Val(金額加總(0)), "#,##0")
187
+        INT_LTotalQTY_tb.Text = Format(Val(金額加總(1)), "#,##0")
188
+        QVCTotalPOS_tb.Text = Format(Val(金額加總(2)), "#,##0")
189
+        QVCTotalQTY_tb.Text = Format(Val(金額加總(3)), "#,##0")
190
+        DOMESTICTotalPOS_tb.Text = Format(Val(金額加總(4)), "#,##0")
191
+        DOMESTICTotalQTY_tb.Text = Format(Val(金額加總(5)), "#,##0")
192
+        ALLTotalPOS_tb.Text = Format(Val(金額加總(0) + 金額加總(2) + 金額加總(4)), "#,##0")
193
+        ALLTotalQTY_tb.Text = Format(Val(金額加總(1) + 金額加總(3) + 金額加總(5)), "#,##0")
194
+        JHTotalPOS_tb.Text = Format(Val(金額加總(6)), "#,##0")
195
+        JHTotalQTY_tb.Text = Format(Val(金額加總(7)), "#,##0")
196
+        NJTotalPOS_tb.Text = Format(Val(金額加總(8)), "#,##0")
197
+        NJTotalQTY_tb.Text = Format(Val(金額加總(9)), "#,##0")
198
+        SKTotalPOS_tb.Text = Format(Val(金額加總(10)), "#,##0")
199
+        SKTotalQTY_tb.Text = Format(Val(金額加總(11)), "#,##0")
200
+        ALLTotalPOS1_tb.Text = Format(Val(金額加總(6) + 金額加總(8) + 金額加總(10)), "#,##0")
201
+        ALLTotalQTY2_tb.Text = Format(Val(金額加總(7) + 金額加總(9) + 金額加總(11)), "#,##0")
202
+        If 金額加總(0) = 0 Then : INT_LTotalAvgQTY_tb.Text = "0" : Else : INT_LTotalAvgQTY_tb.Text = Format(Val(金額加總(1) / 金額加總(0)), "#,##0") : End If
203
+        If 金額加總(2) = 0 Then : QVCTotalAvgQTY_tb.Text = "0" : Else : QVCTotalAvgQTY_tb.Text = Format(Val(金額加總(3) / 金額加總(2)), "#,##0") : End If
204
+        If 金額加總(4) = 0 Then : DOMESTICTotalAvgQTY_tb.Text = "0" : Else : DOMESTICTotalAvgQTY_tb.Text = Format(Val(金額加總(5) / 金額加總(4)), "#,##0") : End If
205
+        If 金額加總(6) = 0 Then : JHTotalAvgQTY_tb.Text = "0" : Else : JHTotalAvgQTY_tb.Text = Format(Val(金額加總(7) / 金額加總(6)), "#,##0") : End If
206
+        If 金額加總(8) = 0 Then : NJTotalAvgQTY_tb.Text = "0" : Else : NJTotalAvgQTY_tb.Text = Format(Val(金額加總(9) / 金額加總(8)), "#,##0") : End If
207
+        If 金額加總(10) = 0 Then : SKTotalAvgQTY_tb.Text = "0" : Else : SKTotalAvgQTY_tb.Text = Format(Val(金額加總(11) / 金額加總(10)), "#,##0") : End If
208
+        If 金額加總(0) + 金額加總(2) + 金額加總(4) = 0 Then : ALLTotalAvgQTY_tb.Text = "0"
209
+        Else : ALLTotalAvgQTY_tb.Text = Format(Val((金額加總(1) + 金額加總(3) + 金額加總(5)) / (金額加總(0) + 金額加總(2) + 金額加總(4))), "#,##0") : End If
210
+        If 金額加總(6) + 金額加總(8) + 金額加總(10) = 0 Then : ALLTotalAvgQTY1_tb.Text = "0"
211
+        Else : ALLTotalAvgQTY1_tb.Text = Format(Val((金額加總(7) + 金額加總(9) + 金額加總(11)) / (金額加總(6) + 金額加總(8) + 金額加總(10))), "#,##0") : End If
212
     End Sub
212
     End Sub
213
     Private  Sub 訂單分析報表三_Load(sender As Object, e As EventArgs) Handles MyBase.Load
213
     Private  Sub 訂單分析報表三_Load(sender As Object, e As EventArgs) Handles MyBase.Load
214
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
214
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
215
-        ComboBox1.Text = Year(Today)
215
+        YEAR_cb.Text = Year(Today)
216
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
216
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
217
         Set_grid() : Set_自動彙總1()
217
         Set_grid() : Set_自動彙總1()
218
     End Sub
218
     End Sub
219
-    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
219
+    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Search_bt.Click
220
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
220
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
221
         Set_grid() : Set_自動彙總1()
221
         Set_grid() : Set_自動彙總1()
222
     End Sub
222
     End Sub

+ 189
- 189
TENDEN-MES-SYS/彙總報表管理/訂單分析報表二.Designer.vb 查看文件

29
         Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
29
         Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
         Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
30
         Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
         Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
31
         Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
32
-        Me.ComboBox1 = New System.Windows.Forms.ComboBox()
32
+        Me.YEAR_cb = New System.Windows.Forms.ComboBox()
33
         Me.Label2 = New System.Windows.Forms.Label()
33
         Me.Label2 = New System.Windows.Forms.Label()
34
-        Me.Button1 = New System.Windows.Forms.Button()
35
-        Me.DataGridView1 = New System.Windows.Forms.DataGridView()
36
-        Me.DataGridView2 = New System.Windows.Forms.DataGridView()
37
-        Me.DataGridView3 = New System.Windows.Forms.DataGridView()
34
+        Me.Query_bt = New System.Windows.Forms.Button()
35
+        Me.分析清單1_dgv = New System.Windows.Forms.DataGridView()
36
+        Me.分析清單2_dgv = New System.Windows.Forms.DataGridView()
37
+        Me.分析清單3_dgv = New System.Windows.Forms.DataGridView()
38
         Me.Label1 = New System.Windows.Forms.Label()
38
         Me.Label1 = New System.Windows.Forms.Label()
39
-        Me.ComboBox2 = New System.Windows.Forms.ComboBox()
40
-        Me.DataGridView4 = New System.Windows.Forms.DataGridView()
41
-        Me.DataGridView5 = New System.Windows.Forms.DataGridView()
42
-        Me.DataGridView6 = New System.Windows.Forms.DataGridView()
39
+        Me.YEAR1_cb = New System.Windows.Forms.ComboBox()
40
+        Me.分析清單4_dgv = New System.Windows.Forms.DataGridView()
41
+        Me.分析清單5_dgv = New System.Windows.Forms.DataGridView()
42
+        Me.分析清單6_dgv = New System.Windows.Forms.DataGridView()
43
         Me.Label3 = New System.Windows.Forms.Label()
43
         Me.Label3 = New System.Windows.Forms.Label()
44
-        Me.ComboBox3 = New System.Windows.Forms.ComboBox()
45
-        Me.DataGridView7 = New System.Windows.Forms.DataGridView()
46
-        Me.Button2 = New System.Windows.Forms.Button()
47
-        Me.Button3 = New System.Windows.Forms.Button()
48
-        Me.Button4 = New System.Windows.Forms.Button()
49
-        Me.Button5 = New System.Windows.Forms.Button()
50
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
51
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
52
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit()
53
-        CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).BeginInit()
54
-        CType(Me.DataGridView5, System.ComponentModel.ISupportInitialize).BeginInit()
55
-        CType(Me.DataGridView6, System.ComponentModel.ISupportInitialize).BeginInit()
56
-        CType(Me.DataGridView7, System.ComponentModel.ISupportInitialize).BeginInit()
44
+        Me.YEAR2_cb = New System.Windows.Forms.ComboBox()
45
+        Me.分析清單7_dgv = New System.Windows.Forms.DataGridView()
46
+        Me.ADD_bt = New System.Windows.Forms.Button()
47
+        Me.MODIFY_bt = New System.Windows.Forms.Button()
48
+        Me.DELETE_bt = New System.Windows.Forms.Button()
49
+        Me.PRINT_bt = New System.Windows.Forms.Button()
50
+        CType(Me.分析清單1_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
51
+        CType(Me.分析清單2_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
52
+        CType(Me.分析清單3_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
53
+        CType(Me.分析清單4_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
54
+        CType(Me.分析清單5_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
55
+        CType(Me.分析清單6_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
56
+        CType(Me.分析清單7_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
57
         Me.SuspendLayout()
57
         Me.SuspendLayout()
58
         '
58
         '
59
-        'ComboBox1
59
+        'YEAR_cb
60
         '
60
         '
61
-        Me.ComboBox1.FormattingEnabled = True
62
-        Me.ComboBox1.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
63
-        Me.ComboBox1.Location = New System.Drawing.Point(45, 6)
64
-        Me.ComboBox1.Name = "ComboBox1"
65
-        Me.ComboBox1.Size = New System.Drawing.Size(104, 24)
66
-        Me.ComboBox1.TabIndex = 64
61
+        Me.YEAR_cb.FormattingEnabled = True
62
+        Me.YEAR_cb.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
63
+        Me.YEAR_cb.Location = New System.Drawing.Point(45, 6)
64
+        Me.YEAR_cb.Name = "YEAR_cb"
65
+        Me.YEAR_cb.Size = New System.Drawing.Size(104, 24)
66
+        Me.YEAR_cb.TabIndex = 64
67
         '
67
         '
68
         'Label2
68
         'Label2
69
         '
69
         '
74
         Me.Label2.TabIndex = 65
74
         Me.Label2.TabIndex = 65
75
         Me.Label2.Text = "YEAR"
75
         Me.Label2.Text = "YEAR"
76
         '
76
         '
77
-        'Button1
77
+        'Query_bt
78
         '
78
         '
79
-        Me.Button1.Location = New System.Drawing.Point(1375, 7)
80
-        Me.Button1.Name = "Button1"
81
-        Me.Button1.Size = New System.Drawing.Size(114, 24)
82
-        Me.Button1.TabIndex = 66
83
-        Me.Button1.Text = "Query"
84
-        Me.Button1.UseVisualStyleBackColor = True
79
+        Me.Query_bt.Location = New System.Drawing.Point(1375, 7)
80
+        Me.Query_bt.Name = "Query_bt"
81
+        Me.Query_bt.Size = New System.Drawing.Size(114, 24)
82
+        Me.Query_bt.TabIndex = 66
83
+        Me.Query_bt.Text = "Query"
84
+        Me.Query_bt.UseVisualStyleBackColor = True
85
         '
85
         '
86
-        'DataGridView1
86
+        '分析清單1_dgv
87
         '
87
         '
88
         DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
88
         DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
89
-        Me.DataGridView1.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
90
-        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
91
-        Me.DataGridView1.Location = New System.Drawing.Point(7, 36)
92
-        Me.DataGridView1.Name = "DataGridView1"
93
-        Me.DataGridView1.RowHeadersWidth = 5
94
-        Me.DataGridView1.RowTemplate.Height = 24
95
-        Me.DataGridView1.Size = New System.Drawing.Size(530, 329)
96
-        Me.DataGridView1.TabIndex = 67
89
+        Me.分析清單1_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
90
+        Me.分析清單1_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
91
+        Me.分析清單1_dgv.Location = New System.Drawing.Point(7, 36)
92
+        Me.分析清單1_dgv.Name = "分析清單1_dgv"
93
+        Me.分析清單1_dgv.RowHeadersWidth = 5
94
+        Me.分析清單1_dgv.RowTemplate.Height = 24
95
+        Me.分析清單1_dgv.Size = New System.Drawing.Size(530, 329)
96
+        Me.分析清單1_dgv.TabIndex = 67
97
         '
97
         '
98
-        'DataGridView2
98
+        '分析清單2_dgv
99
         '
99
         '
100
         DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
100
         DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer))
101
-        Me.DataGridView2.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
102
-        Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
103
-        Me.DataGridView2.Location = New System.Drawing.Point(7, 371)
104
-        Me.DataGridView2.Name = "DataGridView2"
105
-        Me.DataGridView2.RowHeadersWidth = 5
106
-        Me.DataGridView2.RowTemplate.Height = 24
107
-        Me.DataGridView2.Size = New System.Drawing.Size(530, 608)
108
-        Me.DataGridView2.TabIndex = 68
101
+        Me.分析清單2_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
102
+        Me.分析清單2_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
103
+        Me.分析清單2_dgv.Location = New System.Drawing.Point(7, 371)
104
+        Me.分析清單2_dgv.Name = "分析清單2_dgv"
105
+        Me.分析清單2_dgv.RowHeadersWidth = 5
106
+        Me.分析清單2_dgv.RowTemplate.Height = 24
107
+        Me.分析清單2_dgv.Size = New System.Drawing.Size(530, 608)
108
+        Me.分析清單2_dgv.TabIndex = 68
109
         '
109
         '
110
-        'DataGridView3
110
+        '分析清單3_dgv
111
         '
111
         '
112
         DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
112
         DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
113
-        Me.DataGridView3.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
114
-        Me.DataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
115
-        Me.DataGridView3.Location = New System.Drawing.Point(543, 36)
116
-        Me.DataGridView3.Name = "DataGridView3"
117
-        Me.DataGridView3.RowHeadersWidth = 5
118
-        Me.DataGridView3.RowTemplate.Height = 24
119
-        Me.DataGridView3.Size = New System.Drawing.Size(530, 329)
120
-        Me.DataGridView3.TabIndex = 69
113
+        Me.分析清單3_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
114
+        Me.分析清單3_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
115
+        Me.分析清單3_dgv.Location = New System.Drawing.Point(543, 36)
116
+        Me.分析清單3_dgv.Name = "分析清單3_dgv"
117
+        Me.分析清單3_dgv.RowHeadersWidth = 5
118
+        Me.分析清單3_dgv.RowTemplate.Height = 24
119
+        Me.分析清單3_dgv.Size = New System.Drawing.Size(530, 329)
120
+        Me.分析清單3_dgv.TabIndex = 69
121
         '
121
         '
122
         'Label1
122
         'Label1
123
         '
123
         '
128
         Me.Label1.TabIndex = 71
128
         Me.Label1.TabIndex = 71
129
         Me.Label1.Text = "YEAR"
129
         Me.Label1.Text = "YEAR"
130
         '
130
         '
131
-        'ComboBox2
131
+        'YEAR1_cb
132
         '
132
         '
133
-        Me.ComboBox2.FormattingEnabled = True
134
-        Me.ComboBox2.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
135
-        Me.ComboBox2.Location = New System.Drawing.Point(578, 7)
136
-        Me.ComboBox2.Name = "ComboBox2"
137
-        Me.ComboBox2.Size = New System.Drawing.Size(104, 24)
138
-        Me.ComboBox2.TabIndex = 70
133
+        Me.YEAR1_cb.FormattingEnabled = True
134
+        Me.YEAR1_cb.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
135
+        Me.YEAR1_cb.Location = New System.Drawing.Point(578, 7)
136
+        Me.YEAR1_cb.Name = "YEAR1_cb"
137
+        Me.YEAR1_cb.Size = New System.Drawing.Size(104, 24)
138
+        Me.YEAR1_cb.TabIndex = 70
139
         '
139
         '
140
-        'DataGridView4
140
+        '分析清單4_dgv
141
         '
141
         '
142
         DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
142
         DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
143
-        Me.DataGridView4.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
144
-        Me.DataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
145
-        Me.DataGridView4.Location = New System.Drawing.Point(543, 371)
146
-        Me.DataGridView4.Name = "DataGridView4"
147
-        Me.DataGridView4.RowHeadersWidth = 5
148
-        Me.DataGridView4.RowTemplate.Height = 24
149
-        Me.DataGridView4.Size = New System.Drawing.Size(530, 608)
150
-        Me.DataGridView4.TabIndex = 72
143
+        Me.分析清單4_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
144
+        Me.分析清單4_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
145
+        Me.分析清單4_dgv.Location = New System.Drawing.Point(543, 371)
146
+        Me.分析清單4_dgv.Name = "分析清單4_dgv"
147
+        Me.分析清單4_dgv.RowHeadersWidth = 5
148
+        Me.分析清單4_dgv.RowTemplate.Height = 24
149
+        Me.分析清單4_dgv.Size = New System.Drawing.Size(530, 608)
150
+        Me.分析清單4_dgv.TabIndex = 72
151
         '
151
         '
152
-        'DataGridView5
152
+        '分析清單5_dgv
153
         '
153
         '
154
         DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
154
         DataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
155
-        Me.DataGridView5.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
156
-        Me.DataGridView5.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
157
-        Me.DataGridView5.Location = New System.Drawing.Point(1079, 36)
158
-        Me.DataGridView5.Name = "DataGridView5"
159
-        Me.DataGridView5.RowHeadersWidth = 5
160
-        Me.DataGridView5.RowTemplate.Height = 24
161
-        Me.DataGridView5.Size = New System.Drawing.Size(530, 329)
162
-        Me.DataGridView5.TabIndex = 73
155
+        Me.分析清單5_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle5
156
+        Me.分析清單5_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
157
+        Me.分析清單5_dgv.Location = New System.Drawing.Point(1079, 36)
158
+        Me.分析清單5_dgv.Name = "分析清單5_dgv"
159
+        Me.分析清單5_dgv.RowHeadersWidth = 5
160
+        Me.分析清單5_dgv.RowTemplate.Height = 24
161
+        Me.分析清單5_dgv.Size = New System.Drawing.Size(530, 329)
162
+        Me.分析清單5_dgv.TabIndex = 73
163
         '
163
         '
164
-        'DataGridView6
164
+        '分析清單6_dgv
165
         '
165
         '
166
         DataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
166
         DataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
167
-        Me.DataGridView6.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle6
168
-        Me.DataGridView6.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
169
-        Me.DataGridView6.Location = New System.Drawing.Point(1079, 371)
170
-        Me.DataGridView6.Name = "DataGridView6"
171
-        Me.DataGridView6.RowHeadersWidth = 5
172
-        Me.DataGridView6.RowTemplate.Height = 24
173
-        Me.DataGridView6.Size = New System.Drawing.Size(530, 608)
174
-        Me.DataGridView6.TabIndex = 74
167
+        Me.分析清單6_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle6
168
+        Me.分析清單6_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
169
+        Me.分析清單6_dgv.Location = New System.Drawing.Point(1079, 371)
170
+        Me.分析清單6_dgv.Name = "分析清單6_dgv"
171
+        Me.分析清單6_dgv.RowHeadersWidth = 5
172
+        Me.分析清單6_dgv.RowTemplate.Height = 24
173
+        Me.分析清單6_dgv.Size = New System.Drawing.Size(530, 608)
174
+        Me.分析清單6_dgv.TabIndex = 74
175
         '
175
         '
176
         'Label3
176
         'Label3
177
         '
177
         '
182
         Me.Label3.TabIndex = 76
182
         Me.Label3.TabIndex = 76
183
         Me.Label3.Text = "YEAR"
183
         Me.Label3.Text = "YEAR"
184
         '
184
         '
185
-        'ComboBox3
185
+        'YEAR2_cb
186
         '
186
         '
187
-        Me.ComboBox3.FormattingEnabled = True
188
-        Me.ComboBox3.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
189
-        Me.ComboBox3.Location = New System.Drawing.Point(1123, 7)
190
-        Me.ComboBox3.Name = "ComboBox3"
191
-        Me.ComboBox3.Size = New System.Drawing.Size(104, 24)
192
-        Me.ComboBox3.TabIndex = 75
187
+        Me.YEAR2_cb.FormattingEnabled = True
188
+        Me.YEAR2_cb.Items.AddRange(New Object() {"2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008"})
189
+        Me.YEAR2_cb.Location = New System.Drawing.Point(1123, 7)
190
+        Me.YEAR2_cb.Name = "YEAR2_cb"
191
+        Me.YEAR2_cb.Size = New System.Drawing.Size(104, 24)
192
+        Me.YEAR2_cb.TabIndex = 75
193
         '
193
         '
194
-        'DataGridView7
194
+        '分析清單7_dgv
195
         '
195
         '
196
         DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
196
         DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer))
197
-        Me.DataGridView7.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
198
-        Me.DataGridView7.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
199
-        Me.DataGridView7.Location = New System.Drawing.Point(1615, 36)
200
-        Me.DataGridView7.Name = "DataGridView7"
201
-        Me.DataGridView7.RowHeadersWidth = 5
202
-        Me.DataGridView7.RowTemplate.Height = 24
203
-        Me.DataGridView7.Size = New System.Drawing.Size(293, 943)
204
-        Me.DataGridView7.TabIndex = 77
205
-        '
206
-        'Button2
207
-        '
208
-        Me.Button2.ForeColor = System.Drawing.Color.Blue
209
-        Me.Button2.Location = New System.Drawing.Point(1615, 7)
210
-        Me.Button2.Name = "Button2"
211
-        Me.Button2.Size = New System.Drawing.Size(82, 24)
212
-        Me.Button2.TabIndex = 78
213
-        Me.Button2.Text = "ADD"
214
-        Me.Button2.UseVisualStyleBackColor = True
215
-        '
216
-        'Button3
217
-        '
218
-        Me.Button3.ForeColor = System.Drawing.Color.Green
219
-        Me.Button3.Location = New System.Drawing.Point(1703, 7)
220
-        Me.Button3.Name = "Button3"
221
-        Me.Button3.Size = New System.Drawing.Size(82, 24)
222
-        Me.Button3.TabIndex = 79
223
-        Me.Button3.Text = "MODIFY"
224
-        Me.Button3.UseVisualStyleBackColor = True
225
-        '
226
-        'Button4
227
-        '
228
-        Me.Button4.ForeColor = System.Drawing.Color.Red
229
-        Me.Button4.Location = New System.Drawing.Point(1791, 7)
230
-        Me.Button4.Name = "Button4"
231
-        Me.Button4.Size = New System.Drawing.Size(82, 24)
232
-        Me.Button4.TabIndex = 80
233
-        Me.Button4.Text = "DELETE"
234
-        Me.Button4.UseVisualStyleBackColor = True
235
-        '
236
-        'Button5
237
-        '
238
-        Me.Button5.Location = New System.Drawing.Point(1495, 7)
239
-        Me.Button5.Name = "Button5"
240
-        Me.Button5.Size = New System.Drawing.Size(114, 24)
241
-        Me.Button5.TabIndex = 81
242
-        Me.Button5.Text = "PRINT"
243
-        Me.Button5.UseVisualStyleBackColor = True
197
+        Me.分析清單7_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7
198
+        Me.分析清單7_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
199
+        Me.分析清單7_dgv.Location = New System.Drawing.Point(1615, 36)
200
+        Me.分析清單7_dgv.Name = "分析清單7_dgv"
201
+        Me.分析清單7_dgv.RowHeadersWidth = 5
202
+        Me.分析清單7_dgv.RowTemplate.Height = 24
203
+        Me.分析清單7_dgv.Size = New System.Drawing.Size(293, 943)
204
+        Me.分析清單7_dgv.TabIndex = 77
205
+        '
206
+        'ADD_bt
207
+        '
208
+        Me.ADD_bt.ForeColor = System.Drawing.Color.Blue
209
+        Me.ADD_bt.Location = New System.Drawing.Point(1615, 7)
210
+        Me.ADD_bt.Name = "ADD_bt"
211
+        Me.ADD_bt.Size = New System.Drawing.Size(82, 24)
212
+        Me.ADD_bt.TabIndex = 78
213
+        Me.ADD_bt.Text = "ADD"
214
+        Me.ADD_bt.UseVisualStyleBackColor = True
215
+        '
216
+        'MODIFY_bt
217
+        '
218
+        Me.MODIFY_bt.ForeColor = System.Drawing.Color.Green
219
+        Me.MODIFY_bt.Location = New System.Drawing.Point(1703, 7)
220
+        Me.MODIFY_bt.Name = "MODIFY_bt"
221
+        Me.MODIFY_bt.Size = New System.Drawing.Size(82, 24)
222
+        Me.MODIFY_bt.TabIndex = 79
223
+        Me.MODIFY_bt.Text = "MODIFY"
224
+        Me.MODIFY_bt.UseVisualStyleBackColor = True
225
+        '
226
+        'DELETE_bt
227
+        '
228
+        Me.DELETE_bt.ForeColor = System.Drawing.Color.Red
229
+        Me.DELETE_bt.Location = New System.Drawing.Point(1791, 7)
230
+        Me.DELETE_bt.Name = "DELETE_bt"
231
+        Me.DELETE_bt.Size = New System.Drawing.Size(82, 24)
232
+        Me.DELETE_bt.TabIndex = 80
233
+        Me.DELETE_bt.Text = "DELETE"
234
+        Me.DELETE_bt.UseVisualStyleBackColor = True
235
+        '
236
+        'PRINT_bt
237
+        '
238
+        Me.PRINT_bt.Location = New System.Drawing.Point(1495, 7)
239
+        Me.PRINT_bt.Name = "PRINT_bt"
240
+        Me.PRINT_bt.Size = New System.Drawing.Size(114, 24)
241
+        Me.PRINT_bt.TabIndex = 81
242
+        Me.PRINT_bt.Text = "PRINT"
243
+        Me.PRINT_bt.UseVisualStyleBackColor = True
244
         '
244
         '
245
         '訂單分析報表二
245
         '訂單分析報表二
246
         '
246
         '
247
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
247
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
248
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
248
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
249
         Me.ClientSize = New System.Drawing.Size(1914, 991)
249
         Me.ClientSize = New System.Drawing.Size(1914, 991)
250
-        Me.Controls.Add(Me.Button5)
251
-        Me.Controls.Add(Me.Button4)
252
-        Me.Controls.Add(Me.Button3)
253
-        Me.Controls.Add(Me.Button2)
254
-        Me.Controls.Add(Me.DataGridView7)
250
+        Me.Controls.Add(Me.PRINT_bt)
251
+        Me.Controls.Add(Me.DELETE_bt)
252
+        Me.Controls.Add(Me.MODIFY_bt)
253
+        Me.Controls.Add(Me.ADD_bt)
254
+        Me.Controls.Add(Me.分析清單7_dgv)
255
         Me.Controls.Add(Me.Label3)
255
         Me.Controls.Add(Me.Label3)
256
-        Me.Controls.Add(Me.ComboBox3)
257
-        Me.Controls.Add(Me.DataGridView6)
258
-        Me.Controls.Add(Me.DataGridView5)
259
-        Me.Controls.Add(Me.DataGridView4)
256
+        Me.Controls.Add(Me.YEAR2_cb)
257
+        Me.Controls.Add(Me.分析清單6_dgv)
258
+        Me.Controls.Add(Me.分析清單5_dgv)
259
+        Me.Controls.Add(Me.分析清單4_dgv)
260
         Me.Controls.Add(Me.Label1)
260
         Me.Controls.Add(Me.Label1)
261
-        Me.Controls.Add(Me.ComboBox2)
262
-        Me.Controls.Add(Me.DataGridView3)
263
-        Me.Controls.Add(Me.DataGridView2)
264
-        Me.Controls.Add(Me.DataGridView1)
265
-        Me.Controls.Add(Me.Button1)
261
+        Me.Controls.Add(Me.YEAR1_cb)
262
+        Me.Controls.Add(Me.分析清單3_dgv)
263
+        Me.Controls.Add(Me.分析清單2_dgv)
264
+        Me.Controls.Add(Me.分析清單1_dgv)
265
+        Me.Controls.Add(Me.Query_bt)
266
         Me.Controls.Add(Me.Label2)
266
         Me.Controls.Add(Me.Label2)
267
-        Me.Controls.Add(Me.ComboBox1)
267
+        Me.Controls.Add(Me.YEAR_cb)
268
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
268
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
269
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
269
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
270
         Me.Name = "訂單分析報表二"
270
         Me.Name = "訂單分析報表二"
271
         Me.Text = "Old Unit Comparison"
271
         Me.Text = "Old Unit Comparison"
272
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
273
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit()
274
-        CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).EndInit()
275
-        CType(Me.DataGridView4, System.ComponentModel.ISupportInitialize).EndInit()
276
-        CType(Me.DataGridView5, System.ComponentModel.ISupportInitialize).EndInit()
277
-        CType(Me.DataGridView6, System.ComponentModel.ISupportInitialize).EndInit()
278
-        CType(Me.DataGridView7, System.ComponentModel.ISupportInitialize).EndInit()
272
+        CType(Me.分析清單1_dgv, System.ComponentModel.ISupportInitialize).EndInit()
273
+        CType(Me.分析清單2_dgv, System.ComponentModel.ISupportInitialize).EndInit()
274
+        CType(Me.分析清單3_dgv, System.ComponentModel.ISupportInitialize).EndInit()
275
+        CType(Me.分析清單4_dgv, System.ComponentModel.ISupportInitialize).EndInit()
276
+        CType(Me.分析清單5_dgv, System.ComponentModel.ISupportInitialize).EndInit()
277
+        CType(Me.分析清單6_dgv, System.ComponentModel.ISupportInitialize).EndInit()
278
+        CType(Me.分析清單7_dgv, System.ComponentModel.ISupportInitialize).EndInit()
279
         Me.ResumeLayout(False)
279
         Me.ResumeLayout(False)
280
         Me.PerformLayout()
280
         Me.PerformLayout()
281
 
281
 
282
     End Sub
282
     End Sub
283
 
283
 
284
-    Friend WithEvents ComboBox1 As ComboBox
284
+    Friend WithEvents YEAR_cb As ComboBox
285
     Friend WithEvents Label2 As Label
285
     Friend WithEvents Label2 As Label
286
-    Friend WithEvents Button1 As Button
287
-    Friend WithEvents DataGridView1 As DataGridView
288
-    Friend WithEvents DataGridView2 As DataGridView
289
-    Friend WithEvents DataGridView3 As DataGridView
286
+    Friend WithEvents Query_bt As Button
287
+    Friend WithEvents 分析清單1_dgv As DataGridView
288
+    Friend WithEvents 分析清單2_dgv As DataGridView
289
+    Friend WithEvents 分析清單3_dgv As DataGridView
290
     Friend WithEvents Label1 As Label
290
     Friend WithEvents Label1 As Label
291
-    Friend WithEvents ComboBox2 As ComboBox
292
-    Friend WithEvents DataGridView4 As DataGridView
293
-    Friend WithEvents DataGridView5 As DataGridView
294
-    Friend WithEvents DataGridView6 As DataGridView
291
+    Friend WithEvents YEAR1_cb As ComboBox
292
+    Friend WithEvents 分析清單4_dgv As DataGridView
293
+    Friend WithEvents 分析清單5_dgv As DataGridView
294
+    Friend WithEvents 分析清單6_dgv As DataGridView
295
     Friend WithEvents Label3 As Label
295
     Friend WithEvents Label3 As Label
296
-    Friend WithEvents ComboBox3 As ComboBox
297
-    Friend WithEvents DataGridView7 As DataGridView
298
-    Friend WithEvents Button2 As Button
299
-    Friend WithEvents Button3 As Button
300
-    Friend WithEvents Button4 As Button
301
-    Friend WithEvents Button5 As Button
296
+    Friend WithEvents YEAR2_cb As ComboBox
297
+    Friend WithEvents 分析清單7_dgv As DataGridView
298
+    Friend WithEvents ADD_bt As Button
299
+    Friend WithEvents MODIFY_bt As Button
300
+    Friend WithEvents DELETE_bt As Button
301
+    Friend WithEvents PRINT_bt As Button
302
 End Class
302
 End Class
303
 
303
 

+ 124
- 124
TENDEN-MES-SYS/彙總報表管理/訂單分析報表二.vb 查看文件

7
     Dim ds As New DataSet : Dim ds1 As New DataSet : Dim ds2 As New DataSet : Dim ds3 As New DataSet : Dim ds4 As New DataSet : Dim ds5 As New DataSet : Dim ds6 As New DataSet
7
     Dim ds As New DataSet : Dim ds1 As New DataSet : Dim ds2 As New DataSet : Dim ds3 As New DataSet : Dim ds4 As New DataSet : Dim ds5 As New DataSet : Dim ds6 As New DataSet
8
     Dim dr As SqlDataReader
8
     Dim dr As SqlDataReader
9
     Private  Sub Set_DGV1載入前設定()
9
     Private  Sub Set_DGV1載入前設定()
10
-        DataGridView1.DataSource = Nothing : ds.Clear()
11
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
-        DataGridView1.ColumnHeadersHeight = 25
13
-        DataGridView1.AllowUserToAddRows = False
10
+        分析清單1_dgv.DataSource = Nothing : ds.Clear()
11
+        分析清單1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
+        分析清單1_dgv.ColumnHeadersHeight = 25
13
+        分析清單1_dgv.AllowUserToAddRows = False
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
15
     End Sub
15
     End Sub
16
-    Private  Sub Set_DGV1載入後設定()
17
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
16
+    Private Sub Set_DGV1載入後設定()
17
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 分析清單1_dgv.DataSource = ds.Tables(0) : conn.Close()
18
     End Sub
18
     End Sub
19
-    Private  Sub Set_分析清單1()
19
+    Private Sub Set_分析清單1()
20
         Set_DGV1載入前設定()
20
         Set_DGV1載入前設定()
21
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month , SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
21
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month , SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
22
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox1.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
22
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
23
         Set_DGV1載入後設定()
23
         Set_DGV1載入後設定()
24
     End Sub
24
     End Sub
25
-    Private  Sub Set_DGV2載入前設定()
26
-        DataGridView2.DataSource = Nothing : ds1.Clear()
27
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
28
-        DataGridView2.ColumnHeadersHeight = 25
29
-        DataGridView2.AllowUserToAddRows = False
25
+    Private Sub Set_DGV2載入前設定()
26
+        分析清單2_dgv.DataSource = Nothing : ds1.Clear()
27
+        分析清單2_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
28
+        分析清單2_dgv.ColumnHeadersHeight = 25
29
+        分析清單2_dgv.AllowUserToAddRows = False
30
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
30
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
31
     End Sub
31
     End Sub
32
-    Private  Sub Set_DGV2載入後設定()
33
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
32
+    Private Sub Set_DGV2載入後設定()
33
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : 分析清單2_dgv.DataSource = ds1.Tables(0) : conn.Close()
34
     End Sub
34
     End Sub
35
-    Private  Sub Set_分析清單2()
35
+    Private Sub Set_分析清單2()
36
         Set_DGV2載入前設定()
36
         Set_DGV2載入前設定()
37
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
37
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
38
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox1.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
38
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
39
         Set_DGV2載入後設定()
39
         Set_DGV2載入後設定()
40
     End Sub
40
     End Sub
41
-    Private  Sub Set_DGV3載入前設定()
42
-        DataGridView3.DataSource = Nothing : ds2.Clear()
43
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
44
-        DataGridView3.ColumnHeadersHeight = 25
45
-        DataGridView3.AllowUserToAddRows = False
41
+    Private Sub Set_DGV3載入前設定()
42
+        分析清單3_dgv.DataSource = Nothing : ds2.Clear()
43
+        分析清單3_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
44
+        分析清單3_dgv.ColumnHeadersHeight = 25
45
+        分析清單3_dgv.AllowUserToAddRows = False
46
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
46
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
47
     End Sub
47
     End Sub
48
-    Private  Sub Set_DGV3載入後設定()
49
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
48
+    Private Sub Set_DGV3載入後設定()
49
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : 分析清單3_dgv.DataSource = ds2.Tables(0) : conn.Close()
50
     End Sub
50
     End Sub
51
-    Private  Sub Set_分析清單3()
51
+    Private Sub Set_分析清單3()
52
         Set_DGV3載入前設定()
52
         Set_DGV3載入前設定()
53
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
53
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
54
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox2.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
54
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR1_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
55
         Set_DGV3載入後設定()
55
         Set_DGV3載入後設定()
56
     End Sub
56
     End Sub
57
-    Private  Sub Set_DGV4載入前設定()
58
-        DataGridView4.DataSource = Nothing : ds3.Clear()
59
-        DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
60
-        DataGridView4.ColumnHeadersHeight = 25
61
-        DataGridView4.AllowUserToAddRows = False
57
+    Private Sub Set_DGV4載入前設定()
58
+        分析清單4_dgv.DataSource = Nothing : ds3.Clear()
59
+        分析清單4_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
60
+        分析清單4_dgv.ColumnHeadersHeight = 25
61
+        分析清單4_dgv.AllowUserToAddRows = False
62
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
62
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
63
     End Sub
63
     End Sub
64
-    Private  Sub Set_DGV4載入後設定()
65
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
64
+    Private Sub Set_DGV4載入後設定()
65
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : 分析清單4_dgv.DataSource = ds3.Tables(0) : conn.Close()
66
     End Sub
66
     End Sub
67
-    Private  Sub Set_分析清單4()
67
+    Private Sub Set_分析清單4()
68
         Set_DGV4載入前設定()
68
         Set_DGV4載入前設定()
69
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
69
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
70
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox2.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
70
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR1_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
71
         Set_DGV4載入後設定()
71
         Set_DGV4載入後設定()
72
     End Sub
72
     End Sub
73
-    Private  Sub Set_DGV5載入前設定()
74
-        DataGridView5.DataSource = Nothing : ds4.Clear()
75
-        DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
76
-        DataGridView5.ColumnHeadersHeight = 25
77
-        DataGridView5.AllowUserToAddRows = False
73
+    Private Sub Set_DGV5載入前設定()
74
+        分析清單5_dgv.DataSource = Nothing : ds4.Clear()
75
+        分析清單5_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
76
+        分析清單5_dgv.ColumnHeadersHeight = 25
77
+        分析清單5_dgv.AllowUserToAddRows = False
78
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
78
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
79
     End Sub
79
     End Sub
80
-    Private  Sub Set_DGV5載入後設定()
81
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
80
+    Private Sub Set_DGV5載入後設定()
81
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : 分析清單5_dgv.DataSource = ds4.Tables(0) : conn.Close()
82
     End Sub
82
     End Sub
83
-    Private  Sub Set_分析清單5()
83
+    Private Sub Set_分析清單5()
84
         Set_DGV5載入前設定()
84
         Set_DGV5載入前設定()
85
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
85
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
86
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox3.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
86
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR2_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7) ORDER BY   Year_Month"
87
         Set_DGV5載入後設定()
87
         Set_DGV5載入後設定()
88
     End Sub
88
     End Sub
89
-    Private  Sub Set_DGV6載入前設定()
90
-        DataGridView6.DataSource = Nothing : ds5.Clear()
91
-        DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
92
-        DataGridView6.ColumnHeadersHeight = 25
93
-        DataGridView6.AllowUserToAddRows = False
89
+    Private Sub Set_DGV6載入前設定()
90
+        分析清單6_dgv.DataSource = Nothing : ds5.Clear()
91
+        分析清單6_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
92
+        分析清單6_dgv.ColumnHeadersHeight = 25
93
+        分析清單6_dgv.AllowUserToAddRows = False
94
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
94
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
95
     End Sub
95
     End Sub
96
-    Private  Sub Set_DGV6載入後設定()
97
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
96
+    Private Sub Set_DGV6載入後設定()
97
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : 分析清單6_dgv.DataSource = ds5.Tables(0) : conn.Close()
98
     End Sub
98
     End Sub
99
-    Private  Sub Set_分析清單6()
99
+    Private Sub Set_分析清單6()
100
         Set_DGV6載入前設定()
100
         Set_DGV6載入前設定()
101
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
101
         SQL1 = "SELECT LEFT(客戶交期, 7) AS Year_Month, 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 " &
102
-               "WHERE (LEFT(客戶交期, 4) LIKE '" & ComboBox3.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
102
+               "WHERE (LEFT(客戶交期, 4) LIKE '" & YEAR2_cb.Text & "') AND (CXL IS NULL OR CXL = 0) GROUP BY   LEFT(客戶交期, 7), 訂單種類 ORDER BY   Year_Month"
103
         Set_DGV6載入後設定()
103
         Set_DGV6載入後設定()
104
     End Sub
104
     End Sub
105
-    Private  Sub Set_DGV7載入前設定()
106
-        DataGridView7.DataSource = Nothing : ds6.Clear()
107
-        DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
108
-        DataGridView7.ColumnHeadersHeight = 25
109
-        DataGridView7.AllowUserToAddRows = False
105
+    Private Sub Set_DGV7載入前設定()
106
+        分析清單7_dgv.DataSource = Nothing : ds6.Clear()
107
+        分析清單7_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
108
+        分析清單7_dgv.ColumnHeadersHeight = 25
109
+        分析清單7_dgv.AllowUserToAddRows = False
110
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
110
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
111
     End Sub
111
     End Sub
112
-    Private  Sub Set_DGV7載入後設定()
113
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6) : DataGridView7.DataSource = ds6.Tables(0) : conn.Close()
112
+    Private Sub Set_DGV7載入後設定()
113
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6) : 分析清單7_dgv.DataSource = ds6.Tables(0) : conn.Close()
114
     End Sub
114
     End Sub
115
-    Private  Sub Set_分析清單7()
115
+    Private Sub Set_分析清單7()
116
         Set_DGV7載入前設定()
116
         Set_DGV7載入前設定()
117
         SQL1 = "SELECT 年月份 AS Year_Month, 預估數量 AS Assess_QTY, 預估單價 AS Assess_Price FROM 訂單預估資料表 ORDER BY 年月份 DESC"
117
         SQL1 = "SELECT 年月份 AS Year_Month, 預估數量 AS Assess_QTY, 預估單價 AS Assess_Price FROM 訂單預估資料表 ORDER BY 年月份 DESC"
118
         Set_DGV7載入後設定()
118
         Set_DGV7載入後設定()
119
     End Sub
119
     End Sub
120
-    Private  Sub Set_grid()
121
-        DataGridView1.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(3).DefaultCellStyle.Format = "#,##0.00"
122
-        DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
123
-        DataGridView1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
124
-        DataGridView1.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
125
-        DataGridView1.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
120
+    Private Sub Set_grid()
121
+        分析清單1_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單1_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單1_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
122
+        分析清單1_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
123
+        分析清單1_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單1_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
124
+        分析清單1_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
125
+        分析清單1_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單1_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
126
 
126
 
127
-        DataGridView2.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(3).DefaultCellStyle.Format = "#,##0.00" : DataGridView2.Columns(4).DefaultCellStyle.Format = "#,##0.00"
128
-        DataGridView2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
129
-        DataGridView2.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
130
-        DataGridView2.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
131
-        DataGridView2.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
127
+        分析清單2_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 分析清單2_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00" : 分析清單2_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00"
128
+        分析清單2_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
129
+        分析清單2_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單2_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
130
+        分析清單2_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
131
+        分析清單2_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單2_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
132
 
132
 
133
-        DataGridView3.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(3).DefaultCellStyle.Format = "#,##0.00"
134
-        DataGridView3.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
135
-        DataGridView3.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
136
-        DataGridView3.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
137
-        DataGridView3.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
133
+        分析清單3_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單3_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單3_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
134
+        分析清單3_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
135
+        分析清單3_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單3_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
136
+        分析清單3_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
137
+        分析清單3_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單3_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
138
 
138
 
139
-        DataGridView4.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(3).DefaultCellStyle.Format = "#,##0.00" : DataGridView4.Columns(4).DefaultCellStyle.Format = "#,##0.00"
140
-        DataGridView4.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
141
-        DataGridView4.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
142
-        DataGridView4.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
143
-        DataGridView4.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
139
+        分析清單4_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 分析清單4_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00" : 分析清單4_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00"
140
+        分析清單4_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
141
+        分析清單4_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單4_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
142
+        分析清單4_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
143
+        分析清單4_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單4_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
144
 
144
 
145
-        DataGridView5.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView5.Columns(3).DefaultCellStyle.Format = "#,##0.00"
146
-        DataGridView5.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
147
-        DataGridView5.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
148
-        DataGridView5.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
149
-        DataGridView5.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
145
+        分析清單5_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單5_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單5_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
146
+        分析清單5_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
147
+        分析清單5_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單5_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
148
+        分析清單5_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
149
+        分析清單5_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單5_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
150
 
150
 
151
-        DataGridView6.Columns(2).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(3).DefaultCellStyle.Format = "#,##0.00" : DataGridView6.Columns(4).DefaultCellStyle.Format = "#,##0.00"
152
-        DataGridView6.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
153
-        DataGridView6.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
154
-        DataGridView6.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
155
-        DataGridView6.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
151
+        分析清單6_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 分析清單6_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00" : 分析清單6_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.00"
152
+        分析清單6_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
153
+        分析清單6_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單6_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
154
+        分析清單6_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
155
+        分析清單6_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單6_dgv.Columns(4).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
156
 
156
 
157
-        DataGridView7.Columns(0).Width = 85 : DataGridView7.Columns(1).Width = 85 : DataGridView7.Columns(2).Width = 85
158
-        DataGridView7.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView7.Columns(2).DefaultCellStyle.Format = "#,##0.00"
159
-        DataGridView7.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
160
-        DataGridView7.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
161
-        DataGridView7.EditMode = DataGridViewEditMode.EditOnEnter
157
+        分析清單7_dgv.Columns(0).Width = 85 : 分析清單7_dgv.Columns(1).Width = 85 : 分析清單7_dgv.Columns(2).Width = 85
158
+        分析清單7_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單7_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00"
159
+        分析清單7_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單7_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
160
+        分析清單7_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單7_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
161
+        分析清單7_dgv.EditMode = DataGridViewEditMode.EditOnEnter
162
     End Sub
162
     End Sub
163
-    Private  Sub 訂單分析報表二_Load(sender As Object, e As EventArgs) Handles MyBase.Load
163
+    Private Sub 訂單分析報表二_Load(sender As Object, e As EventArgs) Handles MyBase.Load
164
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
164
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
165
-        ComboBox1.Text = Year(Now)
166
-        ComboBox2.Text = Year(Now) - 1
167
-        ComboBox3.Text = Year(Now) - 2
165
+        YEAR_cb.Text = Year(Now)
166
+        YEAR1_cb.Text = Year(Now) - 1
167
+        YEAR2_cb.Text = Year(Now) - 2
168
         Set_分析清單7()
168
         Set_分析清單7()
169
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
169
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6()
170
         Set_grid()
170
         Set_grid()
171
     End Sub
171
     End Sub
172
-    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
172
+    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Query_bt.Click
173
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6() : Set_grid()
173
         Set_分析清單1() : Set_分析清單2() : Set_分析清單3() : Set_分析清單4() : Set_分析清單5() : Set_分析清單6() : Set_grid()
174
     End Sub
174
     End Sub
175
-    Private  Sub DataGridView2_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView2.RowPostPaint
175
+    Private Sub DataGridView2_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 分析清單2_dgv.RowPostPaint
176
         Dim linePen As New Pen(Color.Blue, 2)
176
         Dim linePen As New Pen(Color.Blue, 2)
177
-        If e.RowIndex = DataGridView2.Rows.Count - 1 Then
177
+        If e.RowIndex = 分析清單2_dgv.Rows.Count - 1 Then
178
             Exit Sub
178
             Exit Sub
179
         Else
179
         Else
180
-            If DataGridView2(0, e.RowIndex).Value.ToString <> DataGridView2(0, e.RowIndex + 1).Value.ToString Then
181
-                Dim startX As Integer = IIf(DataGridView2.RowHeadersVisible, DataGridView2.RowHeadersWidth, 0)
180
+            If 分析清單2_dgv(0, e.RowIndex).Value.ToString <> 分析清單2_dgv(0, e.RowIndex + 1).Value.ToString Then
181
+                Dim startX As Integer = IIf(分析清單2_dgv.RowHeadersVisible, 分析清單2_dgv.RowHeadersWidth, 0)
182
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
182
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
183
-                Dim endX As Integer = startX + DataGridView2.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView2.HorizontalScrollingOffset
183
+                Dim endX As Integer = startX + 分析清單2_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 分析清單2_dgv.HorizontalScrollingOffset
184
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
184
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
185
                 Exit Sub
185
                 Exit Sub
186
             End If
186
             End If
187
         End If
187
         End If
188
     End Sub
188
     End Sub
189
-    Private  Sub DataGridView4_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView4.RowPostPaint
189
+    Private Sub DataGridView4_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 分析清單4_dgv.RowPostPaint
190
         Dim linePen As New Pen(Color.Blue, 2)
190
         Dim linePen As New Pen(Color.Blue, 2)
191
-        If e.RowIndex = DataGridView4.Rows.Count - 1 Then
191
+        If e.RowIndex = 分析清單4_dgv.Rows.Count - 1 Then
192
             Exit Sub
192
             Exit Sub
193
         Else
193
         Else
194
-            If DataGridView4(0, e.RowIndex).Value.ToString <> DataGridView4(0, e.RowIndex + 1).Value.ToString Then
195
-                Dim startX As Integer = IIf(DataGridView4.RowHeadersVisible, DataGridView4.RowHeadersWidth, 0)
194
+            If 分析清單4_dgv(0, e.RowIndex).Value.ToString <> 分析清單4_dgv(0, e.RowIndex + 1).Value.ToString Then
195
+                Dim startX As Integer = IIf(分析清單4_dgv.RowHeadersVisible, 分析清單4_dgv.RowHeadersWidth, 0)
196
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
196
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
197
-                Dim endX As Integer = startX + DataGridView4.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView4.HorizontalScrollingOffset
197
+                Dim endX As Integer = startX + 分析清單4_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 分析清單4_dgv.HorizontalScrollingOffset
198
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
198
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
199
                 Exit Sub
199
                 Exit Sub
200
             End If
200
             End If
201
         End If
201
         End If
202
     End Sub
202
     End Sub
203
-    Private  Sub DataGridView6_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView6.RowPostPaint
203
+    Private Sub DataGridView6_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 分析清單6_dgv.RowPostPaint
204
         Dim linePen As New Pen(Color.Blue, 2)
204
         Dim linePen As New Pen(Color.Blue, 2)
205
-        If e.RowIndex = DataGridView6.Rows.Count - 1 Then
205
+        If e.RowIndex = 分析清單6_dgv.Rows.Count - 1 Then
206
             Exit Sub
206
             Exit Sub
207
         Else
207
         Else
208
-            If DataGridView6(0, e.RowIndex).Value.ToString <> DataGridView6(0, e.RowIndex + 1).Value.ToString Then
209
-                Dim startX As Integer = IIf(DataGridView6.RowHeadersVisible, DataGridView6.RowHeadersWidth, 0)
208
+            If 分析清單6_dgv(0, e.RowIndex).Value.ToString <> 分析清單6_dgv(0, e.RowIndex + 1).Value.ToString Then
209
+                Dim startX As Integer = IIf(分析清單6_dgv.RowHeadersVisible, 分析清單6_dgv.RowHeadersWidth, 0)
210
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
210
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
211
-                Dim endX As Integer = startX + DataGridView6.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView6.HorizontalScrollingOffset
211
+                Dim endX As Integer = startX + 分析清單6_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 分析清單6_dgv.HorizontalScrollingOffset
212
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
212
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
213
                 Exit Sub
213
                 Exit Sub
214
             End If
214
             End If
215
         End If
215
         End If
216
     End Sub
216
     End Sub
217
-    Private  Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
217
+    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles PRINT_bt.Click
218
         列印_訂單分析二.Show()
218
         列印_訂單分析二.Show()
219
     End Sub
219
     End Sub
220
-    Private  Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
220
+    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles ADD_bt.Click
221
         Dim PA1 As String : Dim PA2 As String : Dim PA3 As String
221
         Dim PA1 As String : Dim PA2 As String : Dim PA3 As String
222
         PA1 = InputBox("請輸入要欲新增之年月份")
222
         PA1 = InputBox("請輸入要欲新增之年月份")
223
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
223
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
238
         End If
238
         End If
239
         Set_分析清單7() : Set_grid()
239
         Set_分析清單7() : Set_grid()
240
     End Sub
240
     End Sub
241
-    Private  Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
242
-        For i As Integer = 0 To DataGridView7.Rows.Count - 1
241
+    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles MODIFY_bt.Click
242
+        For i As Integer = 0 To 分析清單7_dgv.Rows.Count - 1
243
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
243
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
244
-            SQL1 = "UPDATE 訂單預估資料表 SET  預估數量 = '" & DataGridView7.Rows(i).Cells("Assess_QTY").Value & "', 預估單價 = '" & DataGridView7.Rows(i).Cells("Assess_Price").Value & "' " &
245
-                   "WHERE (年月份 LIKE '" & DataGridView7.Rows(i).Cells("Year_Month").Value & "')"
244
+            SQL1 = "UPDATE 訂單預估資料表 SET  預估數量 = '" & 分析清單7_dgv.Rows(i).Cells("Assess_QTY").Value & "', 預估單價 = '" & 分析清單7_dgv.Rows(i).Cells("Assess_Price").Value & "' " &
245
+                   "WHERE (年月份 LIKE '" & 分析清單7_dgv.Rows(i).Cells("Year_Month").Value & "')"
246
             cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
246
             cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
247
         Next i
247
         Next i
248
         Set_分析清單7() : Set_grid()
248
         Set_分析清單7() : Set_grid()
249
         MsgBox("修改完成")
249
         MsgBox("修改完成")
250
     End Sub
250
     End Sub
251
-    Private  Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
251
+    Private  Sub Button4_Click(sender As Object, e As EventArgs) Handles DELETE_bt.Click
252
 
252
 
253
     End Sub
253
     End Sub
254
 End Class
254
 End Class

+ 686
- 686
TENDEN-MES-SYS/彙總報表管理/訂單分析報表五.Designer.vb
文件差異過大導致無法顯示
查看文件


+ 235
- 230
TENDEN-MES-SYS/彙總報表管理/訂單分析報表五.vb 查看文件

9
     Dim ds14 As New DataSet
9
     Dim ds14 As New DataSet
10
     Dim dr As SqlDataReader
10
     Dim dr As SqlDataReader
11
     Private  Sub Set_DGV1載入前設定()
11
     Private  Sub Set_DGV1載入前設定()
12
-        DataGridView1.DataSource = Nothing : ds.Clear()
13
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
14
-        DataGridView1.ColumnHeadersHeight = 25
15
-        DataGridView1.AllowUserToAddRows = False
12
+        訂單控制表_dgv.DataSource = Nothing : ds.Clear()
13
+        訂單控制表_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
14
+        訂單控制表_dgv.ColumnHeadersHeight = 25
15
+        訂單控制表_dgv.AllowUserToAddRows = False
16
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
16
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
17
     End Sub
17
     End Sub
18
-    Private  Sub Set_DGV1載入後設定()
19
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
18
+    Private Sub Set_DGV1載入後設定()
19
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 訂單控制表_dgv.DataSource = ds.Tables(0) : conn.Close()
20
     End Sub
20
     End Sub
21
-    Private  Sub Set_分析清單1()
21
+    Private Sub Set_分析清單1()
22
         Set_DGV1載入前設定()
22
         Set_DGV1載入前設定()
23
-        SQL1 = "SELECT 年度 AS YEAR, P, 開始日期 AS Start_date, 結束日期 AS Closing_date FROM NEW_U_C_時間間格 WHERE (年度 LIKE '" & ComboBox1.Text & "') ORDER BY 開始日期"
23
+        SQL1 = "SELECT 年度 AS YEAR, P, 開始日期 AS Start_date, 結束日期 AS Closing_date FROM NEW_U_C_時間間格 WHERE (年度 LIKE '" & 年度_cb.Text & "') ORDER BY 開始日期"
24
         Set_DGV1載入後設定()
24
         Set_DGV1載入後設定()
25
     End Sub
25
     End Sub
26
-    Private  Sub Set_DGV2載入前設定()
27
-        DataGridView2.DataSource = Nothing : ds1.Clear()
28
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
29
-        DataGridView2.ColumnHeadersHeight = 25
30
-        DataGridView2.AllowUserToAddRows = False
26
+    Private Sub Set_DGV2載入前設定()
27
+        分析清單_dgv.DataSource = Nothing : ds1.Clear()
28
+        分析清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
29
+        分析清單_dgv.ColumnHeadersHeight = 25
30
+        分析清單_dgv.AllowUserToAddRows = False
31
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
31
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
32
     End Sub
32
     End Sub
33
-    Private  Sub Set_DGV2載入後設定()
34
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
33
+    Private Sub Set_DGV2載入後設定()
34
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : 分析清單_dgv.DataSource = ds1.Tables(0) : conn.Close()
35
     End Sub
35
     End Sub
36
-    Private  Sub Set_DGV3載入前設定()
37
-        DataGridView3.DataSource = Nothing : ds2.Clear()
38
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
39
-        DataGridView3.ColumnHeadersHeight = 25
40
-        DataGridView3.AllowUserToAddRows = False
36
+    Private Sub Set_DGV3載入前設定()
37
+        分析清單1_dgv.DataSource = Nothing : ds2.Clear()
38
+        分析清單1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
39
+        分析清單1_dgv.ColumnHeadersHeight = 25
40
+        分析清單1_dgv.AllowUserToAddRows = False
41
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
41
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
42
     End Sub
42
     End Sub
43
-    Private  Sub Set_DGV3載入後設定()
44
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
43
+    Private Sub Set_DGV3載入後設定()
44
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : 分析清單1_dgv.DataSource = ds2.Tables(0) : conn.Close()
45
     End Sub
45
     End Sub
46
-    Private  Sub Set_DGV4載入前設定()
47
-        DataGridView4.DataSource = Nothing : ds3.Clear()
48
-        DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
49
-        DataGridView4.ColumnHeadersHeight = 25
50
-        DataGridView4.AllowUserToAddRows = False
46
+    Private Sub Set_DGV4載入前設定()
47
+        分析清單2_dgv.DataSource = Nothing : ds3.Clear()
48
+        分析清單2_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
49
+        分析清單2_dgv.ColumnHeadersHeight = 25
50
+        分析清單2_dgv.AllowUserToAddRows = False
51
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
51
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
52
     End Sub
52
     End Sub
53
-    Private  Sub Set_DGV4載入後設定()
54
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
53
+    Private Sub Set_DGV4載入後設定()
54
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds3) : 分析清單2_dgv.DataSource = ds3.Tables(0) : conn.Close()
55
     End Sub
55
     End Sub
56
-    Private  Sub Set_DGV5載入前設定()
57
-        DataGridView5.DataSource = Nothing : ds4.Clear()
58
-        DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
59
-        DataGridView5.ColumnHeadersHeight = 25
60
-        DataGridView5.AllowUserToAddRows = False
56
+    Private Sub Set_DGV5載入前設定()
57
+        分析清單3_dgv.DataSource = Nothing : ds4.Clear()
58
+        分析清單3_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
59
+        分析清單3_dgv.ColumnHeadersHeight = 25
60
+        分析清單3_dgv.AllowUserToAddRows = False
61
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
61
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
62
     End Sub
62
     End Sub
63
-    Private  Sub Set_DGV5載入後設定()
64
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
63
+    Private Sub Set_DGV5載入後設定()
64
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds4) : 分析清單3_dgv.DataSource = ds4.Tables(0) : conn.Close()
65
     End Sub
65
     End Sub
66
-    Private  Sub Set_DGV6載入前設定()
67
-        DataGridView6.DataSource = Nothing : ds5.Clear()
68
-        DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
69
-        DataGridView6.ColumnHeadersHeight = 25
70
-        DataGridView6.AllowUserToAddRows = False
66
+    Private Sub Set_DGV6載入前設定()
67
+        分析清單4_dgv.DataSource = Nothing : ds5.Clear()
68
+        分析清單4_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
69
+        分析清單4_dgv.ColumnHeadersHeight = 25
70
+        分析清單4_dgv.AllowUserToAddRows = False
71
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
71
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
72
     End Sub
72
     End Sub
73
-    Private  Sub Set_DGV6載入後設定()
74
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
73
+    Private Sub Set_DGV6載入後設定()
74
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds5) : 分析清單4_dgv.DataSource = ds5.Tables(0) : conn.Close()
75
     End Sub
75
     End Sub
76
-    Private  Sub Set_DGV7載入前設定()
77
-        DataGridView7.DataSource = Nothing : ds6.Clear()
78
-        DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
79
-        DataGridView7.ColumnHeadersHeight = 25
80
-        DataGridView7.AllowUserToAddRows = False
76
+    Private Sub Set_DGV7載入前設定()
77
+        分析清單5_dgv.DataSource = Nothing : ds6.Clear()
78
+        分析清單5_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
79
+        分析清單5_dgv.ColumnHeadersHeight = 25
80
+        分析清單5_dgv.AllowUserToAddRows = False
81
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
81
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
82
     End Sub
82
     End Sub
83
-    Private  Sub Set_DGV7載入後設定()
84
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6) : DataGridView7.DataSource = ds6.Tables(0) : conn.Close()
83
+    Private Sub Set_DGV7載入後設定()
84
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds6) : 分析清單5_dgv.DataSource = ds6.Tables(0) : conn.Close()
85
     End Sub
85
     End Sub
86
-    Private  Sub Set_DGV8載入前設定()
87
-        DataGridView8.DataSource = Nothing : ds7.Clear()
88
-        DataGridView8.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
89
-        DataGridView8.ColumnHeadersHeight = 25
90
-        DataGridView8.AllowUserToAddRows = False
86
+    Private Sub Set_DGV8載入前設定()
87
+        分析清單6_dgv.DataSource = Nothing : ds7.Clear()
88
+        分析清單6_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
89
+        分析清單6_dgv.ColumnHeadersHeight = 25
90
+        分析清單6_dgv.AllowUserToAddRows = False
91
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
91
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
92
     End Sub
92
     End Sub
93
-    Private  Sub Set_DGV8載入後設定()
94
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds7) : DataGridView8.DataSource = ds7.Tables(0) : conn.Close()
93
+    Private Sub Set_DGV8載入後設定()
94
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds7) : 分析清單6_dgv.DataSource = ds7.Tables(0) : conn.Close()
95
     End Sub
95
     End Sub
96
-    Private  Sub Set_DGV9載入前設定()
97
-        DataGridView9.DataSource = Nothing : ds8.Clear()
98
-        DataGridView9.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
99
-        DataGridView9.ColumnHeadersHeight = 25
100
-        DataGridView9.AllowUserToAddRows = False
96
+    Private Sub Set_DGV9載入前設定()
97
+        分析清單7_dgv.DataSource = Nothing : ds8.Clear()
98
+        分析清單7_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
99
+        分析清單7_dgv.ColumnHeadersHeight = 25
100
+        分析清單7_dgv.AllowUserToAddRows = False
101
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
101
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
102
     End Sub
102
     End Sub
103
-    Private  Sub Set_DGV9載入後設定()
104
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds8) : DataGridView9.DataSource = ds8.Tables(0) : conn.Close()
103
+    Private Sub Set_DGV9載入後設定()
104
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds8) : 分析清單7_dgv.DataSource = ds8.Tables(0) : conn.Close()
105
     End Sub
105
     End Sub
106
-    Private  Sub Set_DGV10載入前設定()
107
-        DataGridView10.DataSource = Nothing : ds9.Clear()
108
-        DataGridView10.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
109
-        DataGridView10.ColumnHeadersHeight = 25
110
-        DataGridView10.AllowUserToAddRows = False
106
+    Private Sub Set_DGV10載入前設定()
107
+        分析清單8_dgv.DataSource = Nothing : ds9.Clear()
108
+        分析清單8_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
109
+        分析清單8_dgv.ColumnHeadersHeight = 25
110
+        分析清單8_dgv.AllowUserToAddRows = False
111
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
111
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
112
     End Sub
112
     End Sub
113
-    Private  Sub Set_DGV10載入後設定()
114
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds9) : DataGridView10.DataSource = ds9.Tables(0) : conn.Close()
113
+    Private Sub Set_DGV10載入後設定()
114
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds9) : 分析清單8_dgv.DataSource = ds9.Tables(0) : conn.Close()
115
     End Sub
115
     End Sub
116
-    Private  Sub Set_DGV11載入前設定()
117
-        DataGridView11.DataSource = Nothing : ds10.Clear()
118
-        DataGridView11.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
119
-        DataGridView11.ColumnHeadersHeight = 25
120
-        DataGridView11.AllowUserToAddRows = False
116
+    Private Sub Set_DGV11載入前設定()
117
+        分析清單9_dgv.DataSource = Nothing : ds10.Clear()
118
+        分析清單9_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
119
+        分析清單9_dgv.ColumnHeadersHeight = 25
120
+        分析清單9_dgv.AllowUserToAddRows = False
121
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
121
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
122
     End Sub
122
     End Sub
123
-    Private  Sub Set_DGV11載入後設定()
124
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds10) : DataGridView11.DataSource = ds10.Tables(0) : conn.Close()
123
+    Private Sub Set_DGV11載入後設定()
124
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds10) : 分析清單9_dgv.DataSource = ds10.Tables(0) : conn.Close()
125
     End Sub
125
     End Sub
126
-    Private  Sub Set_DGV12載入前設定()
127
-        DataGridView12.DataSource = Nothing : ds11.Clear()
128
-        DataGridView12.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
129
-        DataGridView12.ColumnHeadersHeight = 25
130
-        DataGridView12.AllowUserToAddRows = False
126
+    Private Sub Set_DGV12載入前設定()
127
+        分析清單10_dgv.DataSource = Nothing : ds11.Clear()
128
+        分析清單10_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
129
+        分析清單10_dgv.ColumnHeadersHeight = 25
130
+        分析清單10_dgv.AllowUserToAddRows = False
131
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
131
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
132
     End Sub
132
     End Sub
133
-    Private  Sub Set_DGV12載入後設定()
134
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds11) : DataGridView12.DataSource = ds11.Tables(0) : conn.Close()
133
+    Private Sub Set_DGV12載入後設定()
134
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds11) : 分析清單10_dgv.DataSource = ds11.Tables(0) : conn.Close()
135
     End Sub
135
     End Sub
136
-    Private  Sub Set_DGV13載入前設定()
137
-        DataGridView13.DataSource = Nothing : ds12.Clear()
138
-        DataGridView13.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
139
-        DataGridView13.ColumnHeadersHeight = 25
140
-        DataGridView13.AllowUserToAddRows = False
136
+    Private Sub Set_DGV13載入前設定()
137
+        分析清單11_dgv.DataSource = Nothing : ds12.Clear()
138
+        分析清單11_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
139
+        分析清單11_dgv.ColumnHeadersHeight = 25
140
+        分析清單11_dgv.AllowUserToAddRows = False
141
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
141
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
142
     End Sub
142
     End Sub
143
-    Private  Sub Set_DGV13載入後設定()
144
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds12) : DataGridView13.DataSource = ds12.Tables(0) : conn.Close()
143
+    Private Sub Set_DGV13載入後設定()
144
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds12) : 分析清單11_dgv.DataSource = ds12.Tables(0) : conn.Close()
145
     End Sub
145
     End Sub
146
-    Private  Sub Set_DGV14載入前設定()
147
-        DataGridView14.DataSource = Nothing : ds13.Clear()
148
-        DataGridView14.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
149
-        DataGridView14.ColumnHeadersHeight = 25
150
-        DataGridView14.AllowUserToAddRows = False
146
+    Private Sub Set_DGV14載入前設定()
147
+        分析清單12_dgv.DataSource = Nothing : ds13.Clear()
148
+        分析清單12_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
149
+        分析清單12_dgv.ColumnHeadersHeight = 25
150
+        分析清單12_dgv.AllowUserToAddRows = False
151
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
151
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
152
     End Sub
152
     End Sub
153
-    Private  Sub Set_DGV14載入後設定()
154
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds13) : DataGridView14.DataSource = ds13.Tables(0) : conn.Close()
153
+    Private Sub Set_DGV14載入後設定()
154
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds13) : 分析清單12_dgv.DataSource = ds13.Tables(0) : conn.Close()
155
     End Sub
155
     End Sub
156
-    Private  Sub Set_DGV15載入前設定()
157
-        DataGridView15.DataSource = Nothing : ds14.Clear()
158
-        DataGridView15.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
159
-        DataGridView15.ColumnHeadersHeight = 25
160
-        DataGridView15.AllowUserToAddRows = False
156
+    Private Sub Set_DGV15載入前設定()
157
+        訂單預估資料表2_dgv.DataSource = Nothing : ds14.Clear()
158
+        訂單預估資料表2_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
159
+        訂單預估資料表2_dgv.ColumnHeadersHeight = 25
160
+        訂單預估資料表2_dgv.AllowUserToAddRows = False
161
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
161
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
162
     End Sub
162
     End Sub
163
-    Private  Sub Set_DGV15載入後設定()
164
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds14) : DataGridView15.DataSource = ds14.Tables(0) : conn.Close()
163
+    Private Sub Set_DGV15載入後設定()
164
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds14) : 訂單預估資料表2_dgv.DataSource = ds14.Tables(0) : conn.Close()
165
     End Sub
165
     End Sub
166
-    Private  Sub Set_分析清單7()
166
+    Private Sub Set_分析清單7()
167
         Set_DGV15載入前設定()
167
         Set_DGV15載入前設定()
168
         SQL1 = "SELECT YEAR_P, 預估數量 AS Assess_QTY, 預估單價 AS Assess_Price FROM 訂單預估資料表2 WHERE YEAR_P NOT LIKE '%2017%' AND YEAR_P NOT LIKE '%2018%' ORDER BY YEAR_P DESC"
168
         SQL1 = "SELECT YEAR_P, 預估數量 AS Assess_QTY, 預估單價 AS Assess_Price FROM 訂單預估資料表2 WHERE YEAR_P NOT LIKE '%2017%' AND YEAR_P NOT LIKE '%2018%' ORDER BY YEAR_P DESC"
169
         Set_DGV15載入後設定()
169
         Set_DGV15載入後設定()
170
     End Sub
170
     End Sub
171
-    Private  Sub Set_grid()
172
-        DataGridView2.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView2.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView2.Columns(3).DefaultCellStyle.Format = "#,##0.00"
173
-        DataGridView2.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
174
-        DataGridView2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
175
-        DataGridView2.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
176
-        DataGridView2.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
171
+    Private Sub Set_grid()
172
+        分析清單_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
173
+        分析清單_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
174
+        分析清單_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
175
+        分析清單_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
176
+        分析清單_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
177
 
177
 
178
-        DataGridView3.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(3).DefaultCellStyle.Format = "#,##0.00"
179
-        DataGridView3.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
180
-        DataGridView3.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
181
-        DataGridView3.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
182
-        DataGridView3.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
178
+        分析清單1_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單1_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單1_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
179
+        分析清單1_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
180
+        分析清單1_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單1_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
181
+        分析清單1_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
182
+        分析清單1_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單1_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
183
 
183
 
184
-        DataGridView4.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView4.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView4.Columns(3).DefaultCellStyle.Format = "#,##0.00"
185
-        DataGridView4.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
186
-        DataGridView4.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
187
-        DataGridView4.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
188
-        DataGridView4.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView4.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
184
+        分析清單2_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單2_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單2_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
185
+        分析清單2_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
186
+        分析清單2_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單2_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
187
+        分析清單2_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
188
+        分析清單2_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單2_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
189
 
189
 
190
-        DataGridView5.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView5.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView5.Columns(3).DefaultCellStyle.Format = "#,##0.00"
191
-        DataGridView5.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
192
-        DataGridView5.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
193
-        DataGridView5.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
194
-        DataGridView5.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView5.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
190
+        分析清單3_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單3_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單3_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
191
+        分析清單3_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
192
+        分析清單3_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單3_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
193
+        分析清單3_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
194
+        分析清單3_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單3_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
195
 
195
 
196
-        DataGridView6.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView6.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView6.Columns(3).DefaultCellStyle.Format = "#,##0.00"
197
-        DataGridView6.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
198
-        DataGridView6.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
199
-        DataGridView6.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
200
-        DataGridView6.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView6.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
196
+        分析清單4_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單4_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單4_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
197
+        分析清單4_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
198
+        分析清單4_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單4_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
199
+        分析清單4_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
200
+        分析清單4_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單4_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
201
 
201
 
202
-        DataGridView7.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView7.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView7.Columns(3).DefaultCellStyle.Format = "#,##0.00"
203
-        DataGridView7.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
204
-        DataGridView7.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
205
-        DataGridView7.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
206
-        DataGridView7.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView7.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
202
+        分析清單5_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單5_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單5_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
203
+        分析清單5_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
204
+        分析清單5_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單5_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
205
+        分析清單5_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
206
+        分析清單5_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單5_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
207
 
207
 
208
-        DataGridView8.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView8.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView8.Columns(3).DefaultCellStyle.Format = "#,##0.00"
209
-        DataGridView8.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
210
-        DataGridView8.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView8.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
211
-        DataGridView8.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
212
-        DataGridView8.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView8.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
208
+        分析清單6_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單6_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單6_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
209
+        分析清單6_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
210
+        分析清單6_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單6_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
211
+        分析清單6_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
212
+        分析清單6_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單6_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
213
 
213
 
214
-        DataGridView9.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView9.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView9.Columns(3).DefaultCellStyle.Format = "#,##0.00"
215
-        DataGridView9.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
216
-        DataGridView9.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView9.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
217
-        DataGridView9.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
218
-        DataGridView9.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView9.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
214
+        分析清單7_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單7_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單7_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
215
+        分析清單7_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
216
+        分析清單7_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單7_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
217
+        分析清單7_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
218
+        分析清單7_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單7_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
219
 
219
 
220
-        DataGridView10.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView10.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView10.Columns(3).DefaultCellStyle.Format = "#,##0.00"
221
-        DataGridView10.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
222
-        DataGridView10.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView10.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
223
-        DataGridView10.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
224
-        DataGridView10.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView10.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
220
+        分析清單8_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單8_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單8_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
221
+        分析清單8_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
222
+        分析清單8_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單8_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
223
+        分析清單8_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
224
+        分析清單8_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單8_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
225
 
225
 
226
-        DataGridView11.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView11.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView11.Columns(3).DefaultCellStyle.Format = "#,##0.00"
227
-        DataGridView11.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
228
-        DataGridView11.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView11.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
229
-        DataGridView11.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
230
-        DataGridView11.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView11.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
226
+        分析清單9_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單9_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單9_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
227
+        分析清單9_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
228
+        分析清單9_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單9_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
229
+        分析清單9_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
230
+        分析清單9_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單9_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
231
 
231
 
232
-        DataGridView12.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView12.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView12.Columns(3).DefaultCellStyle.Format = "#,##0.00"
233
-        DataGridView12.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
234
-        DataGridView12.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView12.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
235
-        DataGridView12.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
236
-        DataGridView12.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView12.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
232
+        分析清單10_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單10_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單10_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
233
+        分析清單10_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
234
+        分析清單10_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單10_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
235
+        分析清單10_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
236
+        分析清單10_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單10_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
237
 
237
 
238
-        DataGridView13.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView13.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView13.Columns(3).DefaultCellStyle.Format = "#,##0.00"
239
-        DataGridView13.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
240
-        DataGridView13.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView13.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
241
-        DataGridView13.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
242
-        DataGridView13.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView13.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
238
+        分析清單11_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單11_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單11_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
239
+        分析清單11_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
240
+        分析清單11_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單11_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
241
+        分析清單11_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
242
+        分析清單11_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單11_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
243
 
243
 
244
-        DataGridView14.Columns(0).Width = 95 : DataGridView14.Columns(1).Width = 100 : DataGridView14.Columns(2).Width = 100 : DataGridView14.Columns(3).Width = 85
245
-        DataGridView14.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView14.Columns(2).DefaultCellStyle.Format = "#,##0.00" : DataGridView14.Columns(3).DefaultCellStyle.Format = "#,##0.00"
246
-        DataGridView14.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
247
-        DataGridView14.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView14.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
248
-        DataGridView14.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
249
-        DataGridView14.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView14.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
244
+        分析清單12_dgv.Columns(0).Width = 95 : 分析清單12_dgv.Columns(1).Width = 100 : 分析清單12_dgv.Columns(2).Width = 100 : 分析清單12_dgv.Columns(3).Width = 85
245
+        分析清單12_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 分析清單12_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00" : 分析清單12_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.00"
246
+        分析清單12_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
247
+        分析清單12_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單12_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
248
+        分析清單12_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
249
+        分析清單12_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : 分析清單12_dgv.Columns(3).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
250
 
250
 
251
-        DataGridView15.Columns(0).Width = 125 : DataGridView15.Columns(1).Width = 130 : DataGridView15.Columns(2).Width = 130
252
-        DataGridView15.Columns(1).DefaultCellStyle.Format = "#,##0" : DataGridView15.Columns(2).DefaultCellStyle.Format = "#,##0.00"
253
-        DataGridView15.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView15.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
254
-        DataGridView15.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView15.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
255
-        DataGridView15.EditMode = DataGridViewEditMode.EditOnEnter
256
-    End Sub
257
-    Private  Sub 訂單分析報表五_Load(sender As Object, e As EventArgs) Handles MyBase.Load
251
+        訂單預估資料表2_dgv.Columns(0).Width = 125 : 訂單預估資料表2_dgv.Columns(1).Width = 130 : 訂單預估資料表2_dgv.Columns(2).Width = 130
252
+        訂單預估資料表2_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 訂單預估資料表2_dgv.Columns(2).DefaultCellStyle.Format = "#,##0.00"
253
+        訂單預估資料表2_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
254
+        訂單預估資料表2_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
255
+        訂單預估資料表2_dgv.Columns(1).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
256
+        訂單預估資料表2_dgv.Columns(2).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
257
+        訂單預估資料表2_dgv.EditMode = DataGridViewEditMode.EditOnEnter
258
+    End Sub
259
+    Private Sub 訂單分析報表五_Load(sender As Object, e As EventArgs) Handles MyBase.Load
258
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
260
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
259
-        TextBox37.Visible = False : TextBox38.Visible = False : TextBox39.Visible = False
261
+        客戶交期_tb.Visible = False : 訂單數量_tb.Visible = False : 總金額_tb.Visible = False
260
         Set_分析清單7()
262
         Set_分析清單7()
261
-        ComboBox1.Text = Year(Now)
263
+        年度_cb.Text = Year(Now)
262
     End Sub
264
     End Sub
263
-    Private  Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
265
+    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 年度_cb.SelectedIndexChanged
264
         Set_分析清單1()
266
         Set_分析清單1()
265
-        TextBox40.Text = "0" : TextBox41.Text = "0" : TextBox42.Text = "0"
266
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
267
+        Summary_Order_Quantity_tb.Text = "0" : Summary_Total_Sum_tb.Text = "0" : Summary_Average_tb.Text = "0"
268
+        For i As Integer = 0 To 訂單控制表_dgv.Rows.Count - 1
267
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
269
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
268
             SQL1 = "SELECT SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR
270
             SQL1 = "SELECT SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR
269
-                            CXL = 0) AND (客戶交期 BETWEEN '" & DataGridView1.Rows(i).Cells("Start_date").Value & "' AND '" & DataGridView1.Rows(i).Cells("Closing_date").Value & "')"
271
+                            CXL = 0) AND (客戶交期 BETWEEN '" & 訂單控制表_dgv.Rows(i).Cells("Start_date").Value & "' AND '" & 訂單控制表_dgv.Rows(i).Cells("Closing_date").Value & "')"
270
             cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
272
             cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
271
             If dr.Read() Then
273
             If dr.Read() Then
272
-                TextBox37.Text = dr("Order_Quantity").ToString
273
-                TextBox38.Text = dr("Total_Sum").ToString
274
-                TextBox39.Text = dr("Average").ToString
274
+                客戶交期_tb.Text = dr("Order_Quantity").ToString
275
+                訂單數量_tb.Text = dr("Total_Sum").ToString
276
+                總金額_tb.Text = dr("Average").ToString
275
             End If : conn.Close()
277
             End If : conn.Close()
276
 
278
 
277
-            If TextBox37.Text = "" Then : TextBox37.Text = "0" : End If
278
-            If TextBox38.Text = "" Then : TextBox38.Text = "0" : End If
279
-            If TextBox39.Text = "" Then : TextBox39.Text = "0" : End If
279
+            If 客戶交期_tb.Text = "" Then : 客戶交期_tb.Text = "0" : End If
280
+            If 訂單數量_tb.Text = "" Then : 訂單數量_tb.Text = "0" : End If
281
+            If 總金額_tb.Text = "" Then : 總金額_tb.Text = "0" : End If
280
 
282
 
281
-            TextBox40.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox40.Text)) + (Double.Parse(TextBox37.Text))))), "#,##0")
282
-            TextBox41.Text = Format(Val(CStr(Double.Parse(TextBox41.Text) + Double.Parse(TextBox38.Text))), "#,##0.00")
283
-            TextBox42.Text = Format(Val(CStr(Double.Parse(TextBox41.Text) / Double.Parse(TextBox40.Text))), "#,##0.00")
283
+            Summary_Order_Quantity_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(Summary_Order_Quantity_tb.Text)) + (Double.Parse(客戶交期_tb.Text))))), "#,##0")
284
+            Summary_Total_Sum_tb.Text = Format(Val(CStr(Double.Parse(Summary_Total_Sum_tb.Text) + Double.Parse(訂單數量_tb.Text))), "#,##0.00")
285
+            Summary_Average_tb.Text = Format(Val(CStr(Double.Parse(Summary_Total_Sum_tb.Text) / Double.Parse(Summary_Order_Quantity_tb.Text))), "#,##0.00")
284
 
286
 
285
             If i = 0 Then
287
             If i = 0 Then
286
-                TextBox1.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox2.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
287
-                TextBox3.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
288
+                Order_Quantity_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
289
+                Average_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
288
             ElseIf i = 1 Then
290
             ElseIf i = 1 Then
289
-                TextBox4.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox5.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
290
-                TextBox6.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
291
+                Order_Quantity1_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum1_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
292
+                Average1_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
291
             ElseIf i = 2 Then
293
             ElseIf i = 2 Then
292
-                TextBox7.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox8.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
293
-                TextBox9.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
294
+                Order_Quantity2_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum2_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
295
+                Average2_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
294
             ElseIf i = 3 Then
296
             ElseIf i = 3 Then
295
-                TextBox10.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox11.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
296
-                TextBox12.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
297
+                Order_Quantity3_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum3_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
298
+                Average3_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
297
             ElseIf i = 4 Then
299
             ElseIf i = 4 Then
298
-                TextBox13.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox14.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
299
-                TextBox15.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
300
+                Order_Quantity4_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum4_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
301
+                Average4_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
300
             ElseIf i = 5 Then
302
             ElseIf i = 5 Then
301
-                TextBox16.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox17.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
302
-                TextBox18.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
303
+                Order_Quantity5_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum5_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
304
+                Average5_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
303
             ElseIf i = 6 Then
305
             ElseIf i = 6 Then
304
-                TextBox19.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox20.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
305
-                TextBox21.Text = Format(Val(CStr((Double.Parse(TextBox39.Text)))), "#,##0.00")
306
+                Order_Quantity6_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum6_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
307
+                Average6_tb.Text = Format(Val(CStr((Double.Parse(總金額_tb.Text)))), "#,##0.00")
306
             ElseIf i = 7 Then
308
             ElseIf i = 7 Then
307
-                TextBox22.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox23.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
308
-                TextBox24.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
309
+                Order_Quantity7_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum7_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
310
+                Average7_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
309
             ElseIf i = 8 Then
311
             ElseIf i = 8 Then
310
-                TextBox25.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox26.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
311
-                TextBox27.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
312
+                Order_Quantity8_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum8_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
313
+                Average8_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
312
             ElseIf i = 9 Then
314
             ElseIf i = 9 Then
313
-                TextBox28.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox29.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
314
-                TextBox30.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
315
+                Order_Quantity9_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum9_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
316
+                Average9_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
315
             ElseIf i = 10 Then
317
             ElseIf i = 10 Then
316
-                TextBox31.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox32.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
317
-                TextBox33.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
318
+                Order_Quantity10_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum10_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
319
+                Average10_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
318
             ElseIf i = 11 Then
320
             ElseIf i = 11 Then
319
-                TextBox34.Text = Format(Val(CStr(Math.Round((Double.Parse(TextBox37.Text))))), "#,##0") : TextBox35.Text = Format(Val(CStr(Double.Parse(TextBox38.Text))), "#,##0.00")
320
-                TextBox36.Text = Format(Val(CStr(Double.Parse(TextBox39.Text))), "#,##0.00")
321
+                Order_Quantity11_tb.Text = Format(Val(CStr(Math.Round((Double.Parse(客戶交期_tb.Text))))), "#,##0") : Total_Sum11_tb.Text = Format(Val(CStr(Double.Parse(訂單數量_tb.Text))), "#,##0.00")
322
+                Average11_tb.Text = Format(Val(CStr(Double.Parse(總金額_tb.Text))), "#,##0.00")
321
             End If
323
             End If
322
 
324
 
323
             If i = 0 Then : Set_DGV2載入前設定() : ElseIf i = 1 Then : Set_DGV3載入前設定() : ElseIf i = 2 Then : Set_DGV4載入前設定() : ElseIf i = 3 Then : Set_DGV5載入前設定()
325
             If i = 0 Then : Set_DGV2載入前設定() : ElseIf i = 1 Then : Set_DGV3載入前設定() : ElseIf i = 2 Then : Set_DGV4載入前設定() : ElseIf i = 3 Then : Set_DGV5載入前設定()
325
             ElseIf i = 8 Then : Set_DGV10載入前設定() : ElseIf i = 9 Then : Set_DGV11載入前設定() : ElseIf i = 10 Then : Set_DGV12載入前設定() : ElseIf i = 11 Then : Set_DGV13載入前設定()
327
             ElseIf i = 8 Then : Set_DGV10載入前設定() : ElseIf i = 9 Then : Set_DGV11載入前設定() : ElseIf i = 10 Then : Set_DGV12載入前設定() : ElseIf i = 11 Then : Set_DGV13載入前設定()
326
             End If
328
             End If
327
             SQL1 = "SELECT 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR CXL = 0) " &
329
             SQL1 = "SELECT 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR CXL = 0) " &
328
-                   "AND (客戶交期 BETWEEN '" & DataGridView1.Rows(i).Cells("Start_date").Value & "' AND '" & DataGridView1.Rows(i).Cells("Closing_date").Value & "') GROUP BY   訂單種類 ORDER BY   Order_Type"
330
+                   "AND (客戶交期 BETWEEN '" & 訂單控制表_dgv.Rows(i).Cells("Start_date").Value & "' AND '" & 訂單控制表_dgv.Rows(i).Cells("Closing_date").Value & "') 
331
+                   GROUP BY   訂單種類 ORDER BY   Order_Type"
329
             If i = 0 Then : Set_DGV2載入後設定() : ElseIf i = 1 Then : Set_DGV3載入後設定() : ElseIf i = 2 Then : Set_DGV4載入後設定() : ElseIf i = 3 Then : Set_DGV5載入後設定()
332
             If i = 0 Then : Set_DGV2載入後設定() : ElseIf i = 1 Then : Set_DGV3載入後設定() : ElseIf i = 2 Then : Set_DGV4載入後設定() : ElseIf i = 3 Then : Set_DGV5載入後設定()
330
             ElseIf i = 4 Then : Set_DGV6載入後設定() : ElseIf i = 5 Then : Set_DGV7載入後設定() : ElseIf i = 6 Then : Set_DGV8載入後設定() : ElseIf i = 7 Then : Set_DGV9載入後設定()
333
             ElseIf i = 4 Then : Set_DGV6載入後設定() : ElseIf i = 5 Then : Set_DGV7載入後設定() : ElseIf i = 6 Then : Set_DGV8載入後設定() : ElseIf i = 7 Then : Set_DGV9載入後設定()
331
             ElseIf i = 8 Then : Set_DGV10載入後設定() : ElseIf i = 9 Then : Set_DGV11載入後設定() : ElseIf i = 10 Then : Set_DGV12載入後設定() : ElseIf i = 11 Then : Set_DGV13載入後設定()
334
             ElseIf i = 8 Then : Set_DGV10載入後設定() : ElseIf i = 9 Then : Set_DGV11載入後設定() : ElseIf i = 10 Then : Set_DGV12載入後設定() : ElseIf i = 11 Then : Set_DGV13載入後設定()
333
 
336
 
334
             Set_DGV14載入前設定()
337
             Set_DGV14載入前設定()
335
             SQL1 = "SELECT 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR CXL = 0) " &
338
             SQL1 = "SELECT 訂單種類 AS Order_Type, SUM(訂單數量) AS Order_Quantity, SUM(總金額) AS Total_Sum, SUM(總金額) / SUM(訂單數量) AS Average FROM 訂單控制表 WHERE (CXL IS NULL OR CXL = 0) " &
336
-                   "AND (客戶交期 BETWEEN '" & DataGridView1.Rows(0).Cells("Start_date").Value & "' AND '" & DataGridView1.Rows(11).Cells("Closing_date").Value & "') GROUP BY   訂單種類 ORDER BY   Order_Type"
339
+                   "AND (客戶交期 BETWEEN '" & 訂單控制表_dgv.Rows(0).Cells("Start_date").Value & "' AND '" & 訂單控制表_dgv.Rows(11).Cells("Closing_date").Value & "') 
340
+                   GROUP BY   訂單種類 ORDER BY   Order_Type"
337
             Set_DGV14載入後設定()
341
             Set_DGV14載入後設定()
338
         Next
342
         Next
339
         Set_grid()
343
         Set_grid()
340
     End Sub
344
     End Sub
341
-    Private  Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
345
+    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles ADD_bt.Click
342
         Dim PA1 As String : Dim PA2 As String : Dim PA3 As String
346
         Dim PA1 As String : Dim PA2 As String : Dim PA3 As String
343
         PA1 = InputBox("請輸入要欲新增之年月份,請注意格式為   xxxx_Pxx  ,例如 : 2019_P01。")
347
         PA1 = InputBox("請輸入要欲新增之年月份,請注意格式為   xxxx_Pxx  ,例如 : 2019_P01。")
344
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
348
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
359
         End If
363
         End If
360
         Set_分析清單7() : Set_grid()
364
         Set_分析清單7() : Set_grid()
361
     End Sub
365
     End Sub
362
-    Private  Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
363
-        For i As Integer = 0 To DataGridView15.Rows.Count - 1
366
+    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles MODIFY_bt.Click
367
+        For i As Integer = 0 To 訂單預估資料表2_dgv.Rows.Count - 1
364
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
368
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
365
-            SQL1 = "UPDATE 訂單預估資料表2 SET  預估數量 = '" & DataGridView15.Rows(i).Cells("Assess_QTY").Value & "', 預估單價 = '" & DataGridView15.Rows(i).Cells("Assess_Price").Value & "' " &
366
-                   "WHERE (YEAR_P LIKE '" & DataGridView15.Rows(i).Cells("YEAR_P").Value & "')"
369
+            SQL1 = "UPDATE 訂單預估資料表2 SET  預估數量 = '" & 訂單預估資料表2_dgv.Rows(i).Cells("Assess_QTY").Value & "', 
370
+                                                預估單價 = '" & 訂單預估資料表2_dgv.Rows(i).Cells("Assess_Price").Value & "' " &
371
+                   "WHERE (YEAR_P LIKE '" & 訂單預估資料表2_dgv.Rows(i).Cells("YEAR_P").Value & "')"
367
             cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
372
             cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
368
         Next i
373
         Next i
369
         Set_分析清單7() : Set_grid()
374
         Set_分析清單7() : Set_grid()
370
         MsgBox("修改完成")
375
         MsgBox("修改完成")
371
     End Sub
376
     End Sub
372
-    Private  Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
377
+    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles DELETE_bt.Click
373
 
378
 
374
     End Sub
379
     End Sub
375
-    Private  Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
376
-        列印用SQL = ComboBox1.Text
380
+    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles PRINT_bt.Click
381
+        列印用SQL = 年度_cb.Text
377
         列印_訂單分析五.Show()
382
         列印_訂單分析五.Show()
378
     End Sub
383
     End Sub
379
 End Class
384
 End Class

+ 66
- 66
TENDEN-MES-SYS/彙總報表管理/訂單分析報表四.Designer.vb 查看文件

22
     '請勿使用程式碼編輯器進行修改。
22
     '請勿使用程式碼編輯器進行修改。
23
     <System.Diagnostics.DebuggerStepThrough()>
23
     <System.Diagnostics.DebuggerStepThrough()>
24
     Private  Sub InitializeComponent()
24
     Private  Sub InitializeComponent()
25
-        Me.DataGridView1 = New System.Windows.Forms.DataGridView()
26
-        Me.DataGridView2 = New System.Windows.Forms.DataGridView()
25
+        Me.未完善訂單_dgv = New System.Windows.Forms.DataGridView()
26
+        Me.已完善訂單_dgv = New System.Windows.Forms.DataGridView()
27
         Me.Label1 = New System.Windows.Forms.Label()
27
         Me.Label1 = New System.Windows.Forms.Label()
28
         Me.Label2 = New System.Windows.Forms.Label()
28
         Me.Label2 = New System.Windows.Forms.Label()
29
-        Me.TextBox26 = New System.Windows.Forms.TextBox()
29
+        Me.資料筆數_tb = New System.Windows.Forms.TextBox()
30
         Me.Label42 = New System.Windows.Forms.Label()
30
         Me.Label42 = New System.Windows.Forms.Label()
31
-        Me.TextBox1 = New System.Windows.Forms.TextBox()
31
+        Me.訂單總數_tb = New System.Windows.Forms.TextBox()
32
         Me.Label3 = New System.Windows.Forms.Label()
32
         Me.Label3 = New System.Windows.Forms.Label()
33
-        Me.TextBox2 = New System.Windows.Forms.TextBox()
33
+        Me.資料筆數1_tb = New System.Windows.Forms.TextBox()
34
         Me.Label4 = New System.Windows.Forms.Label()
34
         Me.Label4 = New System.Windows.Forms.Label()
35
-        Me.TextBox3 = New System.Windows.Forms.TextBox()
35
+        Me.訂單總數1_tb = New System.Windows.Forms.TextBox()
36
         Me.Label5 = New System.Windows.Forms.Label()
36
         Me.Label5 = New System.Windows.Forms.Label()
37
         Me.Button1 = New System.Windows.Forms.Button()
37
         Me.Button1 = New System.Windows.Forms.Button()
38
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
39
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
38
+        CType(Me.未完善訂單_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
39
+        CType(Me.已完善訂單_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
40
         Me.SuspendLayout()
40
         Me.SuspendLayout()
41
         '
41
         '
42
-        'DataGridView1
42
+        '未完善訂單_dgv
43
         '
43
         '
44
-        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
45
-        Me.DataGridView1.Location = New System.Drawing.Point(6, 32)
46
-        Me.DataGridView1.Name = "DataGridView1"
47
-        Me.DataGridView1.RowHeadersWidth = 5
48
-        Me.DataGridView1.RowTemplate.Height = 24
49
-        Me.DataGridView1.Size = New System.Drawing.Size(1336, 295)
50
-        Me.DataGridView1.TabIndex = 78
44
+        Me.未完善訂單_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
45
+        Me.未完善訂單_dgv.Location = New System.Drawing.Point(6, 32)
46
+        Me.未完善訂單_dgv.Name = "未完善訂單_dgv"
47
+        Me.未完善訂單_dgv.RowHeadersWidth = 5
48
+        Me.未完善訂單_dgv.RowTemplate.Height = 24
49
+        Me.未完善訂單_dgv.Size = New System.Drawing.Size(1336, 295)
50
+        Me.未完善訂單_dgv.TabIndex = 78
51
         '
51
         '
52
-        'DataGridView2
52
+        '已完善訂單_dgv
53
         '
53
         '
54
-        Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
55
-        Me.DataGridView2.Location = New System.Drawing.Point(6, 356)
56
-        Me.DataGridView2.Name = "DataGridView2"
57
-        Me.DataGridView2.RowHeadersWidth = 5
58
-        Me.DataGridView2.RowTemplate.Height = 24
59
-        Me.DataGridView2.Size = New System.Drawing.Size(1336, 295)
60
-        Me.DataGridView2.TabIndex = 79
54
+        Me.已完善訂單_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
55
+        Me.已完善訂單_dgv.Location = New System.Drawing.Point(6, 356)
56
+        Me.已完善訂單_dgv.Name = "已完善訂單_dgv"
57
+        Me.已完善訂單_dgv.RowHeadersWidth = 5
58
+        Me.已完善訂單_dgv.RowTemplate.Height = 24
59
+        Me.已完善訂單_dgv.Size = New System.Drawing.Size(1336, 295)
60
+        Me.已完善訂單_dgv.TabIndex = 79
61
         '
61
         '
62
         'Label1
62
         'Label1
63
         '
63
         '
77
         Me.Label2.TabIndex = 81
77
         Me.Label2.TabIndex = 81
78
         Me.Label2.Text = "工廠交期即將到期且成型已完善訂單"
78
         Me.Label2.Text = "工廠交期即將到期且成型已完善訂單"
79
         '
79
         '
80
-        'TextBox26
80
+        '資料筆數_tb
81
         '
81
         '
82
-        Me.TextBox26.ForeColor = System.Drawing.Color.Black
83
-        Me.TextBox26.Location = New System.Drawing.Point(370, 330)
84
-        Me.TextBox26.Name = "TextBox26"
85
-        Me.TextBox26.Size = New System.Drawing.Size(90, 23)
86
-        Me.TextBox26.TabIndex = 122
87
-        Me.TextBox26.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
82
+        Me.資料筆數_tb.ForeColor = System.Drawing.Color.Black
83
+        Me.資料筆數_tb.Location = New System.Drawing.Point(370, 330)
84
+        Me.資料筆數_tb.Name = "資料筆數_tb"
85
+        Me.資料筆數_tb.Size = New System.Drawing.Size(90, 23)
86
+        Me.資料筆數_tb.TabIndex = 122
87
+        Me.資料筆數_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
88
         '
88
         '
89
         'Label42
89
         'Label42
90
         '
90
         '
95
         Me.Label42.TabIndex = 121
95
         Me.Label42.TabIndex = 121
96
         Me.Label42.Text = "資料筆數"
96
         Me.Label42.Text = "資料筆數"
97
         '
97
         '
98
-        'TextBox1
98
+        '訂單總數_tb
99
         '
99
         '
100
-        Me.TextBox1.ForeColor = System.Drawing.Color.Black
101
-        Me.TextBox1.Location = New System.Drawing.Point(533, 330)
102
-        Me.TextBox1.Name = "TextBox1"
103
-        Me.TextBox1.Size = New System.Drawing.Size(90, 23)
104
-        Me.TextBox1.TabIndex = 124
105
-        Me.TextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
100
+        Me.訂單總數_tb.ForeColor = System.Drawing.Color.Black
101
+        Me.訂單總數_tb.Location = New System.Drawing.Point(533, 330)
102
+        Me.訂單總數_tb.Name = "訂單總數_tb"
103
+        Me.訂單總數_tb.Size = New System.Drawing.Size(90, 23)
104
+        Me.訂單總數_tb.TabIndex = 124
105
+        Me.訂單總數_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
106
         '
106
         '
107
         'Label3
107
         'Label3
108
         '
108
         '
113
         Me.Label3.TabIndex = 123
113
         Me.Label3.TabIndex = 123
114
         Me.Label3.Text = "訂單總數"
114
         Me.Label3.Text = "訂單總數"
115
         '
115
         '
116
-        'TextBox2
116
+        '資料筆數1_tb
117
         '
117
         '
118
-        Me.TextBox2.ForeColor = System.Drawing.Color.Black
119
-        Me.TextBox2.Location = New System.Drawing.Point(370, 654)
120
-        Me.TextBox2.Name = "TextBox2"
121
-        Me.TextBox2.Size = New System.Drawing.Size(90, 23)
122
-        Me.TextBox2.TabIndex = 126
123
-        Me.TextBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
118
+        Me.資料筆數1_tb.ForeColor = System.Drawing.Color.Black
119
+        Me.資料筆數1_tb.Location = New System.Drawing.Point(370, 654)
120
+        Me.資料筆數1_tb.Name = "資料筆數1_tb"
121
+        Me.資料筆數1_tb.Size = New System.Drawing.Size(90, 23)
122
+        Me.資料筆數1_tb.TabIndex = 126
123
+        Me.資料筆數1_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
124
         '
124
         '
125
         'Label4
125
         'Label4
126
         '
126
         '
131
         Me.Label4.TabIndex = 125
131
         Me.Label4.TabIndex = 125
132
         Me.Label4.Text = "資料筆數"
132
         Me.Label4.Text = "資料筆數"
133
         '
133
         '
134
-        'TextBox3
134
+        '訂單總數1_tb
135
         '
135
         '
136
-        Me.TextBox3.ForeColor = System.Drawing.Color.Black
137
-        Me.TextBox3.Location = New System.Drawing.Point(533, 654)
138
-        Me.TextBox3.Name = "TextBox3"
139
-        Me.TextBox3.Size = New System.Drawing.Size(90, 23)
140
-        Me.TextBox3.TabIndex = 128
141
-        Me.TextBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
136
+        Me.訂單總數1_tb.ForeColor = System.Drawing.Color.Black
137
+        Me.訂單總數1_tb.Location = New System.Drawing.Point(533, 654)
138
+        Me.訂單總數1_tb.Name = "訂單總數1_tb"
139
+        Me.訂單總數1_tb.Size = New System.Drawing.Size(90, 23)
140
+        Me.訂單總數1_tb.TabIndex = 128
141
+        Me.訂單總數1_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
142
         '
142
         '
143
         'Label5
143
         'Label5
144
         '
144
         '
164
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
164
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
165
         Me.ClientSize = New System.Drawing.Size(1354, 681)
165
         Me.ClientSize = New System.Drawing.Size(1354, 681)
166
         Me.Controls.Add(Me.Button1)
166
         Me.Controls.Add(Me.Button1)
167
-        Me.Controls.Add(Me.TextBox3)
167
+        Me.Controls.Add(Me.訂單總數1_tb)
168
         Me.Controls.Add(Me.Label5)
168
         Me.Controls.Add(Me.Label5)
169
-        Me.Controls.Add(Me.TextBox2)
169
+        Me.Controls.Add(Me.資料筆數1_tb)
170
         Me.Controls.Add(Me.Label4)
170
         Me.Controls.Add(Me.Label4)
171
-        Me.Controls.Add(Me.TextBox1)
171
+        Me.Controls.Add(Me.訂單總數_tb)
172
         Me.Controls.Add(Me.Label3)
172
         Me.Controls.Add(Me.Label3)
173
-        Me.Controls.Add(Me.TextBox26)
173
+        Me.Controls.Add(Me.資料筆數_tb)
174
         Me.Controls.Add(Me.Label42)
174
         Me.Controls.Add(Me.Label42)
175
         Me.Controls.Add(Me.Label2)
175
         Me.Controls.Add(Me.Label2)
176
         Me.Controls.Add(Me.Label1)
176
         Me.Controls.Add(Me.Label1)
177
-        Me.Controls.Add(Me.DataGridView2)
178
-        Me.Controls.Add(Me.DataGridView1)
177
+        Me.Controls.Add(Me.已完善訂單_dgv)
178
+        Me.Controls.Add(Me.未完善訂單_dgv)
179
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
179
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
180
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
180
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
181
         Me.Name = "訂單分析報表四"
181
         Me.Name = "訂單分析報表四"
182
         Me.Text = "Deadline Report"
182
         Me.Text = "Deadline Report"
183
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
184
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit()
183
+        CType(Me.未完善訂單_dgv, System.ComponentModel.ISupportInitialize).EndInit()
184
+        CType(Me.已完善訂單_dgv, System.ComponentModel.ISupportInitialize).EndInit()
185
         Me.ResumeLayout(False)
185
         Me.ResumeLayout(False)
186
         Me.PerformLayout()
186
         Me.PerformLayout()
187
 
187
 
188
     End Sub
188
     End Sub
189
 
189
 
190
-    Friend WithEvents DataGridView1 As DataGridView
191
-    Friend WithEvents DataGridView2 As DataGridView
190
+    Friend WithEvents 未完善訂單_dgv As DataGridView
191
+    Friend WithEvents 已完善訂單_dgv As DataGridView
192
     Friend WithEvents Label1 As Label
192
     Friend WithEvents Label1 As Label
193
     Friend WithEvents Label2 As Label
193
     Friend WithEvents Label2 As Label
194
-    Friend WithEvents TextBox26 As TextBox
194
+    Friend WithEvents 資料筆數_tb As TextBox
195
     Friend WithEvents Label42 As Label
195
     Friend WithEvents Label42 As Label
196
-    Friend WithEvents TextBox1 As TextBox
196
+    Friend WithEvents 訂單總數_tb As TextBox
197
     Friend WithEvents Label3 As Label
197
     Friend WithEvents Label3 As Label
198
-    Friend WithEvents TextBox2 As TextBox
198
+    Friend WithEvents 資料筆數1_tb As TextBox
199
     Friend WithEvents Label4 As Label
199
     Friend WithEvents Label4 As Label
200
-    Friend WithEvents TextBox3 As TextBox
200
+    Friend WithEvents 訂單總數1_tb As TextBox
201
     Friend WithEvents Label5 As Label
201
     Friend WithEvents Label5 As Label
202
     Friend WithEvents Button1 As Button
202
     Friend WithEvents Button1 As Button
203
 End Class
203
 End Class

+ 51
- 51
TENDEN-MES-SYS/彙總報表管理/訂單分析報表四.vb 查看文件

7
     Dim ds As New DataSet : Dim ds1 As New DataSet
7
     Dim ds As New DataSet : Dim ds1 As New DataSet
8
     Dim dr As SqlDataReader
8
     Dim dr As SqlDataReader
9
     Private  Sub Set_DGV1載入前設定()
9
     Private  Sub Set_DGV1載入前設定()
10
-        DataGridView1.DataSource = Nothing : ds.Clear()
11
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
-        DataGridView1.ColumnHeadersHeight = 25
13
-        DataGridView1.AllowUserToAddRows = False
10
+        未完善訂單_dgv.DataSource = Nothing : ds.Clear()
11
+        未完善訂單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
+        未完善訂單_dgv.ColumnHeadersHeight = 25
13
+        未完善訂單_dgv.AllowUserToAddRows = False
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
15
     End Sub
15
     End Sub
16
     Private  Sub Set_DGV1載入後設定()
16
     Private  Sub Set_DGV1載入後設定()
17
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
17
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 未完善訂單_dgv.DataSource = ds.Tables(0) : conn.Close()
18
     End Sub
18
     End Sub
19
     Private  Sub Set_分析清單1()
19
     Private  Sub Set_分析清單1()
20
         Set_DGV1載入前設定()
20
         Set_DGV1載入前設定()
27
         Set_DGV1載入後設定()
27
         Set_DGV1載入後設定()
28
     End Sub
28
     End Sub
29
     Private  Sub Set_DGV2載入前設定()
29
     Private  Sub Set_DGV2載入前設定()
30
-        DataGridView2.DataSource = Nothing : ds1.Clear()
31
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
32
-        DataGridView2.ColumnHeadersHeight = 25
33
-        DataGridView2.AllowUserToAddRows = False
30
+        已完善訂單_dgv.DataSource = Nothing : ds1.Clear()
31
+        已完善訂單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
32
+        已完善訂單_dgv.ColumnHeadersHeight = 25
33
+        已完善訂單_dgv.AllowUserToAddRows = False
34
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
34
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
35
     End Sub
35
     End Sub
36
     Private  Sub Set_DGV2載入後設定()
36
     Private  Sub Set_DGV2載入後設定()
37
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
37
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : 已完善訂單_dgv.DataSource = ds1.Tables(0) : conn.Close()
38
     End Sub
38
     End Sub
39
     Private  Sub Set_分析清單2()
39
     Private  Sub Set_分析清單2()
40
         Set_DGV2載入前設定()
40
         Set_DGV2載入前設定()
46
         Set_DGV2載入後設定()
46
         Set_DGV2載入後設定()
47
     End Sub
47
     End Sub
48
     Private  Sub Set_grid()
48
     Private  Sub Set_grid()
49
-        DataGridView1.Columns(0).Width = 90 : DataGridView1.Columns(1).Width = 50 : DataGridView1.Columns(2).Width = 110 : DataGridView1.Columns(3).Width = 170 : DataGridView1.Columns(4).Width = 70
50
-        DataGridView1.Columns(5).Width = 50 : DataGridView1.Columns(6).Width = 70 : DataGridView1.Columns(7).Width = 50 : DataGridView1.Columns(8).Width = 85 : DataGridView1.Columns(9).Width = 85
51
-        DataGridView1.Columns(10).Width = 85 : DataGridView1.Columns(11).Width = 85
49
+        未完善訂單_dgv.Columns(0).Width = 90 : 未完善訂單_dgv.Columns(1).Width = 50 : 未完善訂單_dgv.Columns(2).Width = 110 : 未完善訂單_dgv.Columns(3).Width = 170 : 未完善訂單_dgv.Columns(4).Width = 70
50
+        未完善訂單_dgv.Columns(5).Width = 50 : 未完善訂單_dgv.Columns(6).Width = 70 : 未完善訂單_dgv.Columns(7).Width = 50 : 未完善訂單_dgv.Columns(8).Width = 85 : 未完善訂單_dgv.Columns(9).Width = 85
51
+        未完善訂單_dgv.Columns(10).Width = 85 : 未完善訂單_dgv.Columns(11).Width = 85
52
         If CC(62) = True Then
52
         If CC(62) = True Then
53
-            DataGridView1.Columns(12).Width = 85 : DataGridView1.Columns(13).Width = 70
54
-            DataGridView1.Columns(14).Width = 85 : DataGridView1.Columns(15).Width = 70
53
+            未完善訂單_dgv.Columns(12).Width = 85 : 未完善訂單_dgv.Columns(13).Width = 70
54
+            未完善訂單_dgv.Columns(14).Width = 85 : 未完善訂單_dgv.Columns(15).Width = 70
55
         Else
55
         Else
56
-            DataGridView1.Columns(12).Visible = False : DataGridView1.Columns(13).Visible = False
57
-            DataGridView1.Columns(14).Width = 170 : DataGridView1.Columns(15).Width = 140
56
+            未完善訂單_dgv.Columns(12).Visible = False : 未完善訂單_dgv.Columns(13).Visible = False
57
+            未完善訂單_dgv.Columns(14).Width = 170 : 未完善訂單_dgv.Columns(15).Width = 140
58
         End If
58
         End If
59
-        DataGridView1.Columns(16).Visible = False
59
+        未完善訂單_dgv.Columns(16).Visible = False
60
 
60
 
61
-        DataGridView2.Columns(0).Width = 90 : DataGridView2.Columns(1).Width = 50 : DataGridView2.Columns(2).Width = 110 : DataGridView2.Columns(3).Width = 170 : DataGridView2.Columns(4).Width = 70
62
-        DataGridView2.Columns(5).Width = 50 : DataGridView2.Columns(6).Width = 70 : DataGridView2.Columns(7).Width = 50 : DataGridView2.Columns(8).Width = 85 : DataGridView2.Columns(9).Width = 85
63
-        DataGridView2.Columns(10).Width = 85 : DataGridView2.Columns(11).Width = 85
61
+        已完善訂單_dgv.Columns(0).Width = 90 : 已完善訂單_dgv.Columns(1).Width = 50 : 已完善訂單_dgv.Columns(2).Width = 110 : 已完善訂單_dgv.Columns(3).Width = 170 : 已完善訂單_dgv.Columns(4).Width = 70
62
+        已完善訂單_dgv.Columns(5).Width = 50 : 已完善訂單_dgv.Columns(6).Width = 70 : 已完善訂單_dgv.Columns(7).Width = 50 : 已完善訂單_dgv.Columns(8).Width = 85 : 已完善訂單_dgv.Columns(9).Width = 85
63
+        已完善訂單_dgv.Columns(10).Width = 85 : 已完善訂單_dgv.Columns(11).Width = 85
64
         If CC(62) = True Then
64
         If CC(62) = True Then
65
-            DataGridView2.Columns(12).Width = 85 : DataGridView2.Columns(13).Width = 70
66
-            DataGridView2.Columns(14).Width = 85 : DataGridView2.Columns(15).Width = 70
65
+            已完善訂單_dgv.Columns(12).Width = 85 : 已完善訂單_dgv.Columns(13).Width = 70
66
+            已完善訂單_dgv.Columns(14).Width = 85 : 已完善訂單_dgv.Columns(15).Width = 70
67
         Else
67
         Else
68
-            DataGridView2.Columns(12).Visible = False : DataGridView2.Columns(13).Visible = False
69
-            DataGridView2.Columns(14).Width = 170 : DataGridView2.Columns(15).Width = 140
68
+            已完善訂單_dgv.Columns(12).Visible = False : 已完善訂單_dgv.Columns(13).Visible = False
69
+            已完善訂單_dgv.Columns(14).Width = 170 : 已完善訂單_dgv.Columns(15).Width = 140
70
         End If
70
         End If
71
-        DataGridView2.Columns(16).Visible = False
71
+        已完善訂單_dgv.Columns(16).Visible = False
72
 
72
 
73
-        DataGridView1.Columns(6).DefaultCellStyle.Format = "#,##0"
74
-        DataGridView1.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
75
-        DataGridView1.Columns(13).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(13).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
76
-        DataGridView1.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
77
-        DataGridView2.Columns(6).DefaultCellStyle.Format = "#,##0"
78
-        DataGridView2.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
79
-        DataGridView2.Columns(13).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(13).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
80
-        DataGridView2.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView2.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
73
+        未完善訂單_dgv.Columns(6).DefaultCellStyle.Format = "#,##0"
74
+        未完善訂單_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 未完善訂單_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
75
+        未完善訂單_dgv.Columns(13).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 未完善訂單_dgv.Columns(13).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
76
+        未完善訂單_dgv.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 未完善訂單_dgv.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
77
+        已完善訂單_dgv.Columns(6).DefaultCellStyle.Format = "#,##0"
78
+        已完善訂單_dgv.Columns(6).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 已完善訂單_dgv.Columns(6).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
79
+        已完善訂單_dgv.Columns(13).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 已完善訂單_dgv.Columns(13).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
80
+        已完善訂單_dgv.Columns(15).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 已完善訂單_dgv.Columns(15).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
81
     End Sub
81
     End Sub
82
     Private  Sub Set_自動加總()
82
     Private  Sub Set_自動加總()
83
         Dim 加總(1) As Double
83
         Dim 加總(1) As Double
84
-        For i As Integer = 0 To DataGridView1.Rows.Count - 1
85
-            If DataGridView1.RowCount = 0 Then : 加總(0) += 0 : Else : 加總(0) += DataGridView1.Rows(i).Cells("訂單數量").Value : End If
84
+        For i As Integer = 0 To 未完善訂單_dgv.Rows.Count - 1
85
+            If 未完善訂單_dgv.RowCount = 0 Then : 加總(0) += 0 : Else : 加總(0) += 未完善訂單_dgv.Rows(i).Cells("訂單數量").Value : End If
86
         Next i
86
         Next i
87
-        For i As Integer = 0 To DataGridView2.Rows.Count - 1
88
-            If DataGridView2.RowCount = 0 Then : 加總(1) += 0 : Else : 加總(1) += DataGridView2.Rows(i).Cells("訂單數量").Value : End If
87
+        For i As Integer = 0 To 已完善訂單_dgv.Rows.Count - 1
88
+            If 已完善訂單_dgv.RowCount = 0 Then : 加總(1) += 0 : Else : 加總(1) += 已完善訂單_dgv.Rows(i).Cells("訂單數量").Value : End If
89
         Next i
89
         Next i
90
-        TextBox1.Text = Format(Val(加總(0)), "#,##0") : TextBox3.Text = Format(Val(加總(1)), "#,##0")
91
-        TextBox26.Text = DataGridView1.Rows.Count
92
-        TextBox2.Text = DataGridView2.Rows.Count
90
+        訂單總數_tb.Text = Format(Val(加總(0)), "#,##0") : 訂單總數1_tb.Text = Format(Val(加總(1)), "#,##0")
91
+        資料筆數_tb.Text = 未完善訂單_dgv.Rows.Count
92
+        資料筆數1_tb.Text = 已完善訂單_dgv.Rows.Count
93
     End Sub
93
     End Sub
94
     Private  Sub 訂單分析報表四_Load(sender As Object, e As EventArgs) Handles MyBase.Load
94
     Private  Sub 訂單分析報表四_Load(sender As Object, e As EventArgs) Handles MyBase.Load
95
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
95
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
96
         Set_分析清單1() : Set_分析清單2() : Set_grid() : Set_自動加總()
96
         Set_分析清單1() : Set_分析清單2() : Set_grid() : Set_自動加總()
97
     End Sub
97
     End Sub
98
-    Private  Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
98
+    Private  Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 未完善訂單_dgv.RowPostPaint
99
         Dim linePen As New Pen(Color.Blue, 2)
99
         Dim linePen As New Pen(Color.Blue, 2)
100
-        If e.RowIndex = DataGridView1.Rows.Count - 1 Then
100
+        If e.RowIndex = 未完善訂單_dgv.Rows.Count - 1 Then
101
             Exit Sub
101
             Exit Sub
102
         Else
102
         Else
103
-            If DataGridView1(0, e.RowIndex).Value.ToString <> DataGridView1(0, e.RowIndex + 1).Value.ToString Then
104
-                Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0)
103
+            If 未完善訂單_dgv(0, e.RowIndex).Value.ToString <> 未完善訂單_dgv(0, e.RowIndex + 1).Value.ToString Then
104
+                Dim startX As Integer = IIf(未完善訂單_dgv.RowHeadersVisible, 未完善訂單_dgv.RowHeadersWidth, 0)
105
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
105
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
106
-                Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
106
+                Dim endX As Integer = startX + 未完善訂單_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 未完善訂單_dgv.HorizontalScrollingOffset
107
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
107
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
108
                 Exit Sub
108
                 Exit Sub
109
             End If
109
             End If
110
         End If
110
         End If
111
     End Sub
111
     End Sub
112
-    Private  Sub DataGridView2_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView2.RowPostPaint
112
+    Private  Sub DataGridView2_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 已完善訂單_dgv.RowPostPaint
113
         Dim linePen As New Pen(Color.Blue, 2)
113
         Dim linePen As New Pen(Color.Blue, 2)
114
-        If e.RowIndex = DataGridView2.Rows.Count - 1 Then
114
+        If e.RowIndex = 已完善訂單_dgv.Rows.Count - 1 Then
115
             Exit Sub
115
             Exit Sub
116
         Else
116
         Else
117
-            If DataGridView2(0, e.RowIndex).Value.ToString <> DataGridView2(0, e.RowIndex + 1).Value.ToString Then
118
-                Dim startX As Integer = IIf(DataGridView2.RowHeadersVisible, DataGridView2.RowHeadersWidth, 0)
117
+            If 已完善訂單_dgv(0, e.RowIndex).Value.ToString <> 已完善訂單_dgv(0, e.RowIndex + 1).Value.ToString Then
118
+                Dim startX As Integer = IIf(已完善訂單_dgv.RowHeadersVisible, 已完善訂單_dgv.RowHeadersWidth, 0)
119
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
119
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
120
-                Dim endX As Integer = startX + DataGridView2.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView2.HorizontalScrollingOffset
120
+                Dim endX As Integer = startX + 已完善訂單_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 已完善訂單_dgv.HorizontalScrollingOffset
121
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
121
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
122
                 Exit Sub
122
                 Exit Sub
123
             End If
123
             End If

+ 1
- 1
TENDEN-MES-SYS/樣品訂單管理/中文樣品單.Designer.vb 查看文件

1421
         '
1421
         '
1422
         Me.ComboBox9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
1422
         Me.ComboBox9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
1423
         Me.ComboBox9.FormattingEnabled = True
1423
         Me.ComboBox9.FormattingEnabled = True
1424
-        Me.ComboBox9.Items.AddRange(New Object() {"", "ILR", "FLR", "SS"})
1424
+        Me.ComboBox9.Items.AddRange(New Object() {"", "ILR", "FLR", "SS", "Proto"})
1425
         Me.ComboBox9.Location = New System.Drawing.Point(59, 112)
1425
         Me.ComboBox9.Location = New System.Drawing.Point(59, 112)
1426
         Me.ComboBox9.Name = "ComboBox9"
1426
         Me.ComboBox9.Name = "ComboBox9"
1427
         Me.ComboBox9.Size = New System.Drawing.Size(155, 24)
1427
         Me.ComboBox9.Size = New System.Drawing.Size(155, 24)

+ 15
- 5
TENDEN-MES-SYS/樣品訂單管理/中文樣品單.vb 查看文件

364
     Private  Sub ComboBox8下拉表單資料載入()
364
     Private  Sub ComboBox8下拉表單資料載入()
365
         ComboBox8.Items.Clear()
365
         ComboBox8.Items.Clear()
366
         If 開發部門 = False And 確認部門 = True Then
366
         If 開發部門 = False And 確認部門 = True Then
367
+            ComboBox16.Items.Clear() : ComboBox8.Items.Clear()
367
             ComboBox8.Items.Add("CFM") : ComboBox16.Items.Add("CFM")
368
             ComboBox8.Items.Add("CFM") : ComboBox16.Items.Add("CFM")
368
         ElseIf 開發部門 = True And 確認部門 = False Then
369
         ElseIf 開發部門 = True And 確認部門 = False Then
369
-            ComboBox8.Items.Add("ILR") : ComboBox8.Items.Add("FLR") : ComboBox8.Items.Add("SMS") : ComboBox8.Items.Add("SMU")
370
-            ComboBox16.Items.Add("ILR") : ComboBox16.Items.Add("FLR") : ComboBox16.Items.Add("SMS") : ComboBox16.Items.Add("SMU")
370
+            ComboBox16.Items.Clear() : ComboBox8.Items.Clear()
371
+            ComboBox8.Items.Add("ILR") : ComboBox8.Items.Add("FLR") : ComboBox8.Items.Add("SMS") : ComboBox8.Items.Add("SMU") : ComboBox8.Items.Add("Proto")
372
+            ComboBox16.Items.Add("ILR") : ComboBox16.Items.Add("FLR") : ComboBox16.Items.Add("SMS") : ComboBox16.Items.Add("SMU") : ComboBox16.Items.Add("Proto")
371
         End If
373
         End If
372
     End Sub
374
     End Sub
373
     Private  Sub Set_格式設定()
375
     Private  Sub Set_格式設定()
714
                             Button35.Enabled = False : Button34.Enabled = False : Button38.Enabled = False : Button45.Enabled = False
716
                             Button35.Enabled = False : Button34.Enabled = False : Button38.Enabled = False : Button45.Enabled = False
715
                         End If
717
                         End If
716
                     ElseIf 開發部門 = True And 確認部門 = False Then
718
                     ElseIf 開發部門 = True And 確認部門 = False Then
717
-                        If QA = "ILR" Or QA = "FLR" Or QA = "SMS" Or QA = "SMU" Then
719
+                        If QA = "ILR" Or QA = "FLR" Or QA = "SMS" Or QA = "SMU" Or QA = "Proto" Then
718
                             Button35.Enabled = True : Button34.Enabled = True : Button38.Enabled = True : Button45.Enabled = True
720
                             Button35.Enabled = True : Button34.Enabled = True : Button38.Enabled = True : Button45.Enabled = True
719
                         Else
721
                         Else
720
                             Button35.Enabled = False : Button34.Enabled = False : Button38.Enabled = False : Button45.Enabled = False
722
                             Button35.Enabled = False : Button34.Enabled = False : Button38.Enabled = False : Button45.Enabled = False
741
             ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
743
             ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
742
             ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
744
             ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
743
             ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
745
             ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
746
+            ElseIf ComboBox8.Text = "Proto" Then : ComboBox9.Text = "Proto"
744
             End If
747
             End If
745
             If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
748
             If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
746
             ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
749
             ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
747
             ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
750
             ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
748
             ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
751
             ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
752
+            ElseIf ComboBox8.Text = "Proto" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
749
             End If
753
             End If
750
         End If
754
         End If
751
     End Sub
755
     End Sub
787
             ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
791
             ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
788
             ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
792
             ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
789
             ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
793
             ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
794
+            ElseIf ComboBox8.Text = "Proto" Then : ComboBox9.Text = "Proto"
790
             End If
795
             End If
791
             If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
796
             If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
792
             ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
797
             ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
793
             ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
798
             ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
794
             ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
799
             ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
800
+            ElseIf ComboBox8.Text = "Proto" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
795
             End If
801
             End If
796
         End If
802
         End If
797
     End Sub
803
     End Sub
2273
                 MsgBox("確認部門不能修改開發部門資料")
2279
                 MsgBox("確認部門不能修改開發部門資料")
2274
             End If
2280
             End If
2275
         ElseIf 開發部門 = True And 確認部門 = False Then
2281
         ElseIf 開發部門 = True And 確認部門 = False Then
2276
-            If QA = "ILR" Or QA = "FLR" Or QA = "SMS" Or QA = "SMU" Then
2282
+            If QA = "ILR" Or QA = "FLR" Or QA = "SMS" Or QA = "SMU" Or QA = "Proto" Then
2277
                 If 暫存模式 = False Then
2283
                 If 暫存模式 = False Then
2278
                     Button24.Enabled = False : Button29.Enabled = False : Button35.Enabled = False : Button54.Enabled = False
2284
                     Button24.Enabled = False : Button29.Enabled = False : Button35.Enabled = False : Button54.Enabled = False
2279
                     Button20.Enabled = True : Button21.Enabled = True : Button22.Enabled = True : Button25.Enabled = True : Button37.Enabled = True
2285
                     Button20.Enabled = True : Button21.Enabled = True : Button22.Enabled = True : Button25.Enabled = True : Button37.Enabled = True
2307
         ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
2313
         ElseIf ComboBox8.Text = "FLR" Then : ComboBox9.Text = "FLR"
2308
         ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
2314
         ElseIf ComboBox8.Text = "SMS" Then : ComboBox9.Text = "SS"
2309
         ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
2315
         ElseIf ComboBox8.Text = "SMU" Or ComboBox8.Text = "SMU" Then : ComboBox9.Text = ""
2316
+        ElseIf ComboBox8.Text = "Proto" Then : ComboBox9.Text = "Proto"
2310
         End If
2317
         End If
2311
         If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
2318
         If ComboBox8.Text = "ILR" Or ComboBox8.Text = "FLR" Then : CheckBox8.Checked = True : CheckBox7.Checked = False : CheckBox6.Checked = False
2312
         ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
2319
         ElseIf ComboBox8.Text = "CFM" Then : CheckBox8.Checked = False : CheckBox7.Checked = True : CheckBox6.Checked = False
2313
         ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
2320
         ElseIf ComboBox8.Text = "SMS" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = True
2314
         ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
2321
         ElseIf ComboBox8.Text = "SMU" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
2322
+        ElseIf ComboBox8.Text = "Proto" Then : CheckBox8.Checked = False : CheckBox7.Checked = False : CheckBox6.Checked = False
2315
         End If
2323
         End If
2316
         TextBox2.Focus()
2324
         TextBox2.Focus()
2317
     End Sub
2325
     End Sub
2404
 
2412
 
2405
         ComboBox16.Items.Clear()
2413
         ComboBox16.Items.Clear()
2406
         If 開發部門 = False And 確認部門 = True Then
2414
         If 開發部門 = False And 確認部門 = True Then
2415
+            ComboBox16.Items.Clear()
2407
             ComboBox16.Items.Add("CFM")
2416
             ComboBox16.Items.Add("CFM")
2408
         ElseIf 開發部門 = True And 確認部門 = False Then
2417
         ElseIf 開發部門 = True And 確認部門 = False Then
2409
-            ComboBox16.Items.Add("ILR") : ComboBox16.Items.Add("FLR") : ComboBox16.Items.Add("SMS") : ComboBox16.Items.Add("SMU")
2418
+            ComboBox16.Items.Clear()
2419
+            ComboBox16.Items.Add("ILR") : ComboBox16.Items.Add("FLR") : ComboBox16.Items.Add("SMS") : ComboBox16.Items.Add("SMU") : ComboBox16.Items.Add("Proto")
2410
         End If
2420
         End If
2411
     End Sub
2421
     End Sub
2412
     Private  Sub Button60_Click(sender As Object, e As EventArgs) Handles Button60.Click
2422
     Private  Sub Button60_Click(sender As Object, e As EventArgs) Handles Button60.Click

+ 1
- 1
TENDEN-MES-SYS/樣品訂單管理/中文樣品單清單.Designer.vb 查看文件

132
         '
132
         '
133
         Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
133
         Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
134
         Me.ComboBox1.FormattingEnabled = True
134
         Me.ComboBox1.FormattingEnabled = True
135
-        Me.ComboBox1.Items.AddRange(New Object() {"ILR", "FLR", "SMS", "SMU", "CFM"})
135
+        Me.ComboBox1.Items.AddRange(New Object() {"ILR", "FLR", "SMS", "SMU", "CFM", "Proto"})
136
         Me.ComboBox1.Location = New System.Drawing.Point(449, 6)
136
         Me.ComboBox1.Location = New System.Drawing.Point(449, 6)
137
         Me.ComboBox1.Name = "ComboBox1"
137
         Me.ComboBox1.Name = "ComboBox1"
138
         Me.ComboBox1.Size = New System.Drawing.Size(68, 24)
138
         Me.ComboBox1.Size = New System.Drawing.Size(68, 24)

+ 15
- 2
TENDEN-MES-SYS/樣品訂單管理/中文樣品單階段.Designer.vb 查看文件

27
         Me.CheckBox3 = New System.Windows.Forms.CheckBox()
27
         Me.CheckBox3 = New System.Windows.Forms.CheckBox()
28
         Me.CheckBox4 = New System.Windows.Forms.CheckBox()
28
         Me.CheckBox4 = New System.Windows.Forms.CheckBox()
29
         Me.Button11 = New System.Windows.Forms.Button()
29
         Me.Button11 = New System.Windows.Forms.Button()
30
+        Me.CheckBox5 = New System.Windows.Forms.CheckBox()
30
         Me.SuspendLayout()
31
         Me.SuspendLayout()
31
         '
32
         '
32
         'CheckBox1
33
         'CheckBox1
75
         Me.Button11.ForeColor = System.Drawing.Color.Blue
76
         Me.Button11.ForeColor = System.Drawing.Color.Blue
76
         Me.Button11.Location = New System.Drawing.Point(12, 38)
77
         Me.Button11.Location = New System.Drawing.Point(12, 38)
77
         Me.Button11.Name = "Button11"
78
         Me.Button11.Name = "Button11"
78
-        Me.Button11.Size = New System.Drawing.Size(217, 28)
79
+        Me.Button11.Size = New System.Drawing.Size(274, 28)
79
         Me.Button11.TabIndex = 388
80
         Me.Button11.TabIndex = 388
80
         Me.Button11.Text = "確定新增"
81
         Me.Button11.Text = "確定新增"
81
         Me.Button11.UseVisualStyleBackColor = True
82
         Me.Button11.UseVisualStyleBackColor = True
82
         '
83
         '
84
+        'CheckBox5
85
+        '
86
+        Me.CheckBox5.AutoSize = True
87
+        Me.CheckBox5.Location = New System.Drawing.Point(235, 12)
88
+        Me.CheckBox5.Name = "CheckBox5"
89
+        Me.CheckBox5.Size = New System.Drawing.Size(58, 20)
90
+        Me.CheckBox5.TabIndex = 389
91
+        Me.CheckBox5.Text = "Proto"
92
+        Me.CheckBox5.UseVisualStyleBackColor = True
93
+        '
83
         '中文樣品單階段
94
         '中文樣品單階段
84
         '
95
         '
85
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
96
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
86
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
97
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
87
-        Me.ClientSize = New System.Drawing.Size(243, 77)
98
+        Me.ClientSize = New System.Drawing.Size(298, 77)
99
+        Me.Controls.Add(Me.CheckBox5)
88
         Me.Controls.Add(Me.Button11)
100
         Me.Controls.Add(Me.Button11)
89
         Me.Controls.Add(Me.CheckBox4)
101
         Me.Controls.Add(Me.CheckBox4)
90
         Me.Controls.Add(Me.CheckBox3)
102
         Me.Controls.Add(Me.CheckBox3)
105
     Friend WithEvents CheckBox3 As CheckBox
117
     Friend WithEvents CheckBox3 As CheckBox
106
     Friend WithEvents CheckBox4 As CheckBox
118
     Friend WithEvents CheckBox4 As CheckBox
107
     Friend WithEvents Button11 As Button
119
     Friend WithEvents Button11 As Button
120
+    Friend WithEvents CheckBox5 As CheckBox
108
 End Class
121
 End Class
109
 
122
 

+ 14
- 6
TENDEN-MES-SYS/樣品訂單管理/中文樣品單階段.vb 查看文件

4
         Button11.Enabled = False
4
         Button11.Enabled = False
5
     End Sub
5
     End Sub
6
     Private  Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
6
     Private  Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
7
-        CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False
7
+        CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False : CheckBox5.Checked = False
8
         Me.Close()
8
         Me.Close()
9
     End Sub
9
     End Sub
10
     Private  Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.Click
10
     Private  Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.Click
11
         If CheckBox1.Checked = True Then
11
         If CheckBox1.Checked = True Then
12
-            CheckBox1.Checked = True : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False : Button11.Enabled = True
12
+            CheckBox1.Checked = True : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False : CheckBox5.Checked = False : Button11.Enabled = True
13
             QA = "ILR"
13
             QA = "ILR"
14
         Else
14
         Else
15
             CheckBox1.Checked = False : Button11.Enabled = False
15
             CheckBox1.Checked = False : Button11.Enabled = False
17
     End Sub
17
     End Sub
18
     Private  Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.Click
18
     Private  Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.Click
19
         If CheckBox2.Checked = True Then
19
         If CheckBox2.Checked = True Then
20
-            CheckBox1.Checked = False : CheckBox2.Checked = True : CheckBox3.Checked = False : CheckBox4.Checked = False : Button11.Enabled = True
20
+            CheckBox1.Checked = False : CheckBox2.Checked = True : CheckBox3.Checked = False : CheckBox4.Checked = False : CheckBox5.Checked = False : Button11.Enabled = True
21
             QA = "FLR"
21
             QA = "FLR"
22
         Else
22
         Else
23
             CheckBox2.Checked = False : Button11.Enabled = False
23
             CheckBox2.Checked = False : Button11.Enabled = False
25
     End Sub
25
     End Sub
26
     Private  Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.Click
26
     Private  Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.Click
27
         If CheckBox3.Checked = True Then
27
         If CheckBox3.Checked = True Then
28
-            CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = True : CheckBox4.Checked = False : Button11.Enabled = True
28
+            CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = True : CheckBox4.Checked = False : CheckBox5.Checked = False : Button11.Enabled = True
29
             QA = "SMS"
29
             QA = "SMS"
30
         Else
30
         Else
31
             CheckBox3.Checked = False : Button11.Enabled = False
31
             CheckBox3.Checked = False : Button11.Enabled = False
32
         End If
32
         End If
33
     End Sub
33
     End Sub
34
-    Private  Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.Click
34
+    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.Click
35
         If CheckBox4.Checked = True Then
35
         If CheckBox4.Checked = True Then
36
-            CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = True : Button11.Enabled = True
36
+            CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = True : CheckBox5.Checked = False : Button11.Enabled = True
37
             QA = "SMU"
37
             QA = "SMU"
38
         Else
38
         Else
39
             CheckBox4.Checked = False : Button11.Enabled = False
39
             CheckBox4.Checked = False : Button11.Enabled = False
40
         End If
40
         End If
41
     End Sub
41
     End Sub
42
+    Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.Click
43
+        If CheckBox4.Checked = True Then
44
+            CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False : CheckBox5.Checked = True : Button11.Enabled = True
45
+            QA = "Proto"
46
+        Else
47
+            CheckBox4.Checked = False : Button11.Enabled = False
48
+        End If
49
+    End Sub
42
 End Class
50
 End Class

+ 15
- 2
TENDEN-MES-SYS/樣品訂單管理/列印_中文樣品單.Designer.vb 查看文件

39
         Me.PictureBox5 = New System.Windows.Forms.PictureBox()
39
         Me.PictureBox5 = New System.Windows.Forms.PictureBox()
40
         Me.CheckBox2 = New System.Windows.Forms.CheckBox()
40
         Me.CheckBox2 = New System.Windows.Forms.CheckBox()
41
         Me.CheckBox1 = New System.Windows.Forms.CheckBox()
41
         Me.CheckBox1 = New System.Windows.Forms.CheckBox()
42
+        Me.CheckBox3 = New System.Windows.Forms.CheckBox()
42
         CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
43
         CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
43
         CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit()
44
         CType(Me.DataGridView3, System.ComponentModel.ISupportInitialize).BeginInit()
44
         CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
45
         CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
182
         'CheckBox2
183
         'CheckBox2
183
         '
184
         '
184
         Me.CheckBox2.AutoSize = True
185
         Me.CheckBox2.AutoSize = True
185
-        Me.CheckBox2.Location = New System.Drawing.Point(95, 8)
186
+        Me.CheckBox2.Location = New System.Drawing.Point(87, 8)
186
         Me.CheckBox2.Name = "CheckBox2"
187
         Me.CheckBox2.Name = "CheckBox2"
187
         Me.CheckBox2.Size = New System.Drawing.Size(75, 20)
188
         Me.CheckBox2.Size = New System.Drawing.Size(75, 20)
188
         Me.CheckBox2.TabIndex = 393
189
         Me.CheckBox2.TabIndex = 393
192
         'CheckBox1
193
         'CheckBox1
193
         '
194
         '
194
         Me.CheckBox1.AutoSize = True
195
         Me.CheckBox1.AutoSize = True
195
-        Me.CheckBox1.Location = New System.Drawing.Point(14, 8)
196
+        Me.CheckBox1.Location = New System.Drawing.Point(10, 8)
196
         Me.CheckBox1.Name = "CheckBox1"
197
         Me.CheckBox1.Name = "CheckBox1"
197
         Me.CheckBox1.Size = New System.Drawing.Size(75, 20)
198
         Me.CheckBox1.Size = New System.Drawing.Size(75, 20)
198
         Me.CheckBox1.TabIndex = 392
199
         Me.CheckBox1.TabIndex = 392
199
         Me.CheckBox1.Text = "內裏印刷"
200
         Me.CheckBox1.Text = "內裏印刷"
200
         Me.CheckBox1.UseVisualStyleBackColor = True
201
         Me.CheckBox1.UseVisualStyleBackColor = True
201
         '
202
         '
203
+        'CheckBox3
204
+        '
205
+        Me.CheckBox3.AutoSize = True
206
+        Me.CheckBox3.Location = New System.Drawing.Point(166, 8)
207
+        Me.CheckBox3.Name = "CheckBox3"
208
+        Me.CheckBox3.Size = New System.Drawing.Size(87, 20)
209
+        Me.CheckBox3.TabIndex = 394
210
+        Me.CheckBox3.Text = "后套里印刷"
211
+        Me.CheckBox3.UseVisualStyleBackColor = True
212
+        '
202
         '列印_中文樣品單
213
         '列印_中文樣品單
203
         '
214
         '
204
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
215
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
205
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
216
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
206
         Me.ClientSize = New System.Drawing.Size(252, 100)
217
         Me.ClientSize = New System.Drawing.Size(252, 100)
218
+        Me.Controls.Add(Me.CheckBox3)
207
         Me.Controls.Add(Me.CheckBox2)
219
         Me.Controls.Add(Me.CheckBox2)
208
         Me.Controls.Add(Me.CheckBox1)
220
         Me.Controls.Add(Me.CheckBox1)
209
         Me.Controls.Add(Me.PictureBox5)
221
         Me.Controls.Add(Me.PictureBox5)
249
     Friend WithEvents PictureBox5 As PictureBox
261
     Friend WithEvents PictureBox5 As PictureBox
250
     Friend WithEvents CheckBox2 As CheckBox
262
     Friend WithEvents CheckBox2 As CheckBox
251
     Friend WithEvents CheckBox1 As CheckBox
263
     Friend WithEvents CheckBox1 As CheckBox
264
+    Friend WithEvents CheckBox3 As CheckBox
252
 End Class
265
 End Class

+ 5
- 2
TENDEN-MES-SYS/樣品訂單管理/列印_中文樣品單.vb 查看文件

207
         xlSheet.Cells(位置8 + 2, 1) = "FINISH : "
207
         xlSheet.Cells(位置8 + 2, 1) = "FINISH : "
208
     End Sub
208
     End Sub
209
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
209
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
210
-        If CheckBox1.Checked = False And CheckBox2.Checked = False Then
211
-            MsgBox("請選擇內印刷或是大底印刷最少要選擇一個")
210
+        If CheckBox1.Checked = False And CheckBox2.Checked = False And CheckBox3.Checked = False Then
211
+            MsgBox("請選擇上面的選項,最少要選擇一個!!")
212
         Else
212
         Else
213
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
213
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
214
             If CheckBox1.Checked = True Then
214
             If CheckBox1.Checked = True Then
217
             ElseIf CheckBox2.Checked = True Then
217
             ElseIf CheckBox2.Checked = True Then
218
                 SQL1 = "UPDATE 確認樣品單抬頭 SET 貼標印刷分類 = N'大底貼標:' " &
218
                 SQL1 = "UPDATE 確認樣品單抬頭 SET 貼標印刷分類 = N'大底貼標:' " &
219
                        "WHERE (樣品流水號 = '" & DataGridView1.Rows(0).Cells("樣品流水號").Value & "')"
219
                        "WHERE (樣品流水號 = '" & DataGridView1.Rows(0).Cells("樣品流水號").Value & "')"
220
+            ElseIf CheckBox3.Checked = True Then
221
+                SQL1 = "UPDATE 確認樣品單抬頭 SET 貼標印刷分類 = N'后套里印刷:' " &
222
+                       "WHERE (樣品流水號 = '" & DataGridView1.Rows(0).Cells("樣品流水號").Value & "')"
220
             End If
223
             End If
221
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
224
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
222
             Set_訂單清單1()
225
             Set_訂單清單1()

+ 78
- 78
TENDEN-MES-SYS/資料庫系統管理/FTP資料夾管理.Designer.vb 查看文件

23
     <System.Diagnostics.DebuggerStepThrough()>
23
     <System.Diagnostics.DebuggerStepThrough()>
24
     Private  Sub InitializeComponent()
24
     Private  Sub InitializeComponent()
25
         Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
25
         Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Me.Button3 = New System.Windows.Forms.Button()
27
-        Me.Button2 = New System.Windows.Forms.Button()
28
-        Me.Button1 = New System.Windows.Forms.Button()
29
-        Me.TextBox3 = New System.Windows.Forms.TextBox()
30
-        Me.TextBox2 = New System.Windows.Forms.TextBox()
31
-        Me.TextBox1 = New System.Windows.Forms.TextBox()
32
-        Me.DataGridView1 = New System.Windows.Forms.DataGridView()
26
+        Me.刪除_bt = New System.Windows.Forms.Button()
27
+        Me.修改_bt = New System.Windows.Forms.Button()
28
+        Me.新增_bt = New System.Windows.Forms.Button()
29
+        Me.備註_tb = New System.Windows.Forms.TextBox()
30
+        Me.指定頁面_tb = New System.Windows.Forms.TextBox()
31
+        Me.資料夾名稱_tb = New System.Windows.Forms.TextBox()
32
+        Me.使用者清單_dgv = New System.Windows.Forms.DataGridView()
33
         Me.Label12 = New System.Windows.Forms.Label()
33
         Me.Label12 = New System.Windows.Forms.Label()
34
-        Me.WebBrowser1 = New System.Windows.Forms.WebBrowser()
35
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
34
+        Me.伺服器FTP文件夾_wb = New System.Windows.Forms.WebBrowser()
35
+        CType(Me.使用者清單_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
36
         Me.SuspendLayout()
36
         Me.SuspendLayout()
37
         '
37
         '
38
-        'Button3
38
+        '刪除_bt
39
         '
39
         '
40
-        Me.Button3.Location = New System.Drawing.Point(678, 8)
41
-        Me.Button3.Name = "Button3"
42
-        Me.Button3.Size = New System.Drawing.Size(75, 23)
43
-        Me.Button3.TabIndex = 603
44
-        Me.Button3.Text = "刪除"
45
-        Me.Button3.UseVisualStyleBackColor = True
40
+        Me.刪除_bt.Location = New System.Drawing.Point(678, 8)
41
+        Me.刪除_bt.Name = "刪除_bt"
42
+        Me.刪除_bt.Size = New System.Drawing.Size(75, 23)
43
+        Me.刪除_bt.TabIndex = 603
44
+        Me.刪除_bt.Text = "刪除"
45
+        Me.刪除_bt.UseVisualStyleBackColor = True
46
         '
46
         '
47
-        'Button2
47
+        '修改_bt
48
         '
48
         '
49
-        Me.Button2.Location = New System.Drawing.Point(597, 8)
50
-        Me.Button2.Name = "Button2"
51
-        Me.Button2.Size = New System.Drawing.Size(75, 23)
52
-        Me.Button2.TabIndex = 602
53
-        Me.Button2.Text = "修改"
54
-        Me.Button2.UseVisualStyleBackColor = True
49
+        Me.修改_bt.Location = New System.Drawing.Point(597, 8)
50
+        Me.修改_bt.Name = "修改_bt"
51
+        Me.修改_bt.Size = New System.Drawing.Size(75, 23)
52
+        Me.修改_bt.TabIndex = 602
53
+        Me.修改_bt.Text = "修改"
54
+        Me.修改_bt.UseVisualStyleBackColor = True
55
         '
55
         '
56
-        'Button1
56
+        '新增_bt
57
         '
57
         '
58
-        Me.Button1.Location = New System.Drawing.Point(516, 8)
59
-        Me.Button1.Name = "Button1"
60
-        Me.Button1.Size = New System.Drawing.Size(75, 23)
61
-        Me.Button1.TabIndex = 601
62
-        Me.Button1.Text = "新增"
63
-        Me.Button1.UseVisualStyleBackColor = True
58
+        Me.新增_bt.Location = New System.Drawing.Point(516, 8)
59
+        Me.新增_bt.Name = "新增_bt"
60
+        Me.新增_bt.Size = New System.Drawing.Size(75, 23)
61
+        Me.新增_bt.TabIndex = 601
62
+        Me.新增_bt.Text = "新增"
63
+        Me.新增_bt.UseVisualStyleBackColor = True
64
         '
64
         '
65
-        'TextBox3
65
+        '備註_tb
66
         '
66
         '
67
-        Me.TextBox3.Location = New System.Drawing.Point(307, 8)
68
-        Me.TextBox3.Name = "TextBox3"
69
-        Me.TextBox3.Size = New System.Drawing.Size(200, 23)
70
-        Me.TextBox3.TabIndex = 600
67
+        Me.備註_tb.Location = New System.Drawing.Point(307, 8)
68
+        Me.備註_tb.Name = "備註_tb"
69
+        Me.備註_tb.Size = New System.Drawing.Size(200, 23)
70
+        Me.備註_tb.TabIndex = 600
71
         '
71
         '
72
-        'TextBox2
72
+        '指定頁面_tb
73
         '
73
         '
74
-        Me.TextBox2.Location = New System.Drawing.Point(101, 8)
75
-        Me.TextBox2.Name = "TextBox2"
76
-        Me.TextBox2.Size = New System.Drawing.Size(200, 23)
77
-        Me.TextBox2.TabIndex = 599
74
+        Me.指定頁面_tb.Location = New System.Drawing.Point(101, 8)
75
+        Me.指定頁面_tb.Name = "指定頁面_tb"
76
+        Me.指定頁面_tb.Size = New System.Drawing.Size(200, 23)
77
+        Me.指定頁面_tb.TabIndex = 599
78
         '
78
         '
79
-        'TextBox1
79
+        '資料夾名稱_tb
80
         '
80
         '
81
-        Me.TextBox1.Location = New System.Drawing.Point(25, 8)
82
-        Me.TextBox1.Name = "TextBox1"
83
-        Me.TextBox1.Size = New System.Drawing.Size(70, 23)
84
-        Me.TextBox1.TabIndex = 598
81
+        Me.資料夾名稱_tb.Location = New System.Drawing.Point(25, 8)
82
+        Me.資料夾名稱_tb.Name = "資料夾名稱_tb"
83
+        Me.資料夾名稱_tb.Size = New System.Drawing.Size(70, 23)
84
+        Me.資料夾名稱_tb.TabIndex = 598
85
         '
85
         '
86
-        'DataGridView1
86
+        '使用者清單_dgv
87
         '
87
         '
88
         DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
88
         DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
89
-        Me.DataGridView1.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
90
-        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
91
-        Me.DataGridView1.Location = New System.Drawing.Point(12, 37)
92
-        Me.DataGridView1.Name = "DataGridView1"
93
-        Me.DataGridView1.RowHeadersWidth = 5
94
-        Me.DataGridView1.RowTemplate.Height = 24
95
-        Me.DataGridView1.Size = New System.Drawing.Size(495, 945)
96
-        Me.DataGridView1.TabIndex = 597
89
+        Me.使用者清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
90
+        Me.使用者清單_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
91
+        Me.使用者清單_dgv.Location = New System.Drawing.Point(12, 37)
92
+        Me.使用者清單_dgv.Name = "使用者清單_dgv"
93
+        Me.使用者清單_dgv.RowHeadersWidth = 5
94
+        Me.使用者清單_dgv.RowTemplate.Height = 24
95
+        Me.使用者清單_dgv.Size = New System.Drawing.Size(495, 945)
96
+        Me.使用者清單_dgv.TabIndex = 597
97
         '
97
         '
98
         'Label12
98
         'Label12
99
         '
99
         '
105
         Me.Label12.TabIndex = 596
105
         Me.Label12.TabIndex = 596
106
         Me.Label12.Text = "伺服器FTP文件夾"
106
         Me.Label12.Text = "伺服器FTP文件夾"
107
         '
107
         '
108
-        'WebBrowser1
108
+        '伺服器FTP文件夾_wb
109
         '
109
         '
110
-        Me.WebBrowser1.Location = New System.Drawing.Point(517, 37)
111
-        Me.WebBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
112
-        Me.WebBrowser1.Name = "WebBrowser1"
113
-        Me.WebBrowser1.Size = New System.Drawing.Size(1386, 945)
114
-        Me.WebBrowser1.TabIndex = 595
115
-        Me.WebBrowser1.Url = New System.Uri("", System.UriKind.Relative)
110
+        Me.伺服器FTP文件夾_wb.Location = New System.Drawing.Point(517, 37)
111
+        Me.伺服器FTP文件夾_wb.MinimumSize = New System.Drawing.Size(20, 20)
112
+        Me.伺服器FTP文件夾_wb.Name = "伺服器FTP文件夾_wb"
113
+        Me.伺服器FTP文件夾_wb.Size = New System.Drawing.Size(1386, 945)
114
+        Me.伺服器FTP文件夾_wb.TabIndex = 595
115
+        Me.伺服器FTP文件夾_wb.Url = New System.Uri("", System.UriKind.Relative)
116
         '
116
         '
117
         'FTP資料夾管理
117
         'FTP資料夾管理
118
         '
118
         '
119
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
119
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
120
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
120
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
121
         Me.ClientSize = New System.Drawing.Size(1914, 991)
121
         Me.ClientSize = New System.Drawing.Size(1914, 991)
122
-        Me.Controls.Add(Me.Button3)
123
-        Me.Controls.Add(Me.Button2)
124
-        Me.Controls.Add(Me.Button1)
125
-        Me.Controls.Add(Me.TextBox3)
126
-        Me.Controls.Add(Me.TextBox2)
127
-        Me.Controls.Add(Me.TextBox1)
128
-        Me.Controls.Add(Me.DataGridView1)
122
+        Me.Controls.Add(Me.刪除_bt)
123
+        Me.Controls.Add(Me.修改_bt)
124
+        Me.Controls.Add(Me.新增_bt)
125
+        Me.Controls.Add(Me.備註_tb)
126
+        Me.Controls.Add(Me.指定頁面_tb)
127
+        Me.Controls.Add(Me.資料夾名稱_tb)
128
+        Me.Controls.Add(Me.使用者清單_dgv)
129
         Me.Controls.Add(Me.Label12)
129
         Me.Controls.Add(Me.Label12)
130
-        Me.Controls.Add(Me.WebBrowser1)
130
+        Me.Controls.Add(Me.伺服器FTP文件夾_wb)
131
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
131
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
132
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
132
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
133
         Me.Name = "FTP資料夾管理"
133
         Me.Name = "FTP資料夾管理"
134
         Me.Text = "FTP資料夾管理"
134
         Me.Text = "FTP資料夾管理"
135
-        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
135
+        CType(Me.使用者清單_dgv, System.ComponentModel.ISupportInitialize).EndInit()
136
         Me.ResumeLayout(False)
136
         Me.ResumeLayout(False)
137
         Me.PerformLayout()
137
         Me.PerformLayout()
138
 
138
 
139
     End Sub
139
     End Sub
140
 
140
 
141
-    Friend WithEvents Button3 As Button
142
-    Friend WithEvents Button2 As Button
143
-    Friend WithEvents Button1 As Button
144
-    Friend WithEvents TextBox3 As TextBox
145
-    Friend WithEvents TextBox2 As TextBox
146
-    Friend WithEvents TextBox1 As TextBox
147
-    Friend WithEvents DataGridView1 As DataGridView
141
+    Friend WithEvents 刪除_bt As Button
142
+    Friend WithEvents 修改_bt As Button
143
+    Friend WithEvents 新增_bt As Button
144
+    Friend WithEvents 備註_tb As TextBox
145
+    Friend WithEvents 指定頁面_tb As TextBox
146
+    Friend WithEvents 資料夾名稱_tb As TextBox
147
+    Friend WithEvents 使用者清單_dgv As DataGridView
148
     Friend WithEvents Label12 As Label
148
     Friend WithEvents Label12 As Label
149
-    Friend WithEvents WebBrowser1 As WebBrowser
149
+    Friend WithEvents 伺服器FTP文件夾_wb As WebBrowser
150
 End Class
150
 End Class
151
 
151
 

+ 20
- 19
TENDEN-MES-SYS/資料庫系統管理/FTP資料夾管理.vb 查看文件

6
     Dim cmd As New SqlCommand
6
     Dim cmd As New SqlCommand
7
     Dim ds As New DataSet
7
     Dim ds As New DataSet
8
     Dim dr As SqlDataReader
8
     Dim dr As SqlDataReader
9
-    Private  Sub Set_使用者清單()
10
-        DataGridView1.DataSource = Nothing : ds.Clear()
11
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
-        DataGridView1.ColumnHeadersHeight = 25
13
-        DataGridView1.AllowUserToAddRows = False
9
+    Private Sub Set_使用者清單()
10
+        使用者清單_dgv.DataSource = Nothing : ds.Clear()
11
+        使用者清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
12
+        使用者清單_dgv.ColumnHeadersHeight = 25
13
+        使用者清單_dgv.AllowUserToAddRows = False
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
14
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
15
         SQL1 = "SELECT 資料夾名稱, 指定頁面, 備註 FROM FTP資料夾管理"
15
         SQL1 = "SELECT 資料夾名稱, 指定頁面, 備註 FROM FTP資料夾管理"
16
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
16
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds)
17
+        使用者清單_dgv.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
17
     End Sub
18
     End Sub
18
-    Private  Sub Set_grid()
19
-        DataGridView1.Columns(0).Width = 70 : DataGridView1.Columns(1).Width = 200 : DataGridView1.Columns(2).Width = 200
19
+    Private Sub Set_grid()
20
+        使用者清單_dgv.Columns(0).Width = 70 : 使用者清單_dgv.Columns(1).Width = 200 : 使用者清單_dgv.Columns(2).Width = 200
20
     End Sub
21
     End Sub
21
-    Private  Sub FTP資料夾管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
22
+    Private Sub FTP資料夾管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
22
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
23
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
23
         Target1 = Target
24
         Target1 = Target
24
-        WebBrowser1.Url = New Uri(Target1)
25
+        伺服器FTP文件夾_wb.Url = New Uri(Target1)
25
         Set_使用者清單()
26
         Set_使用者清單()
26
     End Sub
27
     End Sub
27
-    Private  Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
28
-        TextBox1.Text = DataGridView1(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView1(1, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView1(2, e.RowIndex).Value.ToString
28
+    Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 使用者清單_dgv.CellClick
29
+        資料夾名稱_tb.Text = 使用者清單_dgv(0, e.RowIndex).Value.ToString : 指定頁面_tb.Text = 使用者清單_dgv(1, e.RowIndex).Value.ToString
30
+        備註_tb.Text = 使用者清單_dgv(2, e.RowIndex).Value.ToString
29
     End Sub
31
     End Sub
30
-    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
32
+    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles 新增_bt.Click
31
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
33
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
32
         SQL1 = "INSERT INTO FTP資料夾管理 (資料夾名稱, 指定頁面, 備註) " &
34
         SQL1 = "INSERT INTO FTP資料夾管理 (資料夾名稱, 指定頁面, 備註) " &
33
-               "VALUES (N'" & TextBox1.Text & "',N'" & TextBox2.Text & "',N'" & TextBox3.Text & "')"
35
+               "VALUES (N'" & 資料夾名稱_tb.Text & "',N'" & 指定頁面_tb.Text & "',N'" & 備註_tb.Text & "')"
34
         cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery()
36
         cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery()
35
         conn.Close()
37
         conn.Close()
36
         Set_使用者清單()
38
         Set_使用者清單()
37
     End Sub
39
     End Sub
38
-    Private  Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
40
+    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles 修改_bt.Click
39
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
41
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
40
-        SQL1 = "UPDATE FTP資料夾管理 SET 指定頁面 = N'" & TextBox2.Text & "', 備註 = N'" & TextBox3.Text & "' WHERE (資料夾名稱 = N'" & TextBox1.Text & "')"
42
+        SQL1 = "UPDATE FTP資料夾管理 SET 指定頁面 = N'" & 指定頁面_tb.Text & "', 備註 = N'" & 備註_tb.Text & "' WHERE (資料夾名稱 = N'" & 資料夾名稱_tb.Text & "')"
41
         cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery()
43
         cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery()
42
         conn.Close()
44
         conn.Close()
43
         Set_使用者清單()
45
         Set_使用者清單()
44
     End Sub
46
     End Sub
45
-    Private  Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
46
-        SQL1 = "DELETE FROM FTP資料夾管理 WHERE (資料夾名稱 = N'" & TextBox1.Text & "')"
47
+    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
48
+        SQL1 = "DELETE FROM FTP資料夾管理 WHERE (資料夾名稱 = N'" & 資料夾名稱_tb.Text & "')"
47
         cmd.CommandText = SQL1 : cmd.Connection = conn
49
         cmd.CommandText = SQL1 : cmd.Connection = conn
48
         If conn.State = ConnectionState.Closed Then : conn.Open() : End If
50
         If conn.State = ConnectionState.Closed Then : conn.Open() : End If
49
         Dim aa As MsgBoxResult
51
         Dim aa As MsgBoxResult
52
         conn.Close()
54
         conn.Close()
53
         Set_使用者清單()
55
         Set_使用者清單()
54
     End Sub
56
     End Sub
55
-
56
 End Class
57
 End Class

+ 52
- 52
TENDEN-MES-SYS/資料庫系統管理/人員ID卡系統配置設定.Designer.vb 查看文件

22
     '請勿使用程式碼編輯器進行修改。
22
     '請勿使用程式碼編輯器進行修改。
23
     <System.Diagnostics.DebuggerStepThrough()> _
23
     <System.Diagnostics.DebuggerStepThrough()> _
24
     Private  Sub InitializeComponent()
24
     Private  Sub InitializeComponent()
25
-        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
-        Me.Button1 = New System.Windows.Forms.Button()
27
-        Me.TextBox3 = New System.Windows.Forms.TextBox()
25
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Me.卡片配對_bt = New System.Windows.Forms.Button()
27
+        Me.ID卡號_tb = New System.Windows.Forms.TextBox()
28
         Me.Label4 = New System.Windows.Forms.Label()
28
         Me.Label4 = New System.Windows.Forms.Label()
29
-        Me.TextBox2 = New System.Windows.Forms.TextBox()
29
+        Me.帳號_tb = New System.Windows.Forms.TextBox()
30
         Me.Label1 = New System.Windows.Forms.Label()
30
         Me.Label1 = New System.Windows.Forms.Label()
31
-        Me.TextBox1 = New System.Windows.Forms.TextBox()
31
+        Me.姓名_tb = New System.Windows.Forms.TextBox()
32
         Me.Label3 = New System.Windows.Forms.Label()
32
         Me.Label3 = New System.Windows.Forms.Label()
33
         Me.Label2 = New System.Windows.Forms.Label()
33
         Me.Label2 = New System.Windows.Forms.Label()
34
-        Me.DataGridView2 = New System.Windows.Forms.DataGridView()
35
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).BeginInit()
34
+        Me.人事資料表清單_dgv = New System.Windows.Forms.DataGridView()
35
+        CType(Me.人事資料表清單_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
36
         Me.SuspendLayout()
36
         Me.SuspendLayout()
37
         '
37
         '
38
-        'Button1
38
+        '卡片配對_bt
39
         '
39
         '
40
-        Me.Button1.Font = New System.Drawing.Font("微軟正黑體", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
41
-        Me.Button1.Location = New System.Drawing.Point(501, 126)
42
-        Me.Button1.Name = "Button1"
43
-        Me.Button1.Size = New System.Drawing.Size(233, 128)
44
-        Me.Button1.TabIndex = 726
45
-        Me.Button1.Text = "卡片配對"
46
-        Me.Button1.UseVisualStyleBackColor = True
40
+        Me.卡片配對_bt.Font = New System.Drawing.Font("微軟正黑體", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
41
+        Me.卡片配對_bt.Location = New System.Drawing.Point(501, 126)
42
+        Me.卡片配對_bt.Name = "卡片配對_bt"
43
+        Me.卡片配對_bt.Size = New System.Drawing.Size(233, 128)
44
+        Me.卡片配對_bt.TabIndex = 726
45
+        Me.卡片配對_bt.Text = "卡片配對"
46
+        Me.卡片配對_bt.UseVisualStyleBackColor = True
47
         '
47
         '
48
-        'TextBox3
48
+        'ID卡號_tb
49
         '
49
         '
50
-        Me.TextBox3.ImeMode = System.Windows.Forms.ImeMode.Disable
51
-        Me.TextBox3.Location = New System.Drawing.Point(548, 97)
52
-        Me.TextBox3.Name = "TextBox3"
53
-        Me.TextBox3.Size = New System.Drawing.Size(186, 23)
54
-        Me.TextBox3.TabIndex = 725
50
+        Me.ID卡號_tb.ImeMode = System.Windows.Forms.ImeMode.Disable
51
+        Me.ID卡號_tb.Location = New System.Drawing.Point(548, 97)
52
+        Me.ID卡號_tb.Name = "ID卡號_tb"
53
+        Me.ID卡號_tb.Size = New System.Drawing.Size(186, 23)
54
+        Me.ID卡號_tb.TabIndex = 725
55
         '
55
         '
56
         'Label4
56
         'Label4
57
         '
57
         '
62
         Me.Label4.TabIndex = 724
62
         Me.Label4.TabIndex = 724
63
         Me.Label4.Text = "ID卡號"
63
         Me.Label4.Text = "ID卡號"
64
         '
64
         '
65
-        'TextBox2
65
+        '帳號_tb
66
         '
66
         '
67
-        Me.TextBox2.Location = New System.Drawing.Point(548, 68)
68
-        Me.TextBox2.Name = "TextBox2"
69
-        Me.TextBox2.Size = New System.Drawing.Size(186, 23)
70
-        Me.TextBox2.TabIndex = 723
67
+        Me.帳號_tb.Location = New System.Drawing.Point(548, 68)
68
+        Me.帳號_tb.Name = "帳號_tb"
69
+        Me.帳號_tb.Size = New System.Drawing.Size(186, 23)
70
+        Me.帳號_tb.TabIndex = 723
71
         '
71
         '
72
         'Label1
72
         'Label1
73
         '
73
         '
78
         Me.Label1.TabIndex = 722
78
         Me.Label1.TabIndex = 722
79
         Me.Label1.Text = "帳號"
79
         Me.Label1.Text = "帳號"
80
         '
80
         '
81
-        'TextBox1
81
+        '姓名_tb
82
         '
82
         '
83
-        Me.TextBox1.Location = New System.Drawing.Point(548, 39)
84
-        Me.TextBox1.Name = "TextBox1"
85
-        Me.TextBox1.Size = New System.Drawing.Size(186, 23)
86
-        Me.TextBox1.TabIndex = 721
83
+        Me.姓名_tb.Location = New System.Drawing.Point(548, 39)
84
+        Me.姓名_tb.Name = "姓名_tb"
85
+        Me.姓名_tb.Size = New System.Drawing.Size(186, 23)
86
+        Me.姓名_tb.TabIndex = 721
87
         '
87
         '
88
         'Label3
88
         'Label3
89
         '
89
         '
104
         Me.Label2.TabIndex = 719
104
         Me.Label2.TabIndex = 719
105
         Me.Label2.Text = "人事資料表清單"
105
         Me.Label2.Text = "人事資料表清單"
106
         '
106
         '
107
-        'DataGridView2
107
+        '人事資料表清單_dgv
108
         '
108
         '
109
-        DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
110
-        Me.DataGridView2.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
111
-        Me.DataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
112
-        Me.DataGridView2.Location = New System.Drawing.Point(17, 42)
113
-        Me.DataGridView2.Name = "DataGridView2"
114
-        Me.DataGridView2.RowHeadersWidth = 5
115
-        Me.DataGridView2.RowTemplate.Height = 24
116
-        Me.DataGridView2.Size = New System.Drawing.Size(475, 934)
117
-        Me.DataGridView2.TabIndex = 718
109
+        DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
110
+        Me.人事資料表清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
111
+        Me.人事資料表清單_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
112
+        Me.人事資料表清單_dgv.Location = New System.Drawing.Point(17, 42)
113
+        Me.人事資料表清單_dgv.Name = "人事資料表清單_dgv"
114
+        Me.人事資料表清單_dgv.RowHeadersWidth = 5
115
+        Me.人事資料表清單_dgv.RowTemplate.Height = 24
116
+        Me.人事資料表清單_dgv.Size = New System.Drawing.Size(475, 934)
117
+        Me.人事資料表清單_dgv.TabIndex = 718
118
         '
118
         '
119
         '人員ID卡系統配置設定
119
         '人員ID卡系統配置設定
120
         '
120
         '
121
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
121
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
122
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
122
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
123
         Me.ClientSize = New System.Drawing.Size(1914, 991)
123
         Me.ClientSize = New System.Drawing.Size(1914, 991)
124
-        Me.Controls.Add(Me.Button1)
125
-        Me.Controls.Add(Me.TextBox3)
124
+        Me.Controls.Add(Me.卡片配對_bt)
125
+        Me.Controls.Add(Me.ID卡號_tb)
126
         Me.Controls.Add(Me.Label4)
126
         Me.Controls.Add(Me.Label4)
127
-        Me.Controls.Add(Me.TextBox2)
127
+        Me.Controls.Add(Me.帳號_tb)
128
         Me.Controls.Add(Me.Label1)
128
         Me.Controls.Add(Me.Label1)
129
-        Me.Controls.Add(Me.TextBox1)
129
+        Me.Controls.Add(Me.姓名_tb)
130
         Me.Controls.Add(Me.Label3)
130
         Me.Controls.Add(Me.Label3)
131
         Me.Controls.Add(Me.Label2)
131
         Me.Controls.Add(Me.Label2)
132
-        Me.Controls.Add(Me.DataGridView2)
132
+        Me.Controls.Add(Me.人事資料表清單_dgv)
133
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
133
         Me.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
134
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
134
         Me.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
135
         Me.Name = "人員ID卡系統配置設定"
135
         Me.Name = "人員ID卡系統配置設定"
136
         Me.Text = "人員ID卡系統配置設定"
136
         Me.Text = "人員ID卡系統配置設定"
137
-        CType(Me.DataGridView2, System.ComponentModel.ISupportInitialize).EndInit()
137
+        CType(Me.人事資料表清單_dgv, System.ComponentModel.ISupportInitialize).EndInit()
138
         Me.ResumeLayout(False)
138
         Me.ResumeLayout(False)
139
         Me.PerformLayout()
139
         Me.PerformLayout()
140
 
140
 
141
     End Sub
141
     End Sub
142
 
142
 
143
-    Friend WithEvents Button1 As Button
144
-    Friend WithEvents TextBox3 As TextBox
143
+    Friend WithEvents 卡片配對_bt As Button
144
+    Friend WithEvents ID卡號_tb As TextBox
145
     Friend WithEvents Label4 As Label
145
     Friend WithEvents Label4 As Label
146
-    Friend WithEvents TextBox2 As TextBox
146
+    Friend WithEvents 帳號_tb As TextBox
147
     Friend WithEvents Label1 As Label
147
     Friend WithEvents Label1 As Label
148
-    Friend WithEvents TextBox1 As TextBox
148
+    Friend WithEvents 姓名_tb As TextBox
149
     Friend WithEvents Label3 As Label
149
     Friend WithEvents Label3 As Label
150
     Friend WithEvents Label2 As Label
150
     Friend WithEvents Label2 As Label
151
-    Friend WithEvents DataGridView2 As DataGridView
151
+    Friend WithEvents 人事資料表清單_dgv As DataGridView
152
 End Class
152
 End Class

+ 16
- 16
TENDEN-MES-SYS/資料庫系統管理/人員ID卡系統配置設定.vb 查看文件

8
     Dim dr As SqlDataReader
8
     Dim dr As SqlDataReader
9
     Dim 編號 As String
9
     Dim 編號 As String
10
     Private  Sub Set_人員清單()
10
     Private  Sub Set_人員清單()
11
-        DataGridView2.DataSource = Nothing : ds1.Clear()
12
-        DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
13
-        DataGridView2.ColumnHeadersHeight = 25
14
-        DataGridView2.AllowUserToAddRows = False
11
+        人事資料表清單_dgv.DataSource = Nothing : ds1.Clear()
12
+        人事資料表清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
13
+        人事資料表清單_dgv.ColumnHeadersHeight = 25
14
+        人事資料表清單_dgv.AllowUserToAddRows = False
15
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
15
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
16
         SQL1 = "SELECT 姓名, 帳號, ID卡號 FROM 使用者 ORDER BY 姓名"
16
         SQL1 = "SELECT 姓名, 帳號, ID卡號 FROM 使用者 ORDER BY 姓名"
17
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close() : Set_grid1()
17
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : 人事資料表清單_dgv.DataSource = ds1.Tables(0) : conn.Close() : Set_grid1()
18
     End Sub
18
     End Sub
19
     Private  Sub Set_grid1()
19
     Private  Sub Set_grid1()
20
-        DataGridView2.Columns(0).Width = 150 : DataGridView2.Columns(1).Width = 150 : DataGridView2.Columns(2).Width = 150
20
+        人事資料表清單_dgv.Columns(0).Width = 150 : 人事資料表清單_dgv.Columns(1).Width = 150 : 人事資料表清單_dgv.Columns(2).Width = 150
21
     End Sub
21
     End Sub
22
     Private  Sub 人員ID卡系統配置設定_Load(sender As Object, e As EventArgs) Handles MyBase.Load
22
     Private  Sub 人員ID卡系統配置設定_Load(sender As Object, e As EventArgs) Handles MyBase.Load
23
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
23
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
24
-        Set_人員清單() : TextBox1.Enabled = False : TextBox2.Enabled = False
25
-        TextBox3.Focus()
24
+        Set_人員清單() : 姓名_tb.Enabled = False : 帳號_tb.Enabled = False
25
+        ID卡號_tb.Focus()
26
     End Sub
26
     End Sub
27
-    Private  Sub DataGridView2_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView2.CellClick
27
+    Private  Sub DataGridView2_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 人事資料表清單_dgv.CellClick
28
         If e.RowIndex = -1 Then : Else
28
         If e.RowIndex = -1 Then : Else
29
-            TextBox1.Text = DataGridView2(0, e.RowIndex).Value.ToString : TextBox2.Text = DataGridView2(1, e.RowIndex).Value.ToString
30
-            TextBox3.Focus()
29
+            姓名_tb.Text = 人事資料表清單_dgv(0, e.RowIndex).Value.ToString : 帳號_tb.Text = 人事資料表清單_dgv(1, e.RowIndex).Value.ToString
30
+            ID卡號_tb.Focus()
31
         End If
31
         End If
32
     End Sub
32
     End Sub
33
-    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
34
-        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
33
+    Private  Sub Button1_Click(sender As Object, e As EventArgs) Handles 卡片配對_bt.Click
34
+        If 姓名_tb.Text = "" Or 帳號_tb.Text = "" Or ID卡號_tb.Text = "" Then
35
             MsgBox("輸入資料有誤")
35
             MsgBox("輸入資料有誤")
36
         Else
36
         Else
37
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
37
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
38
-            SQL1 = "UPDATE 使用者 SET ID卡號 = N'" & TextBox3.Text & "' WHERE (帳號 = N'" & TextBox2.Text & "') AND (姓名 = N'" & TextBox1.Text & "')"
38
+            SQL1 = "UPDATE 使用者 SET ID卡號 = N'" & ID卡號_tb.Text & "' WHERE (帳號 = N'" & 帳號_tb.Text & "') AND (姓名 = N'" & 姓名_tb.Text & "')"
39
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close() : conn.Close()
39
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close() : conn.Close()
40
-            MsgBox("卡片與系統帳號配對完成") : TextBox3.Text = ""
40
+            MsgBox("卡片與系統帳號配對完成") : ID卡號_tb.Text = ""
41
         End If
41
         End If
42
-        Set_人員清單() : TextBox3.Focus()
42
+        Set_人員清單() : ID卡號_tb.Focus()
43
     End Sub
43
     End Sub
44
 End Class
44
 End Class

+ 477
- 95
TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.Designer.vb
文件差異過大導致無法顯示
查看文件


+ 3
- 0
TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.resx 查看文件

117
   <resheader name="writer">
117
   <resheader name="writer">
118
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
   </resheader>
119
   </resheader>
120
+  <metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+    <value>17, 17</value>
122
+  </metadata>
120
 </root>
123
 </root>

+ 526
- 150
TENDEN-MES-SYS/量產訂單管理/訂單列印選擇.vb 查看文件

9
 Imports Microsoft.Office.Interop.Excel.XlThemeColor
9
 Imports Microsoft.Office.Interop.Excel.XlThemeColor
10
 Imports Microsoft.Office.Interop.Excel.XlWindowState
10
 Imports Microsoft.Office.Interop.Excel.XlWindowState
11
 Public Class 訂單列印選擇
11
 Public Class 訂單列印選擇
12
-    Dim conn As New SqlConnection
13
-    Dim da As New SqlDataAdapter
14
-    Dim cmd As New SqlCommand
15
-    Dim ds As New DataSet
16
-    Dim dr As SqlDataReader
17
-    Dim OPEXC(2) As Boolean
12
+    ReadOnly conn As New SqlConnection
13
+    ReadOnly da As New SqlDataAdapter
14
+    ReadOnly cmd As New SqlCommand
15
+    ReadOnly ds As New DataSet
16
+    ReadOnly dr As SqlDataReader
17
+    ReadOnly OPEXC(2) As Boolean
18
+    Dim selectdate As Date : Dim DTP As Date
18
     Dim P As Integer = 0 : Dim R As Integer = 0 : Dim A As Integer = 0 : Dim Q As Integer = 0
19
     Dim P As Integer = 0 : Dim R As Integer = 0 : Dim A As Integer = 0 : Dim Q As Integer = 0
20
+    Dim Index_PRS As Integer = 0 : Dim Index_FTY_XF As Integer = 0 : Dim Index_月_total As Integer = 0
19
     Dim 位置1 As String : Dim 位置2 As String : Dim 位置3 As String : Dim 位置4 As String
21
     Dim 位置1 As String : Dim 位置2 As String : Dim 位置3 As String : Dim 位置4 As String
20
     Dim xlApp As Microsoft.Office.Interop.Excel.Application
22
     Dim xlApp As Microsoft.Office.Interop.Excel.Application
21
     Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
23
     Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
22
     Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
24
     Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
23
-    Dim SQL字串1 As String = "SELECT 訂單流水號, 年份季度, 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 客戶交期, 單價, 總金額, 備註, 生產工廠, 訂單種類, 工廠回復交期, CFMSPEC, CFMSAMPLE, TRIAL1, TRIAL2, " &
25
+    ReadOnly SQL字串1 As String = "SELECT 訂單流水號, 年份季度, 客戶訂單號, 形體號, 顏色, 楦型, 訂單數量, 客戶交期, 單價, 總金額, 備註, 生產工廠, 訂單種類, 工廠回復交期, CFMSPEC, CFMSAMPLE, TRIAL1, TRIAL2, " &
24
                    "TRIAL3, TRIAL4, 包裝確認時間, 貼標時間, 裁斷時間, 針車時間, 成型時間, 驗貨時間, 實際離廠日, 資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, 出貨數量, PO_S_Date AS 接單日, " &
26
                    "TRIAL3, TRIAL4, 包裝確認時間, 貼標時間, 裁斷時間, 針車時間, 成型時間, 驗貨時間, 實際離廠日, 資料流水號, 明細建檔, GOODBOX, LEATHER, LEA_Note, 出貨數量, PO_S_Date AS 接單日, " &
25
                    "Requested_XF AS 需求日期, Confirm_XF AS 確認日期, Revised_XF AS 修訂日期, 工廠回復交期 AS 工廠交期, Special_Packaging, Remarks, 出貨地, TVW, 楦頭號, 材質, 七號模具, TRIAL1 AS T1, " &
27
                    "Requested_XF AS 需求日期, Confirm_XF AS 確認日期, Revised_XF AS 修訂日期, 工廠回復交期 AS 工廠交期, Special_Packaging, Remarks, 出貨地, TVW, 楦頭號, 材質, 七號模具, TRIAL1 AS T1, " &
26
                    "TRIAL2 AS T2, 長期試穿 AS WEAR_TEST, CFMSAMPLE AS CFM, TRIAL3 AS T3, TRIAL4 AS T4, CFMSPEC AS TEST, 面料, 副料, 中底, 鞋墊, 大底, 跟, 包裝確認時間 AS 包裝, 裁斷時間 AS 裁斷, " &
28
                    "TRIAL2 AS T2, 長期試穿 AS WEAR_TEST, CFMSAMPLE AS CFM, TRIAL3 AS T3, TRIAL4 AS T4, CFMSPEC AS TEST, 面料, 副料, 中底, 鞋墊, 大底, 跟, 包裝確認時間 AS 包裝, 裁斷時間 AS 裁斷, " &
27
                    "針車時間 AS 針車, 成型時間 AS 成型, 驗貨時間 AS 驗貨, 工廠進度表備註1, 工廠進度表備註2, 客戶包裝確認, 東莞業務備註, 工廠確認, 利威確認, 結關日 FROM 訂單控制表"
29
                    "針車時間 AS 針車, 成型時間 AS 成型, 驗貨時間 AS 驗貨, 工廠進度表備註1, 工廠進度表備註2, 客戶包裝確認, 東莞業務備註, 工廠確認, 利威確認, 結關日 FROM 訂單控制表"
28
-    Dim SQL字串2 As String = " ORDER BY SUBSTRING(訂單流水號, 4, 6) DESC"
29
-    Private  Sub Set_DGV1載入前設定()
30
+    ReadOnly SQL字串2 As String = " ORDER BY SUBSTRING(訂單流水號, 4, 6) DESC"
31
+    Private Sub Set_DGV1載入前設定()
30
         DataGridView1.DataSource = Nothing : ds.Clear()
32
         DataGridView1.DataSource = Nothing : ds.Clear()
31
         DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
33
         DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
32
         DataGridView1.ColumnHeadersHeight = 25
34
         DataGridView1.ColumnHeadersHeight = 25
33
         DataGridView1.AllowUserToAddRows = False
35
         DataGridView1.AllowUserToAddRows = False
34
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
36
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
35
     End Sub
37
     End Sub
36
-    Private  Sub Set_DGV1載入後設定()
38
+    Private Sub Set_DGV1載入後設定()
37
         cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
39
         cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
38
     End Sub
40
     End Sub
39
-    Private  Sub Set_訂單清單()
41
+    Private Sub Set_訂單清單()
40
         Set_DGV1載入前設定()
42
         Set_DGV1載入前設定()
41
         If OPEXC(0) = True Then
43
         If OPEXC(0) = True Then
42
             SQL1 = SQL字串1 & 列印用SQL & "AND (生產工廠 LIKE 'JH')" & SQL字串2
44
             SQL1 = SQL字串1 & 列印用SQL & "AND (生產工廠 LIKE 'JH')" & SQL字串2
47
         End If
49
         End If
48
         Set_DGV1載入後設定()
50
         Set_DGV1載入後設定()
49
     End Sub
51
     End Sub
50
-    Private  Sub Set_格式設定()
51
-        DataGridView1.Visible = False
52
+    Private Sub Set_格式設定()
53
+        DataGridView1.Visible = True
52
         If CC(7) = False Then
54
         If CC(7) = False Then
53
             CheckBox9.Visible = False : Label9.Visible = False : CheckBox10.Visible = False : Label10.Visible = False
55
             CheckBox9.Visible = False : Label9.Visible = False : CheckBox10.Visible = False : Label10.Visible = False
54
         End If
56
         End If
55
     End Sub
57
     End Sub
56
-    Private  Sub Set_循環列印()
58
+    Private Sub Set_循環列印()
57
         Dim W As Integer = 2
59
         Dim W As Integer = 2
58
-        If CheckBox1.Checked = True Then : xlSheet.Cells(3, W) = "TENDENZA PO#" : Q = W : W = W + 1 : End If
59
-        If CheckBox2.Checked = True Then : xlSheet.Cells(3, W) = "SEASON" : Q = W : W = W + 1 : End If
60
-        If CheckBox3.Checked = True Then : xlSheet.Cells(3, W) = "VIONIC PO#" : Q = W : W = W + 1 : End If
61
-        If CheckBox4.Checked = True Then : xlSheet.Cells(3, W) = "STYLE" : Q = W : W = W + 1 : End If
62
-        If CheckBox5.Checked = True Then : xlSheet.Cells(3, W) = "COLOR" : Q = W : W = W + 1 : End If
63
-        If CheckBox6.Checked = True Then : xlSheet.Cells(3, W) = "DM" : Q = W : W = W + 1 : End If
64
-        If CheckBox7.Checked = True Then : xlSheet.Cells(3, W) = "PRS" : Q = W : W = W + 1 : End If
65
-        If CheckBox8.Checked = True Then : xlSheet.Cells(3, W) = "CUST X/F" : Q = W : W = W + 1 : End If
66
-        If CheckBox9.Checked = True Then : xlSheet.Cells(3, W) = "PRICE" : Q = W : W = W + 1 : End If
67
-        If CheckBox10.Checked = True Then : xlSheet.Cells(3, W) = "AMOUNT" : Q = W : W = W + 1 : End If
68
-        If CheckBox11.Checked = True Then : xlSheet.Cells(3, W) = "REMARK" : Q = W : W = W + 1 : End If
69
-        If CheckBox12.Checked = True Then : xlSheet.Cells(3, W) = "FTY" : Q = W : W = W + 1 : End If
70
-        If CheckBox13.Checked = True Then : xlSheet.Cells(3, W) = "DIV" : Q = W : W = W + 1 : End If
71
-        If CheckBox14.Checked = True Then : xlSheet.Cells(3, W) = "GOODBOX" : Q = W : W = W + 1 : End If
72
-        If CheckBox15.Checked = True Then : xlSheet.Cells(3, W) = "LEATHER" : Q = W : W = W + 1 : End If
73
-        If CheckBox16.Checked = True Then : xlSheet.Cells(3, W) = "LEA_Note" : Q = W : W = W + 1 : End If
74
-        If CheckBox17.Checked = True Then : xlSheet.Cells(3, W) = "PO_S_Date" : Q = W : W = W + 1 : End If
75
-        If CheckBox18.Checked = True Then : xlSheet.Cells(3, W) = "Requested_XF" : Q = W : W = W + 1 : End If
76
-        If CheckBox19.Checked = True Then : xlSheet.Cells(3, W) = "Confirm_XF" : Q = W : W = W + 1 : End If
77
-        If CheckBox20.Checked = True Then : xlSheet.Cells(3, W) = "Revised_XF" : Q = W : W = W + 1 : End If
78
-        If CheckBox21.Checked = True Then : xlSheet.Cells(3, W) = "FTY X/F" : Q = W : W = W + 1 : End If
79
-        If CheckBox22.Checked = True Then : xlSheet.Cells(3, W) = "Special_Packaging" : Q = W : W = W + 1 : End If
80
-        If CheckBox23.Checked = True Then : xlSheet.Cells(3, W) = "Remarks" : Q = W : W = W + 1 : End If
81
-        If CheckBox24.Checked = True Then : xlSheet.Cells(3, W) = "TVW" : Q = W : W = W + 1 : End If
82
-        If CheckBox25.Checked = True Then : xlSheet.Cells(3, W) = "楦頭號" : Q = W : W = W + 1 : End If
83
-        If CheckBox26.Checked = True Then : xlSheet.Cells(3, W) = "材質" : Q = W : W = W + 1 : End If
84
-        If CheckBox27.Checked = True Then : xlSheet.Cells(3, W) = "七號模具" : Q = W : W = W + 1 : End If
85
-        If CheckBox28.Checked = True Then : xlSheet.Cells(3, W) = "T1" : Q = W : W = W + 1 : End If
86
-        If CheckBox29.Checked = True Then : xlSheet.Cells(3, W) = "T2" : Q = W : W = W + 1 : End If
87
-        If CheckBox30.Checked = True Then : xlSheet.Cells(3, W) = "WEAR_TEST" : Q = W : W = W + 1 : End If
88
-        If CheckBox31.Checked = True Then : xlSheet.Cells(3, W) = "CFM" : Q = W : W = W + 1 : End If
89
-        If CheckBox32.Checked = True Then : xlSheet.Cells(3, W) = "T3" : Q = W : W = W + 1 : End If
90
-        If CheckBox33.Checked = True Then : xlSheet.Cells(3, W) = "T4" : Q = W : W = W + 1 : End If
91
-        If CheckBox34.Checked = True Then : xlSheet.Cells(3, W) = "TEST" : Q = W : W = W + 1 : End If
92
-        If CheckBox35.Checked = True Then : xlSheet.Cells(3, W) = "面料" : Q = W : W = W + 1 : End If
93
-        If CheckBox36.Checked = True Then : xlSheet.Cells(3, W) = "副料" : Q = W : W = W + 1 : End If
94
-        If CheckBox37.Checked = True Then : xlSheet.Cells(3, W) = "中底" : Q = W : W = W + 1 : End If
95
-        If CheckBox38.Checked = True Then : xlSheet.Cells(3, W) = "鞋墊" : Q = W : W = W + 1 : End If
96
-        If CheckBox39.Checked = True Then : xlSheet.Cells(3, W) = "大底" : Q = W : W = W + 1 : End If
97
-        If CheckBox40.Checked = True Then : xlSheet.Cells(3, W) = "跟" : Q = W : W = W + 1 : End If
98
-        If CheckBox41.Checked = True Then : xlSheet.Cells(3, W) = "包裝" : Q = W : W = W + 1 : End If
99
-        If CheckBox42.Checked = True Then : xlSheet.Cells(3, W) = "裁斷" : Q = W : W = W + 1 : End If
100
-        If CheckBox43.Checked = True Then : xlSheet.Cells(3, W) = "針車" : Q = W : W = W + 1 : End If
101
-        If CheckBox44.Checked = True Then : xlSheet.Cells(3, W) = "成型" : Q = W : W = W + 1 : End If
102
-        If CheckBox45.Checked = True Then : xlSheet.Cells(3, W) = "驗貨" : Q = W : W = W + 1 : End If
103
-        If CheckBox46.Checked = True Then : xlSheet.Cells(3, W) = "工廠進度表備註1" : Q = W : W = W + 1 : End If
104
-        If CheckBox47.Checked = True Then : xlSheet.Cells(3, W) = "工廠進度表備註2" : Q = W : W = W + 1 : End If
105
-        If CheckBox48.Checked = True Then : xlSheet.Cells(3, W) = "客戶包裝確認" : Q = W : W = W + 1 : End If
106
-        If CheckBox50.Checked = True Then : xlSheet.Cells(3, W) = "工廠包裝確認" : Q = W : W = W + 1 : End If
107
-        If CheckBox51.Checked = True Then : xlSheet.Cells(3, W) = "利威驗貨確認" : Q = W : W = W + 1 : End If
108
-        If CheckBox52.Checked = True Then : xlSheet.Cells(3, W) = "結關日" : Q = W : W = W + 1 : End If
109
-        If CheckBox49.Checked = True Then : xlSheet.Cells(3, W) = "東莞業務備註" : Q = W : W = W + 1 : End If
60
+        If CheckBox1.Checked = True Then : xlSheet.Cells(3, W) = "TENDENZA PO#" : Q = W : W += 1 : End If
61
+        If CheckBox2.Checked = True Then : xlSheet.Cells(3, W) = "SEASON" : Q = W : W += 1 : End If
62
+        If CheckBox3.Checked = True Then : xlSheet.Cells(3, W) = "VIONIC PO#" : Q = W : W += 1 : End If
63
+        If CheckBox4.Checked = True Then : xlSheet.Cells(3, W) = "STYLE" : Q = W : W += 1 : End If
64
+        If CheckBox5.Checked = True Then : xlSheet.Cells(3, W) = "COLOR" : Q = W : W += 1 : End If
65
+        If CheckBox6.Checked = True Then : xlSheet.Cells(3, W) = "DM" : Q = W : W += 1 : End If
66
+        If CheckBox7.Checked = True Then : xlSheet.Cells(3, W) = "PRS" : Q = W : W += 1 : Index_PRS = Q : End If
67
+        If CheckBox8.Checked = True Then : xlSheet.Cells(3, W) = "CUST X/F" : Q = W : W += 1 : End If
68
+        If CheckBox9.Checked = True Then : xlSheet.Cells(3, W) = "PRICE" : Q = W : W += 1 : End If
69
+        If CheckBox10.Checked = True Then : xlSheet.Cells(3, W) = "AMOUNT" : Q = W : W += 1 : End If
70
+        If CheckBox11.Checked = True Then : xlSheet.Cells(3, W) = "REMARK" : Q = W : W += 1 : End If
71
+        If CheckBox12.Checked = True Then : xlSheet.Cells(3, W) = "FTY" : Q = W : W += 1 : End If
72
+        If CheckBox13.Checked = True Then : xlSheet.Cells(3, W) = "DIV" : Q = W : W += 1 : End If
73
+        If CheckBox14.Checked = True Then : xlSheet.Cells(3, W) = "GOODBOX" : Q = W : W += 1 : End If
74
+        If CheckBox15.Checked = True Then : xlSheet.Cells(3, W) = "LEATHER" : Q = W : W += 1 : End If
75
+        If CheckBox16.Checked = True Then : xlSheet.Cells(3, W) = "LEA_Note" : Q = W : W += 1 : End If
76
+        If CheckBox17.Checked = True Then : xlSheet.Cells(3, W) = "PO_S_Date" : Q = W : W += 1 : End If
77
+        If CheckBox18.Checked = True Then : xlSheet.Cells(3, W) = "Requested_XF" : Q = W : W += 1 : End If
78
+        If CheckBox19.Checked = True Then : xlSheet.Cells(3, W) = "Confirm_XF" : Q = W : W += 1 : End If
79
+        If CheckBox20.Checked = True Then : xlSheet.Cells(3, W) = "Revised_XF" : Q = W : W += 1 : End If
80
+        If CheckBox21.Checked = True Then : xlSheet.Cells(3, W) = "FTY X/F" : Q = W : W += 1 : Index_FTY_XF = Q : End If
81
+        If CheckBox22.Checked = True Then : xlSheet.Cells(3, W) = "Special_Packaging" : Q = W : W += 1 : End If
82
+        If CheckBox23.Checked = True Then : xlSheet.Cells(3, W) = "Remarks" : Q = W : W += 1 : End If
83
+        If CheckBox24.Checked = True Then : xlSheet.Cells(3, W) = "TVW" : Q = W : W += 1 : End If
84
+        If CheckBox25.Checked = True Then : xlSheet.Cells(3, W) = "楦頭號" : Q = W : W += 1 : End If
85
+        If CheckBox26.Checked = True Then : xlSheet.Cells(3, W) = "材質" : Q = W : W += 1 : End If
86
+        If CheckBox27.Checked = True Then : xlSheet.Cells(3, W) = "七號模具" : Q = W : W += 1 : End If
87
+        If CheckBox28.Checked = True Then : xlSheet.Cells(3, W) = "T1" : Q = W : W += 1 : End If
88
+        If CheckBox29.Checked = True Then : xlSheet.Cells(3, W) = "T2" : Q = W : W += 1 : End If
89
+        If CheckBox30.Checked = True Then : xlSheet.Cells(3, W) = "WEAR_TEST" : Q = W : W += 1 : End If
90
+        If CheckBox31.Checked = True Then : xlSheet.Cells(3, W) = "CFM" : Q = W : W += 1 : End If
91
+        If CheckBox32.Checked = True Then : xlSheet.Cells(3, W) = "T3" : Q = W : W += 1 : End If
92
+        If CheckBox33.Checked = True Then : xlSheet.Cells(3, W) = "T4" : Q = W : W += 1 : End If
93
+        If CheckBox34.Checked = True Then : xlSheet.Cells(3, W) = "TEST" : Q = W : W += 1 : End If
94
+        If CheckBox35.Checked = True Then : xlSheet.Cells(3, W) = "面料" : Q = W : W += 1 : End If
95
+        If CheckBox36.Checked = True Then : xlSheet.Cells(3, W) = "副料" : Q = W : W += 1 : End If
96
+        If CheckBox37.Checked = True Then : xlSheet.Cells(3, W) = "中底" : Q = W : W += 1 : End If
97
+        If CheckBox38.Checked = True Then : xlSheet.Cells(3, W) = "鞋墊" : Q = W : W += 1 : End If
98
+        If CheckBox39.Checked = True Then : xlSheet.Cells(3, W) = "大底" : Q = W : W += 1 : End If
99
+        If CheckBox40.Checked = True Then : xlSheet.Cells(3, W) = "跟" : Q = W : W += 1 : End If
100
+        If CheckBox41.Checked = True Then : xlSheet.Cells(3, W) = "包裝" : Q = W : W += 1 : End If
101
+        If CheckBox42.Checked = True Then : xlSheet.Cells(3, W) = "裁斷" : Q = W : W += 1 : End If
102
+        If CheckBox43.Checked = True Then : xlSheet.Cells(3, W) = "針車" : Q = W : W += 1 : End If
103
+        If CheckBox44.Checked = True Then : xlSheet.Cells(3, W) = "成型" : Q = W : W += 1 : End If
104
+        If CheckBox45.Checked = True Then : xlSheet.Cells(3, W) = "驗貨" : Q = W : W += 1 : End If
105
+        If CheckBox46.Checked = True Then : xlSheet.Cells(3, W) = "工廠進度表備註1" : Q = W : W += 1 : End If
106
+        If CheckBox47.Checked = True Then : xlSheet.Cells(3, W) = "工廠進度表備註2" : Q = W : W += 1 : End If
107
+        If CheckBox48.Checked = True Then : xlSheet.Cells(3, W) = "客戶包裝確認" : Q = W : W += 1 : End If
108
+        If CheckBox50.Checked = True Then : xlSheet.Cells(3, W) = "工廠包裝確認" : Q = W : W += 1 : End If
109
+        If CheckBox51.Checked = True Then : xlSheet.Cells(3, W) = "利威驗貨確認" : Q = W : W += 1 : End If
110
+        If CheckBox52.Checked = True Then : xlSheet.Cells(3, W) = "結關日" : Q = W : W += 1 : End If
111
+        If CheckBox49.Checked = True Then : xlSheet.Cells(3, W) = "東莞業務備註" : Q = W : W += 1 : End If
110
         Set_訂單清單()
112
         Set_訂單清單()
111
         For i As Integer = 0 To DataGridView1.Rows.Count - 1
113
         For i As Integer = 0 To DataGridView1.Rows.Count - 1
112
             W = 2
114
             W = 2
113
-            If CheckBox1.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單流水號").Value : W = W + 1 : End If
114
-            If CheckBox2.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("年份季度").Value : W = W + 1 : End If
115
-            If CheckBox3.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶訂單號").Value : W = W + 1 : End If
116
-            If CheckBox4.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("形體號").Value : W = W + 1 : End If
117
-            If CheckBox5.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("顏色").Value : W = W + 1 : End If
118
-            If CheckBox6.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("楦型").Value : W = W + 1 : End If
119
-            If CheckBox7.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單數量").Value : P = W : W = W + 1 : End If
120
-            If CheckBox8.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶交期").Value : W = W + 1 : End If
121
-            If CheckBox9.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("單價").Value : R = W : W = W + 1 : End If
122
-            If CheckBox10.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("總金額").Value : A = W : W = W + 1 : End If
123
-            If CheckBox11.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("備註").Value : W = W + 1 : End If
124
-            If CheckBox12.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("生產工廠").Value : W = W + 1 : End If
125
-            If CheckBox13.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單種類").Value : W = W + 1 : End If
126
-            If CheckBox14.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("GOODBOX").Value : W = W + 1 : End If
127
-            If CheckBox15.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("LEATHER").Value : W = W + 1 : End If
128
-            If CheckBox16.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("LEA_Note").Value : W = W + 1 : End If
129
-            If CheckBox17.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("接單日").Value : W = W + 1 : End If
130
-            If CheckBox18.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("需求日期").Value : W = W + 1 : End If
131
-            If CheckBox19.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("確認日期").Value : W = W + 1 : End If
132
-            If CheckBox20.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("修訂日期").Value : W = W + 1 : End If
133
-            If CheckBox21.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠交期").Value : W = W + 1 : End If
134
-            If CheckBox22.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("Special_Packaging").Value : W = W + 1 : End If
135
-            If CheckBox23.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("Remarks").Value : W = W + 1 : End If
136
-            If CheckBox24.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("TVW").Value : W = W + 1 : End If
137
-            If CheckBox25.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("楦頭號").Value : W = W + 1 : End If
138
-            If CheckBox26.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("材質").Value : W = W + 1 : End If
139
-            If CheckBox27.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("七號模具").Value : W = W + 1 : End If
140
-            If CheckBox28.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T1").Value : W = W + 1 : End If
141
-            If CheckBox29.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T2").Value : W = W + 1 : End If
142
-            If CheckBox30.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("WEAR_TEST").Value : W = W + 1 : End If
143
-            If CheckBox31.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("CFM").Value : W = W + 1 : End If
144
-            If CheckBox32.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T3").Value : W = W + 1 : End If
145
-            If CheckBox33.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T4").Value : W = W + 1 : End If
146
-            If CheckBox34.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("TEST").Value : W = W + 1 : End If
147
-            If CheckBox35.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("面料").Value : W = W + 1 : End If
148
-            If CheckBox36.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("副料").Value : W = W + 1 : End If
149
-            If CheckBox37.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("中底").Value : W = W + 1 : End If
150
-            If CheckBox38.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("鞋墊").Value : W = W + 1 : End If
151
-            If CheckBox39.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("大底").Value : W = W + 1 : End If
152
-            If CheckBox40.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("跟").Value : W = W + 1 : End If
153
-            If CheckBox41.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("包裝").Value : W = W + 1 : End If
154
-            If CheckBox42.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("裁斷").Value : W = W + 1 : End If
155
-            If CheckBox43.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("針車").Value : W = W + 1 : End If
156
-            If CheckBox44.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("成型").Value : W = W + 1 : End If
157
-            If CheckBox45.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("驗貨").Value : W = W + 1 : End If
158
-            If CheckBox46.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠進度表備註1").Value : W = W + 1 : End If
159
-            If CheckBox47.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠進度表備註2").Value : W = W + 1 : End If
160
-            If CheckBox48.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶包裝確認").Value : W = W + 1 : End If
161
-            If CheckBox50.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠確認").Value : W = W + 1 : End If
162
-            If CheckBox51.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("利威確認").Value : W = W + 1 : End If
163
-            If CheckBox52.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("結關日").Value : W = W + 1 : End If
164
-            If CheckBox49.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("東莞業務備註").Value : W = W + 1 : End If
115
+            If CheckBox1.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單流水號").Value : W += 1 : End If
116
+            If CheckBox2.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("年份季度").Value : W += 1 : End If
117
+            If CheckBox3.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶訂單號").Value : W += 1 : End If
118
+            If CheckBox4.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("形體號").Value : W += 1 : End If
119
+            If CheckBox5.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("顏色").Value : W += 1 : End If
120
+            If CheckBox6.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("楦型").Value : W += 1 : End If
121
+            If CheckBox7.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單數量").Value : P = W : W += 1 : End If
122
+            If CheckBox8.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶交期").Value : W += 1 : End If
123
+            If CheckBox9.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("單價").Value : R = W : W += 1 : End If
124
+            If CheckBox10.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("總金額").Value : A = W : W += 1 : End If
125
+            If CheckBox11.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("備註").Value : W += 1 : End If
126
+            If CheckBox12.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("生產工廠").Value : W += 1 : End If
127
+            If CheckBox13.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("訂單種類").Value : W += 1 : End If
128
+            If CheckBox14.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("GOODBOX").Value : W += 1 : End If
129
+            If CheckBox15.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("LEATHER").Value : W += 1 : End If
130
+            If CheckBox16.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("LEA_Note").Value : W += 1 : End If
131
+            If CheckBox17.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("接單日").Value : W += 1 : End If
132
+            If CheckBox18.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("需求日期").Value : W += 1 : End If
133
+            If CheckBox19.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("確認日期").Value : W += 1 : End If
134
+            If CheckBox20.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("修訂日期").Value : W += 1 : End If
135
+            If CheckBox21.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠交期").Value : W += 1 : End If
136
+            If CheckBox22.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("Special_Packaging").Value : W += 1 : End If
137
+            If CheckBox23.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("Remarks").Value : W += 1 : End If
138
+            If CheckBox24.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("TVW").Value : W += 1 : End If
139
+            If CheckBox25.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("楦頭號").Value : W += 1 : End If
140
+            If CheckBox26.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("材質").Value : W += 1 : End If
141
+            If CheckBox27.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("七號模具").Value : W += 1 : End If
142
+            If CheckBox28.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T1").Value : W += 1 : End If
143
+            If CheckBox29.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T2").Value : W += 1 : End If
144
+            If CheckBox30.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("WEAR_TEST").Value : W += 1 : End If
145
+            If CheckBox31.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("CFM").Value : W += 1 : End If
146
+            If CheckBox32.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T3").Value : W += 1 : End If
147
+            If CheckBox33.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("T4").Value : W += 1 : End If
148
+            If CheckBox34.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("TEST").Value : W += 1 : End If
149
+            If CheckBox35.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("面料").Value : W += 1 : End If
150
+            If CheckBox36.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("副料").Value : W += 1 : End If
151
+            If CheckBox37.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("中底").Value : W += 1 : End If
152
+            If CheckBox38.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("鞋墊").Value : W += 1 : End If
153
+            If CheckBox39.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("大底").Value : W += 1 : End If
154
+            If CheckBox40.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("跟").Value : W += 1 : End If
155
+            If CheckBox41.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("包裝").Value : W += 1 : End If
156
+            If CheckBox42.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("裁斷").Value : W += 1 : End If
157
+            If CheckBox43.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("針車").Value : W += 1 : End If
158
+            If CheckBox44.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("成型").Value : W += 1 : End If
159
+            If CheckBox45.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("驗貨").Value : W += 1 : End If
160
+            If CheckBox46.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠進度表備註1").Value : W += 1 : End If
161
+            If CheckBox47.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠進度表備註2").Value : W += 1 : End If
162
+            If CheckBox48.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("客戶包裝確認").Value : W += 1 : End If
163
+            If CheckBox50.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("工廠確認").Value : W += 1 : End If
164
+            If CheckBox51.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("利威確認").Value : W += 1 : End If
165
+            If CheckBox52.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("結關日").Value : W += 1 : End If
166
+            If CheckBox49.Checked = True Then : xlSheet.Cells(i + 4, W) = DataGridView1.Rows(i).Cells("東莞業務備註").Value : W += 1 : End If
165
             With xlApp.Selection
167
             With xlApp.Selection
166
                 .Font.Bold = True
168
                 .Font.Bold = True
167
             End With
169
             End With
168
         Next i
170
         Next i
169
         BB(xlApp, xlSheet)
171
         BB(xlApp, xlSheet)
170
     End Sub
172
     End Sub
171
-    Private  Sub 列印選擇_Load(sender As Object, e As EventArgs) Handles MyBase.Load
173
+    Private Sub 列印選擇_Load(sender As Object, e As EventArgs) Handles MyBase.Load
172
         FormBorderStyle = FormBorderStyle.SizableToolWindow
174
         FormBorderStyle = FormBorderStyle.SizableToolWindow
175
+        月選_起始_dtp.Value = Today() : 月選_結束_dtp.Value = Today()
176
+        週選_日期_CB.Text = DateAndTime.Day(Today)
177
+        週選_月份_CB.Text = DateAndTime.Month(Today)
178
+        週選_年份_CB.Text = DateAndTime.Year(Today)
179
+        週選_週數_cb.Text = "7"
180
+        月選_起始月_cb.Text = DateAndTime.Month(Today)
181
+        月選_結束月_cb.Text = DateAndTime.Month(Today)
182
+        月選_年_cb.Text = DateAndTime.Year(Today)
183
+        月選_結束年_cb.Text = DateAndTime.Year(Today)
173
         Set_格式設定()
184
         Set_格式設定()
174
     End Sub
185
     End Sub
175
-    Private  Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
186
+    Private Sub 週選_年份_CB_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 週選_年份_CB.SelectedIndexChanged
187
+        selectdate = CDate((週選_月份_CB.Text) & "/" & (週選_日期_CB.Text) & "/" & (週選_年份_CB.Text))
188
+        週選_DTP.Value = selectdate
189
+        週選_起日_tb.Text = Strings.Left(Strings.Format(週選_DTP.Value, "yyyy/MM/dd"), 10)
190
+    End Sub
191
+    Private Sub 週選_月份_CB_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 週選_月份_CB.SelectedIndexChanged
192
+        If 週選_年份_CB.Text = "" Then
193
+            Exit Sub
194
+        Else
195
+            selectdate = CDate((週選_月份_CB.Text) & "/" & (週選_日期_CB.Text) & "/" & (週選_年份_CB.Text))
196
+            週選_DTP.Value = selectdate
197
+            週選_起日_tb.Text = Strings.Left(Strings.Format(週選_DTP.Value, "yyyy/MM/dd"), 10)
198
+        End If
199
+    End Sub
200
+    Private Sub 週選_日期_CB_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 週選_日期_CB.SelectedIndexChanged
201
+        If 週選_年份_CB.Text = "" Then
202
+            Exit Sub
203
+        ElseIf 週選_月份_CB.Text = "" Then
204
+            Exit Sub
205
+        Else
206
+            selectdate = CDate((週選_月份_CB.Text) & "/" & (週選_日期_CB.Text) & "/" & (週選_年份_CB.Text))
207
+            週選_DTP.Value = selectdate
208
+            週選_起日_tb.Text = Strings.Left(Strings.Format(週選_DTP.Value, "yyyy/MM/dd"), 10)
209
+        End If
210
+    End Sub
211
+    Private Sub 月選_年_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月選_年_cb.SelectedIndexChanged
212
+        DTP = (月選_年_cb.Text) & "/" & (月選_起始月_cb.Text) & "/01"
213
+        月選_起始_dtp.Value = DTP
214
+        月選_起始_tb.Text = Strings.Left(Strings.Format(月選_起始_dtp.Value, "yyyy/MM/dd"), 10)
215
+        判斷月差()
216
+    End Sub
217
+    Private Sub 月選_起始月_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月選_起始月_cb.SelectedIndexChanged
218
+        If 月選_年_cb.Text = "" Then
219
+            Exit Sub
220
+        Else
221
+            DTP = (月選_年_cb.Text) & "/" & (月選_起始月_cb.Text) & "/01"
222
+            月選_起始_dtp.Value = DTP
223
+            月選_起始_tb.Text = Strings.Left(Strings.Format(月選_起始_dtp.Value, "yyyy/MM/dd"), 10)
224
+        End If
225
+        判斷月差()
226
+    End Sub
227
+    Private Sub 月選_結束年_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月選_結束年_cb.SelectedIndexChanged
228
+        DTP = (月選_結束年_cb.Text) & "/" & (月選_結束月_cb.Text) & "/01"
229
+        月選_結束_dtp.Value = DTP
230
+        月選_結束_dtp.Value = 月選_結束_dtp.Value.AddMonths(1)
231
+        月選_結束_dtp.Value = 月選_結束_dtp.Value.AddDays(-1)
232
+        月選_結束_tb.Text = Strings.Left(Strings.Format(月選_結束_dtp.Value, "yyyy/MM/dd"), 10)
233
+    End Sub
234
+    Private Sub 月選_結束月_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月選_結束月_cb.SelectedIndexChanged
235
+        If 月選_年_cb.Text = "" Then
236
+            Exit Sub
237
+        Else
238
+            DTP = (月選_結束年_cb.Text) & "/" & (月選_結束月_cb.Text) & "/01"
239
+            月選_結束_dtp.Value = DTP
240
+            月選_結束_dtp.Value = 月選_結束_dtp.Value.AddMonths(1)
241
+            月選_結束_dtp.Value = 月選_結束_dtp.Value.AddDays(-1)
242
+            月選_結束_tb.Text = Strings.Left(Strings.Format(月選_結束_dtp.Value, "yyyy/MM/dd"), 10)
243
+        End If
244
+    End Sub
245
+    Private Sub 減一個月_bt_Click(sender As Object, e As EventArgs) Handles 減一個月_bt.Click
246
+        If 月選_結束月_cb.Text <> "1" Then
247
+            月選_結束月_cb.Text = Val(月選_結束月_cb.Text) - 1
248
+        ElseIf 月選_結束月_cb.Text = "1" Then
249
+            月選_結束月_cb.Text = 12
250
+            月選_結束年_cb.Text = Val(月選_結束年_cb.Text) - 1
251
+        End If
252
+        判斷月差()
253
+    End Sub
254
+    Private Sub 加一個月_bt_Click(sender As Object, e As EventArgs) Handles 加一個月_bt.Click
255
+        If 月選_結束月_cb.Text <> "12" Then
256
+            月選_結束月_cb.Text = Val(月選_結束月_cb.Text) + 1
257
+        ElseIf 月選_結束月_cb.Text = "12" Then
258
+            月選_結束月_cb.Text = 1
259
+            月選_結束年_cb.Text = Val(月選_結束年_cb.Text) + 1
260
+        End If
261
+        判斷月差()
262
+    End Sub
263
+    Private Sub 判斷月差()
264
+        If DateDiff(DateInterval.Month, 月選_起始_dtp.Value, 月選_結束_dtp.Value) > 11 Then
265
+            月選_起始月_cb.Text = DateAndTime.Month(Today)
266
+            月選_結束月_cb.Text = DateAndTime.Month(Today)
267
+            月選_年_cb.Text = DateAndTime.Year(Today)
268
+            月選_結束年_cb.Text = DateAndTime.Year(Today)
269
+            MsgBox("選擇範圍超過1年", MsgBoxStyle.Information, "提示")
270
+        ElseIf DateDiff(DateInterval.Month, 月選_起始_dtp.Value, 月選_結束_dtp.Value) < 0 Then
271
+            月選_起始月_cb.Text = DateAndTime.Month(Today)
272
+            月選_結束月_cb.Text = DateAndTime.Month(Today)
273
+            月選_年_cb.Text = DateAndTime.Year(Today)
274
+            月選_結束年_cb.Text = DateAndTime.Year(Today)
275
+            MsgBox("選擇範圍年分順序顛倒", MsgBoxStyle.Information, "提示")
276
+        End If
277
+    End Sub
278
+    Private Sub 彙總表_cb_CheckedChanged(sender As Object, e As EventArgs) Handles 彙總表_cb.CheckedChanged
279
+        If 彙總表_cb.Checked = True Then
280
+            If CheckBox21.Checked = False Then
281
+                MsgBox("列印彙總表需要工廠交期,請勾選 FTY X/F", MsgBoxStyle.Information, "提示")
282
+                彙總表_cb.Checked = False
283
+            ElseIf CheckBox7.Checked = False Then
284
+                MsgBox("列印彙總表需要PRS,請勾選 PRS", MsgBoxStyle.Information, "提示")
285
+                彙總表_cb.Checked = False
286
+            Else
287
+                彙總表_cb.Checked = True : 月份選擇_gb.Enabled = True : 週數選擇_gb.Enabled = True
288
+            End If
289
+        Else
290
+            月份選擇_gb.Enabled = False : 週數選擇_gb.Enabled = False
291
+            Exit Sub
292
+        End If
293
+    End Sub
294
+    Private Function 行指標轉換(ByVal index01 As Integer) As String
295
+        Dim index_return As String = ""
296
+        Select Case index01
297
+            Case 1 : index_return = "A" : Case 2 : index_return = "B" : Case 3 : index_return = "C" : Case 4 : index_return = "D"
298
+            Case 5 : index_return = "E" : Case 6 : index_return = "F" : Case 7 : index_return = "G" : Case 8 : index_return = "H"
299
+            Case 9 : index_return = "I" : Case 10 : index_return = "J" : Case 11 : index_return = "K" : Case 12 : index_return = "L"
300
+            Case 13 : index_return = "M" : Case 14 : index_return = "N" : Case 15 : index_return = "O" : Case 16 : index_return = "P"
301
+            Case 17 : index_return = "Q" : Case 18 : index_return = "R" : Case 19 : index_return = "S" : Case 20 : index_return = "T"
302
+            Case 21 : index_return = "U" : Case 22 : index_return = "V" : Case 23 : index_return = "W" : Case 24 : index_return = "X"
303
+            Case 25 : index_return = "Y" : Case 26 : index_return = "Z" : Case 27 : index_return = "AA" : Case 28 : index_return = "AB"
304
+            Case 29 : index_return = "AC" : Case 30 : index_return = "AD" : Case 31 : index_return = "AE" : Case 32 : index_return = "AF"
305
+            Case 33 : index_return = "AG" : Case 34 : index_return = "AH" : Case 35 : index_return = "AI" : Case 36 : index_return = "AJ"
306
+            Case 37 : index_return = "AK" : Case 38 : index_return = "AL" : Case 39 : index_return = "AM" : Case 40 : index_return = "AN"
307
+        End Select
308
+        Return index_return
309
+    End Function
310
+    Private Sub 週選_週數_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 週選_週數_cb.SelectedIndexChanged
311
+        週選_週數_tb.Text = 週選_週數_cb.Text
312
+    End Sub
313
+    Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
314
+        Dim j As Integer = 1 ' j 用來計算有幾個 EXCEL 工作表
315
+        'SaveFileDialog1.Filter = "All Files (*.*)|*.*|Excel files (*.xlsx)|*.xlsx|CSV Files (*.csv)|*.csv|XLS Files (*.xls)|*xls"
316
+        'SaveFileDialog1.FilterIndex = 2
317
+        'If SaveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
176
         xlApp = CType(CreateObject("Excel.Application"), Microsoft.Office.Interop.Excel.Application)
318
         xlApp = CType(CreateObject("Excel.Application"), Microsoft.Office.Interop.Excel.Application)
177
         xlApp.Visible = True
319
         xlApp.Visible = True
178
         xlApp.DisplayAlerts = True
320
         xlApp.DisplayAlerts = True
180
         xlBook = xlApp.Workbooks.Add
322
         xlBook = xlApp.Workbooks.Add
181
         '----------------------------------------------------------------------------------------------------------------------
323
         '----------------------------------------------------------------------------------------------------------------------
182
         xlSheet = NewMethod(xlBook)
324
         xlSheet = NewMethod(xlBook)
183
-        If xlApp.Sheets(1).Name = "工作表2" Then
184
-            xlApp.Sheets("工作表2").Select
185
-            xlApp.Sheets("工作表2").Name = "JH"
186
-        Else
187
-            xlApp.Sheets("sheet2").Select
188
-            xlApp.Sheets("sheet2").Name = "JH"
189
-        End If
325
+        xlApp.Sheets(1).Name = "JH"
326
+        xlApp.Sheets("JH").Select
190
         xlBook.Activate()
327
         xlBook.Activate()
191
         xlSheet.Activate()
328
         xlSheet.Activate()
192
         OPEXC(0) = True : OPEXC(1) = False : OPEXC(2) = False
329
         OPEXC(0) = True : OPEXC(1) = False : OPEXC(2) = False
193
         xlSheet.Range("A1").Select()
330
         xlSheet.Range("A1").Select()
194
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(玖宏)"
331
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(玖宏)"
195
         Set_循環列印()
332
         Set_循環列印()
196
-        '----------------------------------------------------------------------------------------------------------------------
333
+        j += 1
334
+        '----------------------------------------------------------------------------------------------------------------------           
197
         xlSheet = NewMethod(xlBook)
335
         xlSheet = NewMethod(xlBook)
198
-        If xlApp.Sheets(1).Name = "工作表3" Then
199
-            xlApp.Sheets("工作表3").Select
200
-            xlApp.Sheets("工作表3").Name = "SK"
201
-        Else
202
-            xlApp.Sheets("sheet3").Select
203
-            xlApp.Sheets("sheet3").Name = "SK"
204
-        End If
336
+        xlApp.Sheets(1).Name = "SK"
337
+        xlApp.Sheets("SK").Select
205
         xlBook.Activate()
338
         xlBook.Activate()
206
         xlSheet.Activate()
339
         xlSheet.Activate()
207
         OPEXC(0) = False : OPEXC(1) = True : OPEXC(2) = False
340
         OPEXC(0) = False : OPEXC(1) = True : OPEXC(2) = False
208
         xlSheet.Range("A1").Select()
341
         xlSheet.Range("A1").Select()
209
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(森康)"
342
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(森康)"
210
         Set_循環列印()
343
         Set_循環列印()
344
+        j += 1
211
         '----------------------------------------------------------------------------------------------------------------------
345
         '----------------------------------------------------------------------------------------------------------------------
212
         xlSheet = NewMethod(xlBook)
346
         xlSheet = NewMethod(xlBook)
213
-        If xlApp.Sheets(1).Name = "工作表4" Then
214
-            xlApp.Sheets("工作表4").Select
215
-            xlApp.Sheets("工作表4").Name = "NJ"
216
-        Else
217
-            xlApp.Sheets("sheet4").Select
218
-            xlApp.Sheets("sheet4").Name = "NJ"
219
-        End If
347
+        xlApp.Sheets(1).Name = "NJ"
348
+        xlApp.Sheets("NJ").Select
220
         xlBook.Activate()
349
         xlBook.Activate()
221
         xlSheet.Activate()
350
         xlSheet.Activate()
222
         OPEXC(0) = False : OPEXC(1) = False : OPEXC(2) = True
351
         OPEXC(0) = False : OPEXC(1) = False : OPEXC(2) = True
223
         xlSheet.Range("A1").Select()
352
         xlSheet.Range("A1").Select()
224
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(楠晉)"
353
         xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單控制表(楠晉)"
225
         Set_循環列印()
354
         Set_循環列印()
226
-        '----------------------------------------------------------------------------------------------------------------------
227
-        If xlApp.Sheets(4).Name = "工作表1" Then
228
-            xlApp.Sheets("工作表1").Delete
229
-        Else
230
-            xlApp.Sheets("sheet1").Delete
355
+        j += 1
356
+        '---------------------------------------------------cover--------------------------------------------------------------
357
+        If 彙總表_cb.Checked = True Then
358
+            xlSheet = NewMethod(xlBook)
359
+            xlApp.Sheets(1).Name = "cover"
360
+            xlApp.Sheets("cover").Select
361
+            xlBook.Activate()
362
+            xlSheet.Activate()
363
+            xlSheet.Range("A1").Select()
364
+            Dim Str_FTY_XF As String = 行指標轉換(Index_FTY_XF)
365
+            Dim Str_PRS As String = 行指標轉換(Index_PRS)
366
+            'xlSheet.Cells(2, 2) = "天盾國際有限公司-訂單彙總表"
367
+            xlSheet.Cells(3, 2) = "Year " & 月選_年_cb.Text : xlSheet.Cells(3, 9) = "Year " & 週選_年份_CB.Text
368
+            xlSheet.Cells(3, 4) = "NJ" : xlSheet.Cells(3, 5) = "SK" : xlSheet.Cells(3, 6) = "JH" : xlSheet.Cells(3, 7) = "total"
369
+            xlSheet.Cells(3, 11) = "NJ" : xlSheet.Cells(3, 12) = "SK" : xlSheet.Cells(3, 13) = "JH" : xlSheet.Cells(3, 14) = "total"
370
+            xlSheet.Cells(4, 2) = 月選_起始_tb.Text
371
+            xlSheet.Cells(4, 3) = "unship" : xlSheet.Cells(4, 9) = "unship"
372
+            ' --------- 月次選表 ---------
373
+            xlSheet.Cells(4, 4) = "=SUMIF(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$B$4,NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
374
+            xlSheet.Cells(4, 5) = "=SUMIF(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$B$4,SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
375
+            xlSheet.Cells(4, 6) = "=SUMIF(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$B$4,JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
376
+            xlSheet.Cells(4, 7) = "=SUM(D4:F4)"
377
+            Dim count_month, count_year, Br As Integer
378
+            Dim DTP2, DTP3 As Date
379
+            DTP2 = 月選_起始_dtp.Value
380
+            DTP3 = 月選_結束_dtp.Value
381
+            Br = DateDiff(DateInterval.Month, DTP2, DTP3)
382
+            count_month = 月選_起始_dtp.Value.Month
383
+            count_year = 月選_起始_dtp.Value.Year
384
+            For k = 1 To (Br + 1)
385
+                xlSheet.Cells(k + 4, 3) = count_month
386
+                xlSheet.Cells(k + 4, 2) = count_year
387
+                xlSheet.Cells(k + 4, 4) = "=SUMPRODUCT((YEAR(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$B" & k + 4 & ")*(MONTH(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$C" & k + 4 & ")*NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
388
+                xlSheet.Cells(k + 4, 5) = "=SUMPRODUCT((YEAR(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$B" & k + 4 & ")*(MONTH(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$C" & k + 4 & ")*SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
389
+                xlSheet.Cells(k + 4, 6) = "=SUMPRODUCT((YEAR(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$B" & k + 4 & ")*(MONTH(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)=$C" & k + 4 & ")*JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
390
+                xlSheet.Cells(k + 4, 7) = "=SUM(D" & k + 4 & ":F" & k + 4 & ")"
391
+                DTP2 = DTP2.AddMonths(1)
392
+                count_month = DTP2.Month
393
+                count_year = DTP2.Year
394
+                If k = (Br + 1) Then
395
+                    xlSheet.Cells(k + 5, 2) = Strings.Left(Strings.Format(DTP3, "yyyy/MM/dd"), 10)
396
+                    xlSheet.Cells(k + 5, 3) = "later"
397
+                    xlSheet.Cells(k + 5, 4) = "=SUMIF(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$B$" & k + 5 & ",NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
398
+                    xlSheet.Cells(k + 5, 5) = "=SUMIF(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$B$" & k + 5 & ",SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
399
+                    xlSheet.Cells(k + 5, 6) = "=SUMIF(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$B$" & k + 5 & ",JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
400
+                    xlSheet.Cells(k + 5, 7) = "=SUM(D" & k + 5 & ":F" & k + 5 & ")"
401
+                    xlSheet.Cells(k + 6, 2) = "total"
402
+                    xlSheet.Cells(k + 6, 4) = "=SUM(D4:D" & k + 5 & ")"
403
+                    xlSheet.Cells(k + 6, 5) = "=SUM(E4:E" & k + 5 & ")"
404
+                    xlSheet.Cells(k + 6, 6) = "=SUM(F4:F" & k + 5 & ")"
405
+                    xlSheet.Cells(k + 6, 7) = "=SUM(D" & k + 6 & ":F" & k + 6 & ")"
406
+                End If
407
+                Index_月_total = k + 6
408
+            Next
409
+
410
+            ' --------- 週次選表 ---------
411
+            xlSheet.Cells(4, 11) = "=SUMIF(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$I$5,NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
412
+            xlSheet.Cells(4, 12) = "=SUMIF(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$I$5,SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
413
+            xlSheet.Cells(4, 13) = "=SUMIF(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & "<" & """" & "&$I$5,JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
414
+            xlSheet.Cells(4, 14) = "=SUM(K4:M4)"
415
+            xlSheet.Cells(5, 9) = 週選_起日_tb.Text
416
+            For kk = 1 To CInt(週選_週數_tb.Text)
417
+                xlSheet.Cells(kk + 4, 10) = "=I" & (kk + 4) & "+6"
418
+                xlSheet.Cells(kk + 4, 11) = "=SUMPRODUCT(((NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)>=$I" & kk + 4 & ")*((NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)<=$J" & kk + 4 & ")*NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
419
+                xlSheet.Cells(kk + 4, 12) = "=SUMPRODUCT(((SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)>=$I" & kk + 4 & ")*((SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)<=$J" & kk + 4 & ")*SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
420
+                xlSheet.Cells(kk + 4, 13) = "=SUMPRODUCT(((JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)>=$I" & kk + 4 & ")*((JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999)<=$J" & kk + 4 & ")*JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
421
+                xlSheet.Cells(kk + 4, 14) = "=SUM(K" & kk + 4 & ":M" & kk + 4 & ")"
422
+                If kk > 1 Then
423
+                    xlSheet.Cells(kk + 4, 9) = "=J" & (kk + 3) & "+1"
424
+                End If
425
+                If kk = CInt(週選_週數_tb.Text) Then
426
+                    xlSheet.Cells(kk + 5, 9) = "later"
427
+                    xlSheet.Cells(kk + 5, 11) = "=SUMIF(NJ!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$J$" & kk + 4 & ",NJ!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
428
+                    xlSheet.Cells(kk + 5, 12) = "=SUMIF(SK!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$J$" & kk + 4 & ",SK!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
429
+                    xlSheet.Cells(kk + 5, 13) = "=SUMIF(JH!$" & Str_FTY_XF & "$4:$" & Str_FTY_XF & "$9999," & """" & ">" & """" & "&$J$" & kk + 4 & ",JH!$" & Str_PRS & "$4:$" & Str_PRS & "$9999)"
430
+                    xlSheet.Cells(kk + 5, 14) = "=SUM(K" & kk + 5 & ":M" & kk + 5 & ")"
431
+                    xlSheet.Cells(kk + 6, 9) = "total"
432
+                    xlSheet.Cells(kk + 6, 11) = "=SUM(K4:K" & kk + 5 & ")"
433
+                    xlSheet.Cells(kk + 6, 12) = "=SUM(L4:L" & kk + 5 & ")"
434
+                    xlSheet.Cells(kk + 6, 13) = "=SUM(M4:M" & kk + 5 & ")"
435
+                    xlSheet.Cells(kk + 6, 14) = "=SUM(K" & kk + 6 & ":M" & kk + 6 & ")"
436
+                End If
437
+            Next
438
+            Excel巨集_C(xlApp, xlSheet)
439
+            j += 1
231
         End If
440
         End If
441
+        '----------------------------------------------------------------------------------------------------------------------
442
+        xlApp.Sheets(j).Delete
232
         xlSheet.PageSetup.PrintArea = ""
443
         xlSheet.PageSetup.PrintArea = ""
233
         xlApp.Cells.Select()
444
         xlApp.Cells.Select()
234
         xlApp.Application.WindowState = xlMinimized
445
         xlApp.Application.WindowState = xlMinimized
235
         MsgBox("列印完成")
446
         MsgBox("列印完成")
236
         Me.Close()
447
         Me.Close()
448
+
449
+        'xlSheet.PageSetup.PrintArea = ""
450
+        'xlApp.Cells.Select()
451
+        'xlApp.Application.WindowState = xlMinimized
452
+        'xlSheet.SaveAs(SaveFileDialog1.FileName)
453
+        'xlBook.Close()
454
+        'xlApp.Quit()
455
+        'MsgBox("列印完成")
456
+        'End If
457
+        'Me.Close()
237
     End Sub
458
     End Sub
238
-    Private  Shared Function NewMethod(xlBook As Microsoft.Office.Interop.Excel.Workbook) As Microsoft.Office.Interop.Excel.Worksheet
459
+    Private Shared Function NewMethod(xlBook As Microsoft.Office.Interop.Excel.Workbook) As Microsoft.Office.Interop.Excel.Worksheet
239
         Return CType(xlBook.Worksheets.Add, Microsoft.Office.Interop.Excel.Worksheet)
460
         Return CType(xlBook.Worksheets.Add, Microsoft.Office.Interop.Excel.Worksheet)
240
     End Function
461
     End Function
241
-    Private  Sub BB(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
462
+    Private Sub BB(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
242
         Dim 位置41 As String
463
         Dim 位置41 As String
243
         If CheckBox7.Checked = True Then
464
         If CheckBox7.Checked = True Then
244
             If P = 0 Then
465
             If P = 0 Then
377
         End If
598
         End If
378
         Dim M As Integer = 4
599
         Dim M As Integer = 4
379
         For M = 4 To DataGridView1.Rows.Count + 2
600
         For M = 4 To DataGridView1.Rows.Count + 2
380
-            M = M + 1
601
+            M += 1
381
         Next M
602
         Next M
382
         If 位置4 = "A" Or 位置4 = "B" Or 位置4 = "C" Or 位置4 = "D" Or 位置4 = "E" Or 位置4 = "F" Or 位置4 = "G" Or 位置4 = "H" Or 位置4 = "I" Or 位置4 = "J" Then
603
         If 位置4 = "A" Or 位置4 = "B" Or 位置4 = "C" Or 位置4 = "D" Or 位置4 = "E" Or 位置4 = "F" Or 位置4 = "G" Or 位置4 = "H" Or 位置4 = "I" Or 位置4 = "J" Then
383
             位置4 = "J"
604
             位置4 = "J"
412
         myExcel.ActiveWindow.ScrollColumn = 4 : myExcel.ActiveWindow.ScrollColumn = 3 : myExcel.ActiveWindow.ScrollColumn = 2 : myExcel.ActiveWindow.ScrollColumn = 1
633
         myExcel.ActiveWindow.ScrollColumn = 4 : myExcel.ActiveWindow.ScrollColumn = 3 : myExcel.ActiveWindow.ScrollColumn = 2 : myExcel.ActiveWindow.ScrollColumn = 1
413
         myExcel.ActiveWindow.DisplayGridlines = False
634
         myExcel.ActiveWindow.DisplayGridlines = False
414
     End Sub
635
     End Sub
636
+    Private Sub Excel巨集_C(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
637
+        '全選改變字體
638
+        xlSheet.Cells.Select()
639
+        With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
640
+            .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone
641
+        End With
642
+
643
+        ' 改變行寬 Columns("A") & Columns("H")
644
+        xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 1
645
+        xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 1
646
+
647
+        ' 改變行寬
648
+        xlSheet.Columns("B:C").Select : myExcel.Selection.ColumnWidth = 10
649
+        xlSheet.Columns("I:J").Select : myExcel.Selection.ColumnWidth = 10
650
+        xlSheet.Columns("D:G").Select : myExcel.Selection.ColumnWidth = 15
651
+        xlSheet.Columns("K:N").Select : myExcel.Selection.ColumnWidth = 15
652
+
653
+        '全選改變列高
654
+        xlSheet.Cells.Select()  '全選
655
+        myExcel.Selection.RowHeight = 25  '改變列高
656
+        xlSheet.Range("A1").Select()
657
+
658
+        ' 改變列高Rows("1")
659
+        xlSheet.Rows("1:1").Select : myExcel.Selection.RowHeight = 5
660
+        ' 改變列高Rows("2")
661
+        xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 35
662
+
663
+        ' ("B2到N2")跨欄至中
664
+        xlSheet.Range("B2:N2").Select()
665
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
666
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
667
+        End With : myExcel.Selection.Merge
668
+
669
+        ' ("B3到C3")跨欄至中
670
+        xlSheet.Range("B3:C3").Select()
671
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
672
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
673
+        End With : myExcel.Selection.Merge
674
+
675
+        ' ("I3到J3")跨欄至中
676
+        xlSheet.Range("I3:J3").Select()
677
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
678
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
679
+        End With : myExcel.Selection.Merge
680
+
681
+        ' ("I4到J4")跨欄至中
682
+        xlSheet.Range("I4:J4").Select()
683
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
684
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
685
+        End With : myExcel.Selection.Merge
686
+        myExcel.Selection.Merge
687
+
688
+        '月total 跨欄至中 
689
+        xlSheet.Range("B" & Index_月_total.ToString & ":C" & Index_月_total.ToString).Select()
690
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
691
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
692
+        End With : myExcel.Selection.Merge
693
+
694
+        '跨欄至中 週 later
695
+        xlSheet.Range("I" & (CInt(週選_週數_tb.Text) + 5).ToString & ":J" & (CInt(週選_週數_tb.Text) + 5).ToString).Select()
696
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
697
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
698
+        End With : myExcel.Selection.Merge
699
+
700
+        '跨欄至中 週 total
701
+        xlSheet.Range("I" & (CInt(週選_週數_tb.Text) + 6).ToString & ":J" & (CInt(週選_週數_tb.Text) + 6).ToString).Select()
702
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
703
+            .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
704
+        End With : myExcel.Selection.Merge
705
+
706
+        ' 儲存格設置格式 週日期格式
707
+        xlSheet.Range("I5:J" & (CInt(週選_週數_tb.Text) + 4).ToString).Select()
708
+        myExcel.Selection.NumberFormatLocal = "mm/dd/yy;@" '設置格式
709
+        xlSheet.Range("B4").Select()
710
+        myExcel.Selection.NumberFormatLocal = "mm/dd/yy;@"
711
+        xlSheet.Range("B" & (Index_月_total - 1).ToString).Select()
712
+        myExcel.Selection.NumberFormatLocal = "mm/dd/yy;@"
713
+
714
+        ' 改變字體大小
715
+        xlSheet.Range("B2:N2").Select()
716
+        myExcel.Selection.Font.Size = 14
717
+
718
+        ' 儲存格設置格式 (數值 千分位符號)
719
+        xlSheet.Range("D4:G1000").Select() : myExcel.Selection.NumberFormatLocal = "#,##0_ "
720
+        xlSheet.Range("K4:N1000").Select() : myExcel.Selection.NumberFormatLocal = "#,##0_ "
721
+
722
+        ' 儲存格顏色設定
723
+        xlSheet.Range("B3:G3").Select()
724
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 16247773 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
725
+
726
+        ' 儲存格顏色設定
727
+        xlSheet.Range("I3:N3").Select()
728
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 16247773 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
729
+
730
+        ' 儲存格顏色設定
731
+        'xlSheet.Range("B2:N2").Select()
732
+        'With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0.399975585192419 : .PatternTintAndShade = 0 : End With
733
+
734
+        ' 儲存格顏色設定 月total
735
+        xlSheet.Range("G4:G" & Index_月_total.ToString).Select()
736
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent2 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
737
+
738
+        ' 儲存格顏色設定 月total
739
+        xlSheet.Range("B" & Index_月_total.ToString & ":G" & Index_月_total.ToString).Select()
740
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent2 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
741
+
742
+        ' 儲存格顏色設定 週total
743
+        xlSheet.Range("N4:N" & (CInt(週選_週數_tb.Text) + 6).ToString).Select()
744
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent2 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
745
+
746
+        ' 儲存格顏色設定 週total
747
+        xlSheet.Range("I" & (CInt(週選_週數_tb.Text) + 6).ToString & ":N" & (CInt(週選_週數_tb.Text) + 6).ToString).Select()
748
+        With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent2 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
749
+
750
+
751
+        ' 儲存格 格線設定 月
752
+        xlSheet.Range("B3:G" & Index_月_total.ToString).Select()
753
+        myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
754
+        With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
755
+        With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
756
+        With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
757
+        With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
758
+        With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
759
+        With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
760
+
761
+        ' 儲存格 格線設定 週
762
+        xlSheet.Range("I3:N" & (CInt(週選_週數_tb.Text) + 6).ToString).Select()
763
+        myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
764
+        With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
765
+        With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
766
+        With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
767
+        With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
768
+        With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
769
+        With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
770
+
771
+        ' 儲存格 格線設定 標頭
772
+        'xlSheet.Range("B2:N2").Select()
773
+        'myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
774
+        'myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
775
+        'With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
776
+        'With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
777
+        'With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
778
+        'With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
779
+        'With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
780
+        'With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
781
+
782
+        '全選後資料至中
783
+        xlSheet.Cells.Select()
784
+        With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
785
+            .ShrinkToFit = False : .ReadingOrder = xlContext
786
+        End With
787
+
788
+        ' 隱藏格線
789
+        myExcel.ActiveWindow.DisplayGridlines = False
790
+    End Sub
415
 End Class
791
 End Class

+ 515
- 515
TENDEN-MES-SYS/量產訂單管理/鞋盒資料控制表.Designer.vb
文件差異過大導致無法顯示
查看文件


+ 271
- 271
TENDEN-MES-SYS/量產訂單管理/鞋盒資料控制表.vb 查看文件

14
     Dim aa As MsgBoxResult
14
     Dim aa As MsgBoxResult
15
     Private  Sub Set_DGV1載入前設定()
15
     Private  Sub Set_DGV1載入前設定()
16
         conn.Close()
16
         conn.Close()
17
-        DataGridView1.DataSource = Nothing : ds.Clear()
18
-        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
19
-        DataGridView1.ColumnHeadersHeight = 25
20
-        DataGridView1.AllowUserToAddRows = False
17
+        清單1_dgv.DataSource = Nothing : ds.Clear()
18
+        清單1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
19
+        清單1_dgv.ColumnHeadersHeight = 25
20
+        清單1_dgv.AllowUserToAddRows = False
21
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
21
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
22
     End Sub
22
     End Sub
23
-    Private  Sub Set_DGV1載入後設定()
24
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
23
+    Private Sub Set_DGV1載入後設定()
24
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : 清單1_dgv.DataSource = ds.Tables(0) : conn.Close()
25
     End Sub
25
     End Sub
26
-    Private  Sub Set_清單1()
26
+    Private Sub Set_清單1()
27
         Set_DGV1載入前設定()
27
         Set_DGV1載入前設定()
28
         SQL1 = "SELECT SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
28
         SQL1 = "SELECT SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
29
                "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號 FROM 鞋盒資料控制表 ORDER BY STYLE"
29
                "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號 FROM 鞋盒資料控制表 ORDER BY STYLE"
30
         Set_DGV1載入後設定()
30
         Set_DGV1載入後設定()
31
     End Sub
31
     End Sub
32
-    Private  Sub Set_grid1()
33
-        DataGridView1.Columns(0).Width = 70 : DataGridView1.Columns(1).Width = 120 : DataGridView1.Columns(2).Width = 40 : DataGridView1.Columns(3).Width = 155
34
-        DataGridView1.Columns(4).Width = 80 : DataGridView1.Columns(5).Width = 150 : DataGridView1.Columns(6).Width = 150 : DataGridView1.Columns(7).Width = 150
35
-        DataGridView1.Columns(8).Width = 150 : DataGridView1.Columns(9).Width = 50 : DataGridView1.Columns(10).Width = 50 : DataGridView1.Columns(11).Width = 50
36
-        DataGridView1.Columns(12).Width = 50 : DataGridView1.Columns(13).Width = 150 : DataGridView1.Columns(14).Width = 150 : DataGridView1.Columns(15).Width = 150
37
-        DataGridView1.Columns(16).Width = 150 : DataGridView1.Columns(17).Width = 65 : DataGridView1.Columns(18).Width = 135 : DataGridView1.Columns(19).Width = 50
38
-        DataGridView1.Columns(9).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(10).DefaultCellStyle.Format = "#,##0.00"
39
-        DataGridView1.Columns(11).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(12).DefaultCellStyle.Format = "#,##0.00"
32
+    Private Sub Set_grid1()
33
+        清單1_dgv.Columns(0).Width = 70 : 清單1_dgv.Columns(1).Width = 120 : 清單1_dgv.Columns(2).Width = 40 : 清單1_dgv.Columns(3).Width = 155
34
+        清單1_dgv.Columns(4).Width = 80 : 清單1_dgv.Columns(5).Width = 150 : 清單1_dgv.Columns(6).Width = 150 : 清單1_dgv.Columns(7).Width = 150
35
+        清單1_dgv.Columns(8).Width = 150 : 清單1_dgv.Columns(9).Width = 50 : 清單1_dgv.Columns(10).Width = 50 : 清單1_dgv.Columns(11).Width = 50
36
+        清單1_dgv.Columns(12).Width = 50 : 清單1_dgv.Columns(13).Width = 150 : 清單1_dgv.Columns(14).Width = 150 : 清單1_dgv.Columns(15).Width = 150
37
+        清單1_dgv.Columns(16).Width = 150 : 清單1_dgv.Columns(17).Width = 65 : 清單1_dgv.Columns(18).Width = 135 : 清單1_dgv.Columns(19).Width = 50
38
+        清單1_dgv.Columns(9).DefaultCellStyle.Format = "#,##0.00" : 清單1_dgv.Columns(10).DefaultCellStyle.Format = "#,##0.00"
39
+        清單1_dgv.Columns(11).DefaultCellStyle.Format = "#,##0.00" : 清單1_dgv.Columns(12).DefaultCellStyle.Format = "#,##0.00"
40
         If BB(0) = False And BB(1) = True Then
40
         If BB(0) = False And BB(1) = True Then
41
-            DataGridView1.Columns(9).Visible = True : DataGridView1.Columns(10).Visible = True : DataGridView1.Columns(11).Visible = True : DataGridView1.Columns(12).Visible = True
42
-            DataGridView1.Columns(17).Visible = False : DataGridView1.Columns(18).Visible = False : DataGridView1.Columns(19).Visible = False
41
+            清單1_dgv.Columns(9).Visible = True : 清單1_dgv.Columns(10).Visible = True : 清單1_dgv.Columns(11).Visible = True : 清單1_dgv.Columns(12).Visible = True
42
+            清單1_dgv.Columns(17).Visible = False : 清單1_dgv.Columns(18).Visible = False : 清單1_dgv.Columns(19).Visible = False
43
         ElseIf BB(0) = True And BB(1) = False Then
43
         ElseIf BB(0) = True And BB(1) = False Then
44
-            DataGridView1.Columns(9).Visible = False : DataGridView1.Columns(10).Visible = False : DataGridView1.Columns(11).Visible = False : DataGridView1.Columns(12).Visible = False
45
-            DataGridView1.Columns(17).Visible = True : DataGridView1.Columns(18).Visible = True : DataGridView1.Columns(19).Visible = False
44
+            清單1_dgv.Columns(9).Visible = False : 清單1_dgv.Columns(10).Visible = False : 清單1_dgv.Columns(11).Visible = False : 清單1_dgv.Columns(12).Visible = False
45
+            清單1_dgv.Columns(17).Visible = True : 清單1_dgv.Columns(18).Visible = True : 清單1_dgv.Columns(19).Visible = False
46
         End If
46
         End If
47
     End Sub
47
     End Sub
48
-    Private  Sub Set_DGV2載入前設定()
48
+    Private Sub Set_DGV2載入前設定()
49
         conn.Close()
49
         conn.Close()
50
         鞋盒資料未建檔清單_dgv.DataSource = Nothing : ds1.Clear()
50
         鞋盒資料未建檔清單_dgv.DataSource = Nothing : ds1.Clear()
51
         鞋盒資料未建檔清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
51
         鞋盒資料未建檔清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
69
     End Sub
69
     End Sub
70
     Private Sub Set_DGV3載入前設定()
70
     Private Sub Set_DGV3載入前設定()
71
         conn.Close()
71
         conn.Close()
72
-        DataGridView3.DataSource = Nothing : ds2.Clear()
73
-        DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
74
-        DataGridView3.ColumnHeadersHeight = 25
75
-        DataGridView3.AllowUserToAddRows = False
72
+        清單2_dgv.DataSource = Nothing : ds2.Clear()
73
+        清單2_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
74
+        清單2_dgv.ColumnHeadersHeight = 25
75
+        清單2_dgv.AllowUserToAddRows = False
76
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
76
         If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
77
     End Sub
77
     End Sub
78
     Private Sub Set_DGV3載入後設定()
78
     Private Sub Set_DGV3載入後設定()
79
-        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
79
+        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : 清單2_dgv.DataSource = ds2.Tables(0) : conn.Close()
80
     End Sub
80
     End Sub
81
     Private Sub Set_grid3()
81
     Private Sub Set_grid3()
82
-        DataGridView3.Columns(0).Width = 95 : DataGridView3.Columns(1).Width = 70 : DataGridView3.Columns(2).Width = 130 : DataGridView3.Columns(3).Width = 65
83
-        DataGridView3.Columns(4).Width = 100 : DataGridView3.Columns(5).Width = 100 : DataGridView3.Columns(6).Width = 100 : DataGridView3.Columns(7).Width = 220
84
-        DataGridView3.Columns(8).Width = 120 : DataGridView3.Columns(9).Width = 70 : DataGridView3.Columns(10).Width = 90 : DataGridView3.Columns(11).Width = 168
85
-        DataGridView3.Columns(12).Width = 100 : DataGridView3.Columns(13).Width = 100 : DataGridView3.Columns(14).Width = 168 : DataGridView3.Columns(15).Width = 168
86
-        DataGridView3.Columns(10).DefaultCellStyle.Format = "#,##0"
87
-        DataGridView3.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView3.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
82
+        清單2_dgv.Columns(0).Width = 95 : 清單2_dgv.Columns(1).Width = 70 : 清單2_dgv.Columns(2).Width = 130 : 清單2_dgv.Columns(3).Width = 65
83
+        清單2_dgv.Columns(4).Width = 100 : 清單2_dgv.Columns(5).Width = 100 : 清單2_dgv.Columns(6).Width = 100 : 清單2_dgv.Columns(7).Width = 220
84
+        清單2_dgv.Columns(8).Width = 120 : 清單2_dgv.Columns(9).Width = 70 : 清單2_dgv.Columns(10).Width = 90 : 清單2_dgv.Columns(11).Width = 168
85
+        清單2_dgv.Columns(12).Width = 100 : 清單2_dgv.Columns(13).Width = 100 : 清單2_dgv.Columns(14).Width = 168 : 清單2_dgv.Columns(15).Width = 168
86
+        清單2_dgv.Columns(10).DefaultCellStyle.Format = "#,##0"
87
+        清單2_dgv.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : 清單2_dgv.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
88
     End Sub
88
     End Sub
89
     Private Sub ComboBox1下拉表單資料載入()
89
     Private Sub ComboBox1下拉表單資料載入()
90
         conn.Close()
90
         conn.Close()
152
     Private Sub 鞋盒資料控制表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
152
     Private Sub 鞋盒資料控制表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
153
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
153
         Me.MdiParent = TENDEN_MES_SYS : Me.WindowState = 2 : Me.AutoScroll = True
154
         第一頁_bt.Enabled = False : 確認新增_bt.Enabled = False : 確認複製_bt.Enabled = False
154
         第一頁_bt.Enabled = False : 確認新增_bt.Enabled = False : 確認複製_bt.Enabled = False
155
-        TextBox15.Visible = False : TextBox16.Visible = False : TextBox17.Visible = False
156
-        TextBox1.Enabled = False : TextBox2.Enabled = False : TextBox3.Enabled = False : TextBox4.Enabled = False
157
-        TextBox9.Enabled = False : TextBox10.Enabled = False : TextBox11.Enabled = False : TextBox12.Enabled = False
158
-        ComboBox6.Enabled = False : ComboBox7.Enabled = False
155
+        流水號_tb.Visible = False : 流水號2_tb.Visible = False : 流水號1_tb.Visible = False
156
+        SMALLBOX_tb.Enabled = False : MEDIUMBOX_tb.Enabled = False : LARGERBOX_tb.Enabled = False : EXTRABOX_tb.Enabled = False
157
+        DimensionsS_tb.Enabled = False : DimensionsM_tb.Enabled = False : DimensionsL_tb.Enabled = False : DimensionsE_tb.Enabled = False
158
+        寫入後初始化_cb.Enabled = False : 寫入後初始化1_cb.Enabled = False
159
         BB(0) = False : BB(1) = True
159
         BB(0) = False : BB(1) = True
160
         Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
160
         Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
161
         ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
161
         ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
162
     End Sub
162
     End Sub
163
-    Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView3.RowPostPaint
163
+    Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 清單2_dgv.RowPostPaint
164
         Dim linePen As New Pen(Color.Blue, 2)
164
         Dim linePen As New Pen(Color.Blue, 2)
165
-        If e.RowIndex = DataGridView3.Rows.Count - 1 Then
165
+        If e.RowIndex = 清單2_dgv.Rows.Count - 1 Then
166
             Exit Sub
166
             Exit Sub
167
         Else
167
         Else
168
-            If DataGridView3(2, e.RowIndex).Value.ToString <> DataGridView3(2, e.RowIndex + 1).Value.ToString Then
169
-                Dim startX As Integer = IIf(DataGridView3.RowHeadersVisible, DataGridView3.RowHeadersWidth, 0)
168
+            If 清單2_dgv(2, e.RowIndex).Value.ToString <> 清單2_dgv(2, e.RowIndex + 1).Value.ToString Then
169
+                Dim startX As Integer = IIf(清單2_dgv.RowHeadersVisible, 清單2_dgv.RowHeadersWidth, 0)
170
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
170
                 Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
171
-                Dim endX As Integer = startX + DataGridView3.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView3.HorizontalScrollingOffset
171
+                Dim endX As Integer = startX + 清單2_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 清單2_dgv.HorizontalScrollingOffset
172
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
172
                 e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
173
                 Exit Sub
173
                 Exit Sub
174
             End If
174
             End If
175
         End If
175
         End If
176
     End Sub
176
     End Sub
177
-    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
177
+    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles 清單1_dgv.CellClick
178
         If e.RowIndex = -1 Then : Else
178
         If e.RowIndex = -1 Then : Else
179
             ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
179
             ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
180
-            季節_cb.Text = DataGridView1(0, e.RowIndex).Value.ToString : 構造名稱_cb.Text = DataGridView1(1, e.RowIndex).Value.ToString
181
-            FTY_cb.Text = DataGridView1(2, e.RowIndex).Value.ToString : 風格_cb.Text = DataGridView1(3, e.RowIndex).Value.ToString
182
-            TVW_cb.Text = DataGridView1(4, e.RowIndex).Value.ToString : TextBox1.Text = DataGridView1(5, e.RowIndex).Value.ToString
183
-            TextBox2.Text = DataGridView1(6, e.RowIndex).Value.ToString : TextBox3.Text = DataGridView1(7, e.RowIndex).Value.ToString
184
-            TextBox4.Text = DataGridView1(8, e.RowIndex).Value.ToString : TextBox5.Text = DataGridView1(9, e.RowIndex).Value.ToString
185
-            TextBox6.Text = DataGridView1(10, e.RowIndex).Value.ToString : TextBox7.Text = DataGridView1(11, e.RowIndex).Value.ToString
186
-            TextBox8.Text = DataGridView1(12, e.RowIndex).Value.ToString : TextBox9.Text = DataGridView1(13, e.RowIndex).Value.ToString
187
-            TextBox10.Text = DataGridView1(14, e.RowIndex).Value.ToString : TextBox11.Text = DataGridView1(15, e.RowIndex).Value.ToString
188
-            TextBox12.Text = DataGridView1(16, e.RowIndex).Value.ToString : PRSCRT_tb.Text = DataGridView1(17, e.RowIndex).Value.ToString
189
-            QUK_tb.Text = DataGridView1(18, e.RowIndex).Value.ToString : TextBox15.Text = DataGridView1(19, e.RowIndex).Value.ToString
180
+            季節_cb.Text = 清單1_dgv(0, e.RowIndex).Value.ToString : 構造名稱_cb.Text = 清單1_dgv(1, e.RowIndex).Value.ToString
181
+            FTY_cb.Text = 清單1_dgv(2, e.RowIndex).Value.ToString : 風格_cb.Text = 清單1_dgv(3, e.RowIndex).Value.ToString
182
+            TVW_cb.Text = 清單1_dgv(4, e.RowIndex).Value.ToString : SMALLBOX_tb.Text = 清單1_dgv(5, e.RowIndex).Value.ToString
183
+            MEDIUMBOX_tb.Text = 清單1_dgv(6, e.RowIndex).Value.ToString : LARGERBOX_tb.Text = 清單1_dgv(7, e.RowIndex).Value.ToString
184
+            EXTRABOX_tb.Text = 清單1_dgv(8, e.RowIndex).Value.ToString : SMALL_tb.Text = 清單1_dgv(9, e.RowIndex).Value.ToString
185
+            MEDIUM_tb.Text = 清單1_dgv(10, e.RowIndex).Value.ToString : LARGE_tb.Text = 清單1_dgv(11, e.RowIndex).Value.ToString
186
+            EXTRA_tb.Text = 清單1_dgv(12, e.RowIndex).Value.ToString : DimensionsS_tb.Text = 清單1_dgv(13, e.RowIndex).Value.ToString
187
+            DimensionsM_tb.Text = 清單1_dgv(14, e.RowIndex).Value.ToString : DimensionsL_tb.Text = 清單1_dgv(15, e.RowIndex).Value.ToString
188
+            DimensionsE_tb.Text = 清單1_dgv(16, e.RowIndex).Value.ToString : PRSCRT_tb.Text = 清單1_dgv(17, e.RowIndex).Value.ToString
189
+            QUK_tb.Text = 清單1_dgv(18, e.RowIndex).Value.ToString : 流水號_tb.Text = 清單1_dgv(19, e.RowIndex).Value.ToString
190
             Set_DGV3載入前設定()
190
             Set_DGV3載入前設定()
191
             SQL1 = "SELECT 訂單流水號 AS VT#, 年份季度 AS 季度, 客戶訂單號, 生產工廠 AS 工廠, 訂單種類, 客戶交期 AS 訂單日期, TVW AS 型體號, 形體號 AS ProductName, 顏色, 楦型, 訂單數量, 備註, " &
191
             SQL1 = "SELECT 訂單流水號 AS VT#, 年份季度 AS 季度, 客戶訂單號, 生產工廠 AS 工廠, 訂單種類, 客戶交期 AS 訂單日期, TVW AS 型體號, 形體號 AS ProductName, 顏色, 楦型, 訂單數量, 備註, " &
192
-                   "工廠回復交期, 包裝確認時間, 客戶包裝確認, 東莞業務備註 FROM 訂單控制表 WHERE (形體號 LIKE '" & DataGridView1.Rows(e.RowIndex).Cells("STYLE").Value & "') ORDER BY 訂單日期, VT#"
192
+                   "工廠回復交期, 包裝確認時間, 客戶包裝確認, 東莞業務備註 FROM 訂單控制表 WHERE (形體號 LIKE '" & 清單1_dgv.Rows(e.RowIndex).Cells("STYLE").Value & "') ORDER BY 訂單日期, VT#"
193
             Set_DGV3載入後設定() : Set_grid3()
193
             Set_DGV3載入後設定() : Set_grid3()
194
         End If
194
         End If
195
     End Sub
195
     End Sub
222
         If (TVW_cb.Items.Count = 0) Then : Else : TVW_cb.SelectedIndex = 0 : End If : conn.Close()
222
         If (TVW_cb.Items.Count = 0) Then : Else : TVW_cb.SelectedIndex = 0 : End If : conn.Close()
223
         PP = ""
223
         PP = ""
224
     End Sub
224
     End Sub
225
-    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.Click
226
-        RadioButton1.Checked = True : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
227
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
228
-        ComboBox6.Enabled = True : ComboBox7.Enabled = False : ComboBox7.Text = " "
229
-    End Sub
230
-    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.Click
231
-        RadioButton1.Checked = False : RadioButton2.Checked = True : RadioButton3.Checked = False : RadioButton4.Checked = False
232
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
233
-        ComboBox6.Enabled = True : ComboBox7.Enabled = False : ComboBox7.Text = " "
234
-    End Sub
235
-    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.Click
236
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = True : RadioButton4.Checked = False
237
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
238
-        ComboBox6.Enabled = True : ComboBox7.Enabled = False : ComboBox7.Text = " "
239
-    End Sub
240
-    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.Click
241
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = True
242
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
243
-        ComboBox6.Enabled = True : ComboBox7.Enabled = False : ComboBox7.Text = " "
244
-    End Sub
245
-    Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton5.Click
246
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
247
-        RadioButton5.Checked = True : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
248
-        ComboBox6.Enabled = False : ComboBox7.Enabled = True : ComboBox6.Text = " "
249
-    End Sub
250
-    Private Sub RadioButton6_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton6.Click
251
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
252
-        RadioButton5.Checked = False : RadioButton6.Checked = True : RadioButton7.Checked = False : RadioButton8.Checked = False
253
-        ComboBox6.Enabled = False : ComboBox7.Enabled = True : ComboBox6.Text = " "
254
-    End Sub
255
-    Private Sub RadioButton7_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton7.Click
256
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
257
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = True : RadioButton8.Checked = False
258
-        ComboBox6.Enabled = False : ComboBox7.Enabled = True : ComboBox6.Text = " "
259
-    End Sub
260
-    Private Sub RadioButton8_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton8.Click
261
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
262
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = True
263
-        ComboBox6.Enabled = False : ComboBox7.Enabled = True : ComboBox6.Text = " "
264
-    End Sub
265
-    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.Click
266
-        If CheckBox1.Checked = True Then
267
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox1.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox1.Checked = True
268
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox1.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox1.Checked = False : End If
269
-        ElseIf CheckBox1.Checked = False Then
270
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox1.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox1.Checked = False
271
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox1.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox1.Checked = False : End If
225
+    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles S_B_S_rbt.Click
226
+        S_B_S_rbt.Checked = True : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
227
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
228
+        寫入後初始化_cb.Enabled = True : 寫入後初始化1_cb.Enabled = False : 寫入後初始化1_cb.Text = " "
229
+    End Sub
230
+    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles M_B_S_rbt.Click
231
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = True : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
232
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
233
+        寫入後初始化_cb.Enabled = True : 寫入後初始化1_cb.Enabled = False : 寫入後初始化1_cb.Text = " "
234
+    End Sub
235
+    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles L_B_S_rbt.Click
236
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = True : E_B_S_rbt.Checked = False
237
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
238
+        寫入後初始化_cb.Enabled = True : 寫入後初始化1_cb.Enabled = False : 寫入後初始化1_cb.Text = " "
239
+    End Sub
240
+    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles E_B_S_rbt.Click
241
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = True
242
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
243
+        寫入後初始化_cb.Enabled = True : 寫入後初始化1_cb.Enabled = False : 寫入後初始化1_cb.Text = " "
244
+    End Sub
245
+    Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles D_S_rbt.Click
246
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
247
+        D_S_rbt.Checked = True : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
248
+        寫入後初始化_cb.Enabled = False : 寫入後初始化1_cb.Enabled = True : 寫入後初始化_cb.Text = " "
249
+    End Sub
250
+    Private Sub RadioButton6_CheckedChanged(sender As Object, e As EventArgs) Handles D_M_rbt.Click
251
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
252
+        D_S_rbt.Checked = False : D_M_rbt.Checked = True : D_L_rbt.Checked = False : D_E_rbt.Checked = False
253
+        寫入後初始化_cb.Enabled = False : 寫入後初始化1_cb.Enabled = True : 寫入後初始化_cb.Text = " "
254
+    End Sub
255
+    Private Sub RadioButton7_CheckedChanged(sender As Object, e As EventArgs) Handles D_L_rbt.Click
256
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
257
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = True : D_E_rbt.Checked = False
258
+        寫入後初始化_cb.Enabled = False : 寫入後初始化1_cb.Enabled = True : 寫入後初始化_cb.Text = " "
259
+    End Sub
260
+    Private Sub RadioButton8_CheckedChanged(sender As Object, e As EventArgs) Handles D_E_rbt.Click
261
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
262
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = True
263
+        寫入後初始化_cb.Enabled = False : 寫入後初始化1_cb.Enabled = True : 寫入後初始化_cb.Text = " "
264
+    End Sub
265
+    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles 数值5_cb.Click
266
+        If 数值5_cb.Checked = True Then
267
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值5_cb.Checked = True
268
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值5_cb.Checked = False : End If
269
+        ElseIf 数值5_cb.Checked = False Then
270
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值5_cb.Checked = False
271
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值5_cb.Checked = False : End If
272
         End If
272
         End If
273
     End Sub
273
     End Sub
274
-    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.Click
275
-        If CheckBox2.Checked = True Then
276
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox2.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox2.Checked = True
277
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox2.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox2.Checked = False : End If
278
-        ElseIf CheckBox2.Checked = False Then
279
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox2.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox2.Checked = False
280
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox2.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox2.Checked = False : End If
274
+    Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles 数值5_5_cb.Click
275
+        If 数值5_5_cb.Checked = True Then
276
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值5_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值5_5_cb.Checked = True
277
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值5_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值5_5_cb.Checked = False : End If
278
+        ElseIf 数值5_5_cb.Checked = False Then
279
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值5_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值5_5_cb.Checked = False
280
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值5_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值5_5_cb.Checked = False : End If
281
         End If
281
         End If
282
     End Sub
282
     End Sub
283
-    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.Click
284
-        If CheckBox3.Checked = True Then
285
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox3.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox3.Checked = True
286
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox3.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox3.Checked = False : End If
287
-        ElseIf CheckBox3.Checked = False Then
288
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox3.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox3.Checked = False
289
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox3.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox3.Checked = False : End If
283
+    Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles 数值6_cb.Click
284
+        If 数值6_cb.Checked = True Then
285
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值6_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值6_cb.Checked = True
286
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值6_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值6_cb.Checked = False : End If
287
+        ElseIf 数值6_cb.Checked = False Then
288
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值6_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值6_cb.Checked = False
289
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值6_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值6_cb.Checked = False : End If
290
         End If
290
         End If
291
     End Sub
291
     End Sub
292
-    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.Click
293
-        If CheckBox4.Checked = True Then
294
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox4.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox4.Checked = True
295
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox4.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox4.Checked = False : End If
296
-        ElseIf CheckBox4.Checked = False Then
297
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox4.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox4.Checked = False
298
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox4.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox4.Checked = False : End If
292
+    Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles 数值6_5_cb.Click
293
+        If 数值6_5_cb.Checked = True Then
294
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值6_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值6_5_cb.Checked = True
295
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值6_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值6_5_cb.Checked = False : End If
296
+        ElseIf 数值6_5_cb.Checked = False Then
297
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值6_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值6_5_cb.Checked = False
298
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值6_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值6_5_cb.Checked = False : End If
299
         End If
299
         End If
300
     End Sub
300
     End Sub
301
-    Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.Click
302
-        If CheckBox5.Checked = True Then
303
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox5.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox5.Checked = True
304
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox5.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox5.Checked = False : End If
305
-        ElseIf CheckBox5.Checked = False Then
306
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox5.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox5.Checked = False
307
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox5.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox5.Checked = False : End If
301
+    Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles 数值7_cb.Click
302
+        If 数值7_cb.Checked = True Then
303
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值7_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值7_cb.Checked = True
304
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值7_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值7_cb.Checked = False : End If
305
+        ElseIf 数值7_cb.Checked = False Then
306
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值7_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值7_cb.Checked = False
307
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值7_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值7_cb.Checked = False : End If
308
         End If
308
         End If
309
     End Sub
309
     End Sub
310
-    Private Sub CheckBox6_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox6.Click
311
-        If CheckBox6.Checked = True Then
312
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox6.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox6.Checked = True
313
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox6.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox6.Checked = False : End If
314
-        ElseIf CheckBox6.Checked = False Then
315
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox6.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox6.Checked = False
316
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox6.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox6.Checked = False : End If
310
+    Private Sub CheckBox6_CheckedChanged(sender As Object, e As EventArgs) Handles 数值7_5_cb.Click
311
+        If 数值7_5_cb.Checked = True Then
312
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值7_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值7_5_cb.Checked = True
313
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值7_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值7_5_cb.Checked = False : End If
314
+        ElseIf 数值7_5_cb.Checked = False Then
315
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值7_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值7_5_cb.Checked = False
316
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值7_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值7_5_cb.Checked = False : End If
317
         End If
317
         End If
318
     End Sub
318
     End Sub
319
-    Private Sub CheckBox7_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox7.Click
320
-        If CheckBox7.Checked = True Then
321
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox7.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox7.Checked = True
322
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox7.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox7.Checked = False : End If
323
-        ElseIf CheckBox7.Checked = False Then
324
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox7.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox7.Checked = False
325
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox7.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox7.Checked = False : End If
319
+    Private Sub CheckBox7_CheckedChanged(sender As Object, e As EventArgs) Handles 数值8_cb.Click
320
+        If 数值8_cb.Checked = True Then
321
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值8_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值8_cb.Checked = True
322
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值8_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值8_cb.Checked = False : End If
323
+        ElseIf 数值8_cb.Checked = False Then
324
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值8_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值8_cb.Checked = False
325
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值8_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值8_cb.Checked = False : End If
326
         End If
326
         End If
327
     End Sub
327
     End Sub
328
-    Private Sub CheckBox8_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox8.Click
329
-        If CheckBox8.Checked = True Then
330
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox8.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox8.Checked = True
331
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox8.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox8.Checked = False : End If
332
-        ElseIf CheckBox8.Checked = False Then
333
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox8.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox8.Checked = False
334
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox8.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox8.Checked = False : End If
328
+    Private Sub CheckBox8_CheckedChanged(sender As Object, e As EventArgs) Handles 数值8_5_cb.Click
329
+        If 数值8_5_cb.Checked = True Then
330
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值8_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值8_5_cb.Checked = True
331
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值8_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值8_5_cb.Checked = False : End If
332
+        ElseIf 数值8_5_cb.Checked = False Then
333
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值8_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值8_5_cb.Checked = False
334
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值8_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值8_5_cb.Checked = False : End If
335
         End If
335
         End If
336
     End Sub
336
     End Sub
337
     Private Sub CheckBox9_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox9.Click
337
     Private Sub CheckBox9_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox9.Click
352
             ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox10.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox10.Checked = False : End If
352
             ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox10.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox10.Checked = False : End If
353
         End If
353
         End If
354
     End Sub
354
     End Sub
355
-    Private Sub CheckBox11_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox11.Click
356
-        If CheckBox11.Checked = True Then
357
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox11.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox11.Checked = True
358
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox11.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox11.Checked = False : End If
359
-        ElseIf CheckBox11.Checked = False Then
360
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox11.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox11.Checked = False
361
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox11.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox11.Checked = False : End If
355
+    Private Sub CheckBox11_CheckedChanged(sender As Object, e As EventArgs) Handles 数值10_cb.Click
356
+        If 数值10_cb.Checked = True Then
357
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值10_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值10_cb.Checked = True
358
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值10_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值10_cb.Checked = False : End If
359
+        ElseIf 数值10_cb.Checked = False Then
360
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值10_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值10_cb.Checked = False
361
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值10_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值10_cb.Checked = False : End If
362
         End If
362
         End If
363
     End Sub
363
     End Sub
364
-    Private Sub CheckBox12_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox12.Click
365
-        If CheckBox12.Checked = True Then
366
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox12.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox12.Checked = True
367
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox12.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox12.Checked = False : End If
368
-        ElseIf CheckBox12.Checked = False Then
369
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox12.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox12.Checked = False
370
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox12.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox12.Checked = False : End If
364
+    Private Sub CheckBox12_CheckedChanged(sender As Object, e As EventArgs) Handles 数值10_5_cb.Click
365
+        If 数值10_5_cb.Checked = True Then
366
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值10_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值10_5_cb.Checked = True
367
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值10_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值10_5_cb.Checked = False : End If
368
+        ElseIf 数值10_5_cb.Checked = False Then
369
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值10_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值10_5_cb.Checked = False
370
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值10_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值10_5_cb.Checked = False : End If
371
         End If
371
         End If
372
     End Sub
372
     End Sub
373
-    Private Sub CheckBox13_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox13.Click
374
-        If CheckBox13.Checked = True Then
375
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox13.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox13.Checked = True
376
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox13.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox13.Checked = False : End If
377
-        ElseIf CheckBox13.Checked = False Then
378
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox13.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox13.Checked = False
379
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox13.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox13.Checked = False : End If
373
+    Private Sub CheckBox13_CheckedChanged(sender As Object, e As EventArgs) Handles 数值11_cb.Click
374
+        If 数值11_cb.Checked = True Then
375
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值11_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值11_cb.Checked = True
376
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值11_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值11_cb.Checked = False : End If
377
+        ElseIf 数值11_cb.Checked = False Then
378
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值11_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值11_cb.Checked = False
379
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值11_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值11_cb.Checked = False : End If
380
         End If
380
         End If
381
     End Sub
381
     End Sub
382
-    Private Sub CheckBox14_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox14.Click
383
-        If CheckBox14.Checked = True Then
384
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox14.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox14.Checked = True
385
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox14.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox14.Checked = False : End If
386
-        ElseIf CheckBox14.Checked = False Then
387
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox14.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox14.Checked = False
388
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox14.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox14.Checked = False : End If
382
+    Private Sub CheckBox14_CheckedChanged(sender As Object, e As EventArgs) Handles 数值11_5_cb.Click
383
+        If 数值11_5_cb.Checked = True Then
384
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值11_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值11_5_cb.Checked = True
385
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值11_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值11_5_cb.Checked = False : End If
386
+        ElseIf 数值11_5_cb.Checked = False Then
387
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值11_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值11_5_cb.Checked = False
388
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值11_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值11_5_cb.Checked = False : End If
389
         End If
389
         End If
390
     End Sub
390
     End Sub
391
-    Private Sub CheckBox15_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox15.Click
392
-        If CheckBox15.Checked = True Then
393
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox15.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox15.Checked = True
394
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox15.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox15.Checked = False : End If
395
-        ElseIf CheckBox15.Checked = False Then
396
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox15.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox15.Checked = False
397
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox15.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox15.Checked = False : End If
391
+    Private Sub CheckBox15_CheckedChanged(sender As Object, e As EventArgs) Handles 数值12_cb.Click
392
+        If 数值12_cb.Checked = True Then
393
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值12_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值12_cb.Checked = True
394
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值12_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值12_cb.Checked = False : End If
395
+        ElseIf 数值12_cb.Checked = False Then
396
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值12_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值12_cb.Checked = False
397
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值12_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值12_cb.Checked = False : End If
398
         End If
398
         End If
399
     End Sub
399
     End Sub
400
-    Private Sub CheckBox16_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox16.Click
401
-        If CheckBox16.Checked = True Then
402
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox16.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox16.Checked = True
403
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox16.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox16.Checked = False : End If
404
-        ElseIf CheckBox16.Checked = False Then
405
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox16.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox16.Checked = False
406
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox16.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox16.Checked = False : End If
400
+    Private Sub CheckBox16_CheckedChanged(sender As Object, e As EventArgs) Handles 数值12_5_cb.Click
401
+        If 数值12_5_cb.Checked = True Then
402
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值12_5_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值12_5_cb.Checked = True
403
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值12_5_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值12_5_cb.Checked = False : End If
404
+        ElseIf 数值12_5_cb.Checked = False Then
405
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值12_5_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值12_5_cb.Checked = False
406
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值12_5_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值12_5_cb.Checked = False : End If
407
         End If
407
         End If
408
     End Sub
408
     End Sub
409
-    Private Sub CheckBox17_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox17.Click
410
-        If CheckBox17.Checked = True Then
411
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox17.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox17.Checked = True
412
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox17.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox17.Checked = False : End If
413
-        ElseIf CheckBox17.Checked = False Then
414
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox17.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox17.Checked = False
415
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox17.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox17.Checked = False : End If
409
+    Private Sub CheckBox17_CheckedChanged(sender As Object, e As EventArgs) Handles 数值13_cb.Click
410
+        If 数值13_cb.Checked = True Then
411
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值13_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值13_cb.Checked = True
412
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值13_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值13_cb.Checked = False : End If
413
+        ElseIf 数值13_cb.Checked = False Then
414
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值13_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值13_cb.Checked = False
415
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值13_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值13_cb.Checked = False : End If
416
         End If
416
         End If
417
     End Sub
417
     End Sub
418
-    Private Sub CheckBox18_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox18.Click
419
-        If CheckBox18.Checked = True Then
420
-            If KL1 = False And KL2 = False Then : KL1 = True : CheckBox18.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : CheckBox18.Checked = True
421
-            ElseIf KL1 = True And KL2 = False Then : KL2 = True : CheckBox18.Checked = True : ElseIf KL1 = True And KL2 = True Then : CheckBox18.Checked = False : End If
422
-        ElseIf CheckBox18.Checked = False Then
423
-            If KL1 = True And KL2 = True Then : KL1 = False : CheckBox18.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : CheckBox18.Checked = False
424
-            ElseIf KL1 = False And KL2 = True Then : KL2 = False : CheckBox18.Checked = False : ElseIf KL1 = False And KL2 = False Then : CheckBox18.Checked = False : End If
418
+    Private Sub CheckBox18_CheckedChanged(sender As Object, e As EventArgs) Handles 数值14_cb.Click
419
+        If 数值14_cb.Checked = True Then
420
+            If KL1 = False And KL2 = False Then : KL1 = True : 数值14_cb.Checked = True : ElseIf KL1 = False And KL2 = True Then : KL1 = True : 数值14_cb.Checked = True
421
+            ElseIf KL1 = True And KL2 = False Then : KL2 = True : 数值14_cb.Checked = True : ElseIf KL1 = True And KL2 = True Then : 数值14_cb.Checked = False : End If
422
+        ElseIf 数值14_cb.Checked = False Then
423
+            If KL1 = True And KL2 = True Then : KL1 = False : 数值14_cb.Checked = False : ElseIf KL1 = True And KL2 = False Then : KL1 = False : 数值14_cb.Checked = False
424
+            ElseIf KL1 = False And KL2 = True Then : KL2 = False : 数值14_cb.Checked = False : ElseIf KL1 = False And KL2 = False Then : 数值14_cb.Checked = False : End If
425
         End If
425
         End If
426
     End Sub
426
     End Sub
427
     Private Sub 寫入後初始化()
427
     Private Sub 寫入後初始化()
428
-        If RadioButton1.Checked = True Then : TextBox1.Text = TextBox16.Text : ElseIf RadioButton2.Checked = True Then : TextBox2.Text = TextBox16.Text
429
-        ElseIf RadioButton3.Checked = True Then : TextBox3.Text = TextBox16.Text : ElseIf RadioButton4.Checked = True Then : TextBox4.Text = TextBox16.Text
430
-        ElseIf RadioButton5.Checked = True Then : TextBox9.Text = TextBox16.Text : ElseIf RadioButton6.Checked = True Then : TextBox10.Text = TextBox16.Text
431
-        ElseIf RadioButton7.Checked = True Then : TextBox11.Text = TextBox16.Text : ElseIf RadioButton8.Checked = True Then : TextBox12.Text = TextBox16.Text
428
+        If S_B_S_rbt.Checked = True Then : SMALLBOX_tb.Text = 流水號2_tb.Text : ElseIf M_B_S_rbt.Checked = True Then : MEDIUMBOX_tb.Text = 流水號2_tb.Text
429
+        ElseIf L_B_S_rbt.Checked = True Then : LARGERBOX_tb.Text = 流水號2_tb.Text : ElseIf E_B_S_rbt.Checked = True Then : EXTRABOX_tb.Text = 流水號2_tb.Text
430
+        ElseIf D_S_rbt.Checked = True Then : DimensionsS_tb.Text = 流水號2_tb.Text : ElseIf D_M_rbt.Checked = True Then : DimensionsM_tb.Text = 流水號2_tb.Text
431
+        ElseIf D_L_rbt.Checked = True Then : DimensionsL_tb.Text = 流水號2_tb.Text : ElseIf D_E_rbt.Checked = True Then : DimensionsE_tb.Text = 流水號2_tb.Text
432
         End If
432
         End If
433
         KL1 = False : KL2 = False
433
         KL1 = False : KL2 = False
434
-        CheckBox1.Checked = False : CheckBox2.Checked = False : CheckBox3.Checked = False : CheckBox4.Checked = False : CheckBox5.Checked = False
435
-        CheckBox6.Checked = False : CheckBox7.Checked = False : CheckBox8.Checked = False : CheckBox9.Checked = False : CheckBox10.Checked = False
436
-        CheckBox11.Checked = False : CheckBox12.Checked = False : CheckBox13.Checked = False : CheckBox14.Checked = False : CheckBox15.Checked = False
437
-        CheckBox16.Checked = False : CheckBox17.Checked = False : CheckBox18.Checked = False
438
-        RadioButton1.Checked = False : RadioButton2.Checked = False : RadioButton3.Checked = False : RadioButton4.Checked = False
439
-        RadioButton5.Checked = False : RadioButton6.Checked = False : RadioButton7.Checked = False : RadioButton8.Checked = False
434
+        数值5_cb.Checked = False : 数值5_5_cb.Checked = False : 数值6_cb.Checked = False : 数值6_5_cb.Checked = False : 数值7_cb.Checked = False
435
+        数值7_5_cb.Checked = False : 数值8_cb.Checked = False : 数值8_5_cb.Checked = False : CheckBox9.Checked = False : CheckBox10.Checked = False
436
+        数值10_cb.Checked = False : 数值10_5_cb.Checked = False : 数值11_cb.Checked = False : 数值11_5_cb.Checked = False : 数值12_cb.Checked = False
437
+        数值12_5_cb.Checked = False : 数值13_cb.Checked = False : 数值14_cb.Checked = False
438
+        S_B_S_rbt.Checked = False : M_B_S_rbt.Checked = False : L_B_S_rbt.Checked = False : E_B_S_rbt.Checked = False
439
+        D_S_rbt.Checked = False : D_M_rbt.Checked = False : D_L_rbt.Checked = False : D_E_rbt.Checked = False
440
     End Sub
440
     End Sub
441
     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles 寫入鞋盒尺寸_bt.Click
441
     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles 寫入鞋盒尺寸_bt.Click
442
         If KL1 = False Or KL2 = False Then
442
         If KL1 = False Or KL2 = False Then
443
             MsgBox("尺碼範圍沒有正確選擇")
443
             MsgBox("尺碼範圍沒有正確選擇")
444
         Else
444
         Else
445
-            If CheckBox1.Checked = True Then : FG1 = "5" : ElseIf CheckBox2.Checked = True Then : FG1 = "5.5" : ElseIf CheckBox3.Checked = True Then : FG1 = "6"
446
-            ElseIf CheckBox4.Checked = True Then : FG1 = "6.5" : ElseIf CheckBox5.Checked = True Then : FG1 = "7" : ElseIf CheckBox6.Checked = True Then : FG1 = "7.5"
447
-            ElseIf CheckBox7.Checked = True Then : FG1 = "8" : ElseIf CheckBox8.Checked = True Then : FG1 = "8.5" : ElseIf CheckBox9.Checked = True Then : FG1 = "9"
448
-            ElseIf CheckBox10.Checked = True Then : FG1 = "9.5" : ElseIf CheckBox11.Checked = True Then : FG1 = "10" : ElseIf CheckBox12.Checked = True Then : FG1 = "10.5"
449
-            ElseIf CheckBox13.Checked = True Then : FG1 = "11" : ElseIf CheckBox14.Checked = True Then : FG1 = "11.5" : ElseIf CheckBox15.Checked = True Then : FG1 = "12"
450
-            ElseIf CheckBox16.Checked = True Then : FG1 = "12.5" : ElseIf CheckBox17.Checked = True Then : FG1 = "13" : ElseIf CheckBox18.Checked = True Then : FG1 = "14"
445
+            If 数值5_cb.Checked = True Then : FG1 = "5" : ElseIf 数值5_5_cb.Checked = True Then : FG1 = "5.5" : ElseIf 数值6_cb.Checked = True Then : FG1 = "6"
446
+            ElseIf 数值6_5_cb.Checked = True Then : FG1 = "6.5" : ElseIf 数值7_cb.Checked = True Then : FG1 = "7" : ElseIf 数值7_5_cb.Checked = True Then : FG1 = "7.5"
447
+            ElseIf 数值8_cb.Checked = True Then : FG1 = "8" : ElseIf 数值8_5_cb.Checked = True Then : FG1 = "8.5" : ElseIf CheckBox9.Checked = True Then : FG1 = "9"
448
+            ElseIf CheckBox10.Checked = True Then : FG1 = "9.5" : ElseIf 数值10_cb.Checked = True Then : FG1 = "10" : ElseIf 数值10_5_cb.Checked = True Then : FG1 = "10.5"
449
+            ElseIf 数值11_cb.Checked = True Then : FG1 = "11" : ElseIf 数值11_5_cb.Checked = True Then : FG1 = "11.5" : ElseIf 数值12_cb.Checked = True Then : FG1 = "12"
450
+            ElseIf 数值12_5_cb.Checked = True Then : FG1 = "12.5" : ElseIf 数值13_cb.Checked = True Then : FG1 = "13" : ElseIf 数值14_cb.Checked = True Then : FG1 = "14"
451
             End If
451
             End If
452
 
452
 
453
-            If CheckBox18.Checked = True Then : FG2 = "14" : ElseIf CheckBox17.Checked = True Then : FG2 = "13" : ElseIf CheckBox16.Checked = True Then : FG2 = "12.5"
454
-            ElseIf CheckBox15.Checked = True Then : FG2 = "12" : ElseIf CheckBox14.Checked = True Then : FG2 = "11.5" : ElseIf CheckBox13.Checked = True Then : FG2 = "11"
455
-            ElseIf CheckBox12.Checked = True Then : FG2 = "10.5" : ElseIf CheckBox11.Checked = True Then : FG2 = "10" : ElseIf CheckBox10.Checked = True Then : FG2 = "9.5"
456
-            ElseIf CheckBox9.Checked = True Then : FG2 = "9" : ElseIf CheckBox8.Checked = True Then : FG2 = "8.5" : ElseIf CheckBox7.Checked = True Then : FG2 = "8"
457
-            ElseIf CheckBox6.Checked = True Then : FG2 = "7.5" : ElseIf CheckBox5.Checked = True Then : FG2 = "7" : ElseIf CheckBox4.Checked = True Then : FG2 = "6.5"
458
-            ElseIf CheckBox3.Checked = True Then : FG2 = "6" : ElseIf CheckBox2.Checked = True Then : FG2 = "5.5" : ElseIf CheckBox1.Checked = True Then : FG2 = "5"
453
+            If 数值14_cb.Checked = True Then : FG2 = "14" : ElseIf 数值13_cb.Checked = True Then : FG2 = "13" : ElseIf 数值12_5_cb.Checked = True Then : FG2 = "12.5"
454
+            ElseIf 数值12_cb.Checked = True Then : FG2 = "12" : ElseIf 数值11_5_cb.Checked = True Then : FG2 = "11.5" : ElseIf 数值11_cb.Checked = True Then : FG2 = "11"
455
+            ElseIf 数值10_5_cb.Checked = True Then : FG2 = "10.5" : ElseIf 数值10_cb.Checked = True Then : FG2 = "10" : ElseIf CheckBox10.Checked = True Then : FG2 = "9.5"
456
+            ElseIf CheckBox9.Checked = True Then : FG2 = "9" : ElseIf 数值8_5_cb.Checked = True Then : FG2 = "8.5" : ElseIf 数值8_cb.Checked = True Then : FG2 = "8"
457
+            ElseIf 数值7_5_cb.Checked = True Then : FG2 = "7.5" : ElseIf 数值7_cb.Checked = True Then : FG2 = "7" : ElseIf 数值6_5_cb.Checked = True Then : FG2 = "6.5"
458
+            ElseIf 数值6_cb.Checked = True Then : FG2 = "6" : ElseIf 数值5_5_cb.Checked = True Then : FG2 = "5.5" : ElseIf 数值5_cb.Checked = True Then : FG2 = "5"
459
             End If
459
             End If
460
 
460
 
461
-            If ComboBox6.Enabled = False And ComboBox7.Enabled = False Then
461
+            If 寫入後初始化_cb.Enabled = False And 寫入後初始化1_cb.Enabled = False Then
462
                 MsgBox("紙箱尺寸沒有正確選擇")
462
                 MsgBox("紙箱尺寸沒有正確選擇")
463
-            ElseIf ComboBox6.Enabled = True And ComboBox7.Enabled = False And ComboBox6.Text <> "" And ComboBox6.Text <> " " Then
464
-                TextBox16.Text = "(" & FG1 & "-" & FG2 & "#)" & ComboBox6.Text
465
-                寫入後初始化() : ComboBox6.Text = " "
466
-            ElseIf ComboBox6.Enabled = False And ComboBox7.Enabled = True And ComboBox7.Text <> "" And ComboBox7.Text <> " " Then
467
-                TextBox16.Text = "(" & FG1 & "-" & FG2 & "#)" & ComboBox7.Text
468
-                寫入後初始化() : ComboBox7.Text = " "
463
+            ElseIf 寫入後初始化_cb.Enabled = True And 寫入後初始化1_cb.Enabled = False And 寫入後初始化_cb.Text <> "" And 寫入後初始化_cb.Text <> " " Then
464
+                流水號2_tb.Text = "(" & FG1 & "-" & FG2 & "#)" & 寫入後初始化_cb.Text
465
+                寫入後初始化() : 寫入後初始化_cb.Text = " "
466
+            ElseIf 寫入後初始化_cb.Enabled = False And 寫入後初始化1_cb.Enabled = True And 寫入後初始化1_cb.Text <> "" And 寫入後初始化1_cb.Text <> " " Then
467
+                流水號2_tb.Text = "(" & FG1 & "-" & FG2 & "#)" & 寫入後初始化1_cb.Text
468
+                寫入後初始化() : 寫入後初始化1_cb.Text = " "
469
             Else
469
             Else
470
                 MsgBox("紙箱尺寸沒有正確選擇")
470
                 MsgBox("紙箱尺寸沒有正確選擇")
471
             End If
471
             End If
473
     End Sub
473
     End Sub
474
     Private Sub Button29_Click(sender As Object, e As EventArgs) Handles 新增_bt.Click
474
     Private Sub Button29_Click(sender As Object, e As EventArgs) Handles 新增_bt.Click
475
         ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
475
         ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : ComboBox3下拉表單資料載入() : ComboBox4下拉表單資料載入() : ComboBox5下拉表單資料載入()
476
-        TextBox1.Text = "" : TextBox2.Text = "" : TextBox3.Text = "" : TextBox4.Text = "" : TextBox5.Text = "" : TextBox6.Text = "" : TextBox7.Text = ""
477
-        TextBox8.Text = "" : TextBox9.Text = "" : TextBox10.Text = "" : TextBox11.Text = "" : TextBox12.Text = "" : PRSCRT_tb.Text = "" : QUK_tb.Text = ""
478
-        TextBox15.Text = "" : TextBox16.Text = ""
476
+        SMALLBOX_tb.Text = "" : MEDIUMBOX_tb.Text = "" : LARGERBOX_tb.Text = "" : EXTRABOX_tb.Text = "" : SMALL_tb.Text = "" : MEDIUM_tb.Text = "" : LARGE_tb.Text = ""
477
+        EXTRA_tb.Text = "" : DimensionsS_tb.Text = "" : DimensionsM_tb.Text = "" : DimensionsL_tb.Text = "" : DimensionsE_tb.Text = "" : PRSCRT_tb.Text = "" : QUK_tb.Text = ""
478
+        流水號_tb.Text = "" : 流水號2_tb.Text = ""
479
         新增_bt.Enabled = False : 確認新增_bt.Enabled = True
479
         新增_bt.Enabled = False : 確認新增_bt.Enabled = True
480
     End Sub
480
     End Sub
481
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles 確認新增_bt.Click
481
     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles 確認新增_bt.Click
504
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
504
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
505
                                 SQL1 = "SELECT TOP (1) 鞋盒流水號 FROM 鞋盒資料控制表 GROUP BY 鞋盒流水號 ORDER BY 鞋盒流水號 DESC"
505
                                 SQL1 = "SELECT TOP (1) 鞋盒流水號 FROM 鞋盒資料控制表 GROUP BY 鞋盒流水號 ORDER BY 鞋盒流水號 DESC"
506
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
506
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
507
-                                If dr.Read() Then : TextBox17.Text = dr("鞋盒流水號").ToString : Else : TextBox17.Text = "" : End If
507
+                                If dr.Read() Then : 流水號1_tb.Text = dr("鞋盒流水號").ToString : Else : 流水號1_tb.Text = "" : End If
508
                                 conn.Close()
508
                                 conn.Close()
509
                                 Dim NUM1 As Integer
509
                                 Dim NUM1 As Integer
510
-                                NUM1 = Double.Parse(Strings.Right(TextBox17.Text, 8)) + 1
511
-                                If NUM1 < 10 Then : TextBox17.Text = "SB" & "0000000" & NUM1
512
-                                ElseIf NUM1 > 9 And NUM1 < 100 Then : TextBox17.Text = "SB" & "000000" & NUM1
513
-                                ElseIf NUM1 > 99 And NUM1 < 1000 Then : TextBox17.Text = "SB" & "00000" & NUM1
514
-                                ElseIf NUM1 > 999 And NUM1 < 10000 Then : TextBox17.Text = "SB" & "0000" & NUM1
515
-                                ElseIf NUM1 > 9999 And NUM1 < 100000 Then : TextBox17.Text = "SB" & "000" & NUM1
516
-                                ElseIf NUM1 > 99999 And NUM1 < 100000 Then : TextBox17.Text = "SB" & "00" & NUM1
517
-                                ElseIf NUM1 > 999999 And NUM1 < 1000000 Then : TextBox17.Text = "SB" & "0" & NUM1
518
-                                ElseIf NUM1 > 9999999 Then : TextBox17.Text = "SB" & NUM1
510
+                                NUM1 = Double.Parse(Strings.Right(流水號1_tb.Text, 8)) + 1
511
+                                If NUM1 < 10 Then : 流水號1_tb.Text = "SB" & "0000000" & NUM1
512
+                                ElseIf NUM1 > 9 And NUM1 < 100 Then : 流水號1_tb.Text = "SB" & "000000" & NUM1
513
+                                ElseIf NUM1 > 99 And NUM1 < 1000 Then : 流水號1_tb.Text = "SB" & "00000" & NUM1
514
+                                ElseIf NUM1 > 999 And NUM1 < 10000 Then : 流水號1_tb.Text = "SB" & "0000" & NUM1
515
+                                ElseIf NUM1 > 9999 And NUM1 < 100000 Then : 流水號1_tb.Text = "SB" & "000" & NUM1
516
+                                ElseIf NUM1 > 99999 And NUM1 < 100000 Then : 流水號1_tb.Text = "SB" & "00" & NUM1
517
+                                ElseIf NUM1 > 999999 And NUM1 < 1000000 Then : 流水號1_tb.Text = "SB" & "0" & NUM1
518
+                                ElseIf NUM1 > 9999999 Then : 流水號1_tb.Text = "SB" & NUM1
519
                                 End If
519
                                 End If
520
 
520
 
521
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
521
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
522
                                 SQL1 = "INSERT INTO 鞋盒資料控制表 (SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
522
                                 SQL1 = "INSERT INTO 鞋盒資料控制表 (SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
523
                                                                    "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號) " &
523
                                                                    "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號) " &
524
-                                       "VALUES ('" & 季節_cb.Text & "','" & 構造名稱_cb.Text & "','" & FTY_cb.Text & "','" & 風格_cb.Text & "','" & TVW_cb.Text & "','" & TextBox1.Text &
525
-                                       "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text &
526
-                                       "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox11.Text & "','" & TextBox12.Text & "','" & PRSCRT_tb.Text &
527
-                                       "','" & QUK_tb.Text & "','" & TextBox17.Text & "')"
524
+                                       "VALUES ('" & 季節_cb.Text & "','" & 構造名稱_cb.Text & "','" & FTY_cb.Text & "','" & 風格_cb.Text & "','" & TVW_cb.Text & "','" & SMALLBOX_tb.Text &
525
+                                       "','" & MEDIUMBOX_tb.Text & "','" & LARGERBOX_tb.Text & "','" & EXTRABOX_tb.Text & "','" & SMALL_tb.Text & "','" & MEDIUM_tb.Text & "','" & LARGE_tb.Text &
526
+                                       "','" & EXTRA_tb.Text & "','" & DimensionsS_tb.Text & "','" & DimensionsM_tb.Text & "','" & DimensionsL_tb.Text & "','" & DimensionsE_tb.Text & "','" & PRSCRT_tb.Text &
527
+                                       "','" & QUK_tb.Text & "','" & 流水號1_tb.Text & "')"
528
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
528
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
529
                                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
529
                                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
530
                                 MsgBox("新增完成")
530
                                 MsgBox("新增完成")
537
         End If
537
         End If
538
     End Sub
538
     End Sub
539
     Private Sub Button12_Click(sender As Object, e As EventArgs) Handles 修改_bt.Click
539
     Private Sub Button12_Click(sender As Object, e As EventArgs) Handles 修改_bt.Click
540
-        If TextBox15.Text = "" Then
540
+        If 流水號_tb.Text = "" Then
541
             MsgBox("未選擇要修改的資料")
541
             MsgBox("未選擇要修改的資料")
542
         Else
542
         Else
543
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
543
             If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
544
             SQL1 = "UPDATE 鞋盒資料控制表 SET SEASON = '" & 季節_cb.Text & "', CONSTRUCTION = '" & 構造名稱_cb.Text & "', FTY = '" & FTY_cb.Text & "', STYLE = '" & 風格_cb.Text &
544
             SQL1 = "UPDATE 鞋盒資料控制表 SET SEASON = '" & 季節_cb.Text & "', CONSTRUCTION = '" & 構造名稱_cb.Text & "', FTY = '" & FTY_cb.Text & "', STYLE = '" & 風格_cb.Text &
545
-                   "', TVW = '" & TVW_cb.Text & "', S_B_S = '" & TextBox1.Text & "', M_B_S = '" & TextBox2.Text & "', L_B_S = '" & TextBox3.Text & "', E_B_S = '" & TextBox4.Text &
546
-                   "', S_GW = '" & TextBox5.Text & "', M_GW = '" & TextBox6.Text & "', L_GW = '" & TextBox7.Text & "', E_GW = '" & TextBox8.Text & "', Dimensions_S = '" & TextBox9.Text &
547
-                   "', Dimensions_M = '" & TextBox10.Text & "', Dimensions_L = '" & TextBox11.Text & "', Dimensions_E = '" & TextBox12.Text & "', PRS_CRT = '" & PRSCRT_tb.Text &
548
-                   "', QUK = '" & QUK_tb.Text & "' WHERE (鞋盒流水號 = '" & TextBox15.Text & "')"
545
+                   "', TVW = '" & TVW_cb.Text & "', S_B_S = '" & SMALLBOX_tb.Text & "', M_B_S = '" & MEDIUMBOX_tb.Text & "', L_B_S = '" & LARGERBOX_tb.Text & "', E_B_S = '" & EXTRABOX_tb.Text &
546
+                   "', S_GW = '" & SMALL_tb.Text & "', M_GW = '" & MEDIUM_tb.Text & "', L_GW = '" & LARGE_tb.Text & "', E_GW = '" & EXTRA_tb.Text & "', Dimensions_S = '" & DimensionsS_tb.Text &
547
+                   "', Dimensions_M = '" & DimensionsM_tb.Text & "', Dimensions_L = '" & DimensionsL_tb.Text & "', Dimensions_E = '" & DimensionsE_tb.Text & "', PRS_CRT = '" & PRSCRT_tb.Text &
548
+                   "', QUK = '" & QUK_tb.Text & "' WHERE (鞋盒流水號 = '" & 流水號_tb.Text & "')"
549
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
549
             cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
550
             Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
550
             Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
551
             MsgBox("修改完成")
551
             MsgBox("修改完成")
552
         End If
552
         End If
553
     End Sub
553
     End Sub
554
     Private Sub Button10_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
554
     Private Sub Button10_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
555
-        If TextBox15.Text = "" Then
555
+        If 流水號_tb.Text = "" Then
556
             MsgBox("未選擇要刪除的資料")
556
             MsgBox("未選擇要刪除的資料")
557
         Else
557
         Else
558
             aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
558
             aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
559
             If aa = MsgBoxResult.Ok Then
559
             If aa = MsgBoxResult.Ok Then
560
                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
560
                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
561
-                SQL1 = "DELETE FROM 鞋盒資料控制表 WHERE (鞋盒流水號 = '" & TextBox15.Text & "')"
561
+                SQL1 = "DELETE FROM 鞋盒資料控制表 WHERE (鞋盒流水號 = '" & 流水號_tb.Text & "')"
562
                 cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : conn.Close()
562
                 cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : conn.Close()
563
                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
563
                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
564
                 MsgBox("刪除完成")
564
                 MsgBox("刪除完成")
617
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
617
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
618
                                 SQL1 = "SELECT TOP (1) 鞋盒流水號 FROM 鞋盒資料控制表 GROUP BY 鞋盒流水號 ORDER BY 鞋盒流水號 DESC"
618
                                 SQL1 = "SELECT TOP (1) 鞋盒流水號 FROM 鞋盒資料控制表 GROUP BY 鞋盒流水號 ORDER BY 鞋盒流水號 DESC"
619
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
619
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
620
-                                If dr.Read() Then : TextBox17.Text = dr("鞋盒流水號").ToString : Else : TextBox17.Text = "" : End If
620
+                                If dr.Read() Then : 流水號1_tb.Text = dr("鞋盒流水號").ToString : Else : 流水號1_tb.Text = "" : End If
621
                                 conn.Close()
621
                                 conn.Close()
622
                                 Dim NUM1 As Integer
622
                                 Dim NUM1 As Integer
623
-                                NUM1 = Double.Parse(Strings.Right(TextBox17.Text, 8)) + 1
624
-                                If NUM1 < 10 Then : TextBox17.Text = "SB" & "0000000" & NUM1
625
-                                ElseIf NUM1 > 9 And NUM1 < 100 Then : TextBox17.Text = "SB" & "000000" & NUM1
626
-                                ElseIf NUM1 > 99 And NUM1 < 1000 Then : TextBox17.Text = "SB" & "00000" & NUM1
627
-                                ElseIf NUM1 > 999 And NUM1 < 10000 Then : TextBox17.Text = "SB" & "0000" & NUM1
628
-                                ElseIf NUM1 > 9999 And NUM1 < 100000 Then : TextBox17.Text = "SB" & "000" & NUM1
629
-                                ElseIf NUM1 > 99999 And NUM1 < 100000 Then : TextBox17.Text = "SB" & "00" & NUM1
630
-                                ElseIf NUM1 > 999999 And NUM1 < 1000000 Then : TextBox17.Text = "SB" & "0" & NUM1
631
-                                ElseIf NUM1 > 9999999 Then : TextBox17.Text = "SB" & NUM1
623
+                                NUM1 = Double.Parse(Strings.Right(流水號1_tb.Text, 8)) + 1
624
+                                If NUM1 < 10 Then : 流水號1_tb.Text = "SB" & "0000000" & NUM1
625
+                                ElseIf NUM1 > 9 And NUM1 < 100 Then : 流水號1_tb.Text = "SB" & "000000" & NUM1
626
+                                ElseIf NUM1 > 99 And NUM1 < 1000 Then : 流水號1_tb.Text = "SB" & "00000" & NUM1
627
+                                ElseIf NUM1 > 999 And NUM1 < 10000 Then : 流水號1_tb.Text = "SB" & "0000" & NUM1
628
+                                ElseIf NUM1 > 9999 And NUM1 < 100000 Then : 流水號1_tb.Text = "SB" & "000" & NUM1
629
+                                ElseIf NUM1 > 99999 And NUM1 < 100000 Then : 流水號1_tb.Text = "SB" & "00" & NUM1
630
+                                ElseIf NUM1 > 999999 And NUM1 < 1000000 Then : 流水號1_tb.Text = "SB" & "0" & NUM1
631
+                                ElseIf NUM1 > 9999999 Then : 流水號1_tb.Text = "SB" & NUM1
632
                                 End If
632
                                 End If
633
 
633
 
634
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
634
                                 If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
635
                                 SQL1 = "INSERT INTO 鞋盒資料控制表 (SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
635
                                 SQL1 = "INSERT INTO 鞋盒資料控制表 (SEASON, CONSTRUCTION, FTY, STYLE, TVW, S_B_S, M_B_S, L_B_S, E_B_S, S_GW, M_GW, L_GW, E_GW, Dimensions_S, Dimensions_M, Dimensions_L, " &
636
                                                                    "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號) " &
636
                                                                    "Dimensions_E, PRS_CRT, QUK, 鞋盒流水號) " &
637
-                                       "VALUES ('" & 季節_cb.Text & "','" & 構造名稱_cb.Text & "','" & FTY_cb.Text & "','" & 風格_cb.Text & "','" & TVW_cb.Text & "','" & TextBox1.Text &
638
-                                       "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text &
639
-                                       "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox11.Text & "','" & TextBox12.Text & "','" & PRSCRT_tb.Text &
640
-                                       "','" & QUK_tb.Text & "','" & TextBox17.Text & "')"
637
+                                       "VALUES ('" & 季節_cb.Text & "','" & 構造名稱_cb.Text & "','" & FTY_cb.Text & "','" & 風格_cb.Text & "','" & TVW_cb.Text & "','" & SMALLBOX_tb.Text &
638
+                                       "','" & MEDIUMBOX_tb.Text & "','" & LARGERBOX_tb.Text & "','" & EXTRABOX_tb.Text & "','" & SMALL_tb.Text & "','" & MEDIUM_tb.Text & "','" & LARGE_tb.Text &
639
+                                       "','" & EXTRA_tb.Text & "','" & DimensionsS_tb.Text & "','" & DimensionsM_tb.Text & "','" & DimensionsL_tb.Text & "','" & DimensionsE_tb.Text & "','" & PRSCRT_tb.Text &
640
+                                       "','" & QUK_tb.Text & "','" & 流水號1_tb.Text & "')"
641
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
641
                                 cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
642
                                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
642
                                 Set_清單1() : Set_grid1() : Set_清單2() : Set_grid2()
643
                                 MsgBox("新增完成")
643
                                 MsgBox("新增完成")

Loading…
取消
儲存