Kaynağa Gözat

1. 新增配方EXCEL匯入功能

卓叡 7 ay önce
ebeveyn
işleme
b1e507bda6

BIN
.vs/OW-ERP-SYS/FileContentIndex/6c5dbfce-3d18-46c1-870a-79cecca705dc.vsidx Dosyayı Görüntüle


BIN
.vs/OW-ERP-SYS/FileContentIndex/fd73ce16-42fb-458d-a349-38847f1c454f.vsidx Dosyayı Görüntüle


BIN
.vs/OW-ERP-SYS/v17/.suo Dosyayı Görüntüle


+ 52
- 4
.vs/OW-ERP-SYS/v17/DocumentLayout.json Dosyayı Görüntüle

@@ -7,8 +7,20 @@
7 7
       "RelativeMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|solutionrelative:ow-erp-sys\\loginform1.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}"
8 8
     },
9 9
     {
10
-      "AbsoluteMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|d:\\project1\\ow-erp-sys\\ow-erp-sys\\0\u3001mymodule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}",
10
+      "AbsoluteMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|D:\\Project1\\OW-ERP-SYS\\ow-erp-sys\\0\u3001mymodule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}",
11 11
       "RelativeMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|solutionrelative:ow-erp-sys\\0\u3001mymodule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}"
12
+    },
13
+    {
14
+      "AbsoluteMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|d:\\project1\\ow-erp-sys\\ow-erp-sys\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}",
15
+      "RelativeMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|solutionrelative:ow-erp-sys\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}"
16
+    },
17
+    {
18
+      "AbsoluteMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|D:\\Project1\\OW-ERP-SYS\\ow-erp-sys\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}|Form",
19
+      "RelativeMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|solutionrelative:ow-erp-sys\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}|Form"
20
+    },
21
+    {
22
+      "AbsoluteMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|D:\\Project1\\OW-ERP-SYS\\ow-erp-sys\\0\u3001mymodule\\\u4E3B\u8CC7\u6599\u5EAB\\sql_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}",
23
+      "RelativeMoniker": "D:0:0:{6EC44D36-D153-43A1-BE08-174C088DDE70}|OW-ERP-SYS\\OW-ERP-SYS.vbproj|solutionrelative:ow-erp-sys\\0\u3001mymodule\\\u4E3B\u8CC7\u6599\u5EAB\\sql_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb||{2C015C70-C72C-11D0-88C3-00A0C9110049}"
12 24
     }
13 25
   ],
14 26
   "DocumentGroupContainers": [
@@ -18,7 +30,7 @@
18 30
       "DocumentGroups": [
19 31
         {
20 32
           "DockedWidth": 200,
21
-          "SelectedChildIndex": 2,
33
+          "SelectedChildIndex": 5,
22 34
           "Children": [
23 35
             {
24 36
               "$type": "Bookmark",
@@ -28,6 +40,42 @@
28 40
               "$type": "Bookmark",
29 41
               "Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}"
30 42
             },
43
+            {
44
+              "$type": "Document",
45
+              "DocumentIndex": 4,
46
+              "Title": "SQL_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb",
47
+              "DocumentMoniker": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\0\u3001MyModule\\\u4E3B\u8CC7\u6599\u5EAB\\SQL_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb",
48
+              "RelativeDocumentMoniker": "OW-ERP-SYS\\0\u3001MyModule\\\u4E3B\u8CC7\u6599\u5EAB\\SQL_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb",
49
+              "ToolTip": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\0\u3001MyModule\\\u4E3B\u8CC7\u6599\u5EAB\\SQL_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb",
50
+              "RelativeToolTip": "OW-ERP-SYS\\0\u3001MyModule\\\u4E3B\u8CC7\u6599\u5EAB\\SQL_\u6280\u8853\u7BA1\u7406\u7CFB\u7D71.vb",
51
+              "ViewState": "AQIAAE4AAAAAAAAAAAAhwFgAAAAdAAAA",
52
+              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
53
+              "WhenOpened": "2024-08-28T08:43:32.37Z"
54
+            },
55
+            {
56
+              "$type": "Document",
57
+              "DocumentIndex": 2,
58
+              "Title": "\u88FD\u7A0B\u914D\u65B9\u8868.vb",
59
+              "DocumentMoniker": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
60
+              "RelativeDocumentMoniker": "OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
61
+              "ToolTip": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
62
+              "RelativeToolTip": "OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
63
+              "ViewState": "AQIAAJsGAAAAAAAAAAAjwKwGAAA6AAAA",
64
+              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
65
+              "WhenOpened": "2024-08-28T03:35:20.818Z",
66
+              "EditorCaption": ""
67
+            },
68
+            {
69
+              "$type": "Document",
70
+              "DocumentIndex": 3,
71
+              "Title": "\u88FD\u7A0B\u914D\u65B9\u8868.vb [\u8A2D\u8A08]",
72
+              "DocumentMoniker": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
73
+              "RelativeDocumentMoniker": "OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb",
74
+              "ToolTip": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb [\u8A2D\u8A08]",
75
+              "RelativeToolTip": "OW-ERP-SYS\\05\u3001\u6280\u8853\u7BA1\u7406\u7CFB\u7D71\\\u88FD\u7A0B\u914D\u65B9\u8868.vb [\u8A2D\u8A08]",
76
+              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
77
+              "WhenOpened": "2024-08-28T03:35:08.862Z"
78
+            },
31 79
             {
32 80
               "$type": "Document",
33 81
               "DocumentIndex": 0,
@@ -36,7 +84,7 @@
36 84
               "RelativeDocumentMoniker": "OW-ERP-SYS\\LoginForm1.vb",
37 85
               "ToolTip": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\LoginForm1.vb",
38 86
               "RelativeToolTip": "OW-ERP-SYS\\LoginForm1.vb",
39
-              "ViewState": "AQIAAJ8AAAAAAAAAAAAYwKQAAAAOAAAA",
87
+              "ViewState": "AQIAAJ8AAAAAAAAAAAAYwKwAAAAEAAAA",
40 88
               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
41 89
               "WhenOpened": "2024-08-12T06:36:55.284Z",
42 90
               "EditorCaption": ""
@@ -49,7 +97,7 @@
49 97
               "RelativeDocumentMoniker": "OW-ERP-SYS\\0\u3001MyModule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb",
50 98
               "ToolTip": "D:\\Project1\\OW-ERP-SYS\\OW-ERP-SYS\\0\u3001MyModule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb",
51 99
               "RelativeToolTip": "OW-ERP-SYS\\0\u3001MyModule\\\u6A21\u7D44\\\u5168\u57DF\u8B8A\u6578.vb",
52
-              "ViewState": "AQIAAAEAAAAAAAAAAAAuwA8AAAApAAAA",
100
+              "ViewState": "AQIAAAEAAAAAAAAAAAAuwAsAAAAjAAAA",
53 101
               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003361|",
54 102
               "WhenOpened": "2024-07-30T10:34:10.581Z",
55 103
               "EditorCaption": ""

+ 19
- 19
OW-ERP-SYS/05、技術管理系統/製程管制紀錄表_奶油組.Designer.vb Dosyayı Görüntüle

@@ -37,6 +37,8 @@ Partial Class 製程管制紀錄表_奶油組
37 37
         Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
38 38
         Me.原料顯示_pl = New System.Windows.Forms.Panel()
39 39
         Me.輸入重量_pl = New System.Windows.Forms.Panel()
40
+        Me.投入備註_tb = New System.Windows.Forms.TextBox()
41
+        Me.投入備註_lb = New System.Windows.Forms.Label()
40 42
         Me.確認重量_bt = New System.Windows.Forms.Button()
41 43
         Me.投料狀態_tb = New System.Windows.Forms.TextBox()
42 44
         Me.投料狀態_lb = New System.Windows.Forms.Label()
@@ -296,8 +298,6 @@ Partial Class 製程管制紀錄表_奶油組
296 298
         Me.開簽名檔_bt = New System.Windows.Forms.Button()
297 299
         Me.簽名檔_dgv = New System.Windows.Forms.DataGridView()
298 300
         Me.暫存簽名檔圖片_pb = New System.Windows.Forms.PictureBox()
299
-        Me.投入備註_tb = New System.Windows.Forms.TextBox()
300
-        Me.投入備註_lb = New System.Windows.Forms.Label()
301 301
         Me.原料顯示_pl.SuspendLayout()
302 302
         Me.輸入重量_pl.SuspendLayout()
303 303
         CType(Me.重量數值_nud, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -413,6 +413,23 @@ Partial Class 製程管制紀錄表_奶油組
413 413
         Me.輸入重量_pl.Size = New System.Drawing.Size(165, 188)
414 414
         Me.輸入重量_pl.TabIndex = 2087
415 415
         '
416
+        '投入備註_tb
417
+        '
418
+        Me.投入備註_tb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
419
+        Me.投入備註_tb.Location = New System.Drawing.Point(68, 63)
420
+        Me.投入備註_tb.Name = "投入備註_tb"
421
+        Me.投入備註_tb.Size = New System.Drawing.Size(92, 23)
422
+        Me.投入備註_tb.TabIndex = 2124
423
+        '
424
+        '投入備註_lb
425
+        '
426
+        Me.投入備註_lb.AutoSize = True
427
+        Me.投入備註_lb.Location = New System.Drawing.Point(3, 66)
428
+        Me.投入備註_lb.Name = "投入備註_lb"
429
+        Me.投入備註_lb.Size = New System.Drawing.Size(37, 16)
430
+        Me.投入備註_lb.TabIndex = 2123
431
+        Me.投入備註_lb.Text = "備註 :"
432
+        '
416 433
         '確認重量_bt
417 434
         '
418 435
         Me.確認重量_bt.ForeColor = System.Drawing.Color.OrangeRed
@@ -3349,23 +3366,6 @@ Partial Class 製程管制紀錄表_奶油組
3349 3366
         Me.暫存簽名檔圖片_pb.TabIndex = 1393
3350 3367
         Me.暫存簽名檔圖片_pb.TabStop = False
3351 3368
         '
3352
-        '投入備註_tb
3353
-        '
3354
-        Me.投入備註_tb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
3355
-        Me.投入備註_tb.Location = New System.Drawing.Point(68, 63)
3356
-        Me.投入備註_tb.Name = "投入備註_tb"
3357
-        Me.投入備註_tb.Size = New System.Drawing.Size(92, 23)
3358
-        Me.投入備註_tb.TabIndex = 2124
3359
-        '
3360
-        '投入備註_lb
3361
-        '
3362
-        Me.投入備註_lb.AutoSize = True
3363
-        Me.投入備註_lb.Location = New System.Drawing.Point(3, 66)
3364
-        Me.投入備註_lb.Name = "投入備註_lb"
3365
-        Me.投入備註_lb.Size = New System.Drawing.Size(37, 16)
3366
-        Me.投入備註_lb.TabIndex = 2123
3367
-        Me.投入備註_lb.Text = "備註 :"
3368
-        '
3369 3369
         '製程管制紀錄表_奶油組
3370 3370
         '
3371 3371
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)

+ 371
- 55
OW-ERP-SYS/05、技術管理系統/製程配方表.Designer.vb Dosyayı Görüntüle

@@ -42,6 +42,8 @@ Partial Class 製程配方表
42 42
         Dim DataGridViewCellStyle17 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
43 43
         Dim DataGridViewCellStyle18 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
44 44
         Dim DataGridViewCellStyle19 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
45
+        Dim DataGridViewCellStyle20 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
46
+        Dim DataGridViewCellStyle21 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
45 47
         Me.配方原料油_dgv = New System.Windows.Forms.DataGridView()
46 48
         Me.配方香料_dgv = New System.Windows.Forms.DataGridView()
47 49
         Me.配方乳化劑_dgv = New System.Windows.Forms.DataGridView()
@@ -79,6 +81,11 @@ Partial Class 製程配方表
79 81
         Me.明細流水號_tb = New System.Windows.Forms.TextBox()
80 82
         Me.登入使用者_tb = New System.Windows.Forms.TextBox()
81 83
         Me.配方_DTP = New System.Windows.Forms.DateTimePicker()
84
+        Me.匯入Excel_bt = New System.Windows.Forms.Button()
85
+        Me.讀取日期_tb = New System.Windows.Forms.TextBox()
86
+        Me.讀取料號_tb = New System.Windows.Forms.TextBox()
87
+        Me.讀取品名_tb = New System.Windows.Forms.TextBox()
88
+        Me.讀取檔名_tb = New System.Windows.Forms.TextBox()
82 89
         Me.規格項目名稱_tb = New System.Windows.Forms.TextBox()
83 90
         Me.規格選項內容_tb = New System.Windows.Forms.TextBox()
84 91
         Me.規格項次_tb = New System.Windows.Forms.TextBox()
@@ -99,11 +106,17 @@ Partial Class 製程配方表
99 106
         Me.油脂種類_cb = New System.Windows.Forms.ComboBox()
100 107
         Me.認證標章_cb = New System.Windows.Forms.ComboBox()
101 108
         Me.Panel1 = New System.Windows.Forms.Panel()
102
-        Me.Button1 = New System.Windows.Forms.Button()
103
-        Me.TextBox4 = New System.Windows.Forms.TextBox()
104
-        Me.TextBox3 = New System.Windows.Forms.TextBox()
105
-        Me.TextBox2 = New System.Windows.Forms.TextBox()
106
-        Me.TextBox1 = New System.Windows.Forms.TextBox()
109
+        Me.PictureBox3 = New System.Windows.Forms.PictureBox()
110
+        Me.PictureBox1 = New System.Windows.Forms.PictureBox()
111
+        Me.檢視油脂列表_bt = New System.Windows.Forms.Button()
112
+        Me.Panel5 = New System.Windows.Forms.Panel()
113
+        Me.讀取組別_tb = New System.Windows.Forms.TextBox()
114
+        Me.讀取標章_tb = New System.Windows.Forms.TextBox()
115
+        Me.讀取產量_tb = New System.Windows.Forms.TextBox()
116
+        Me.讀取代工_tb = New System.Windows.Forms.TextBox()
117
+        Me.讀取版本_tb = New System.Windows.Forms.TextBox()
118
+        Me.讀取季節_tb = New System.Windows.Forms.TextBox()
119
+        Me.讀取油種_tb = New System.Windows.Forms.TextBox()
107 120
         Me.隱藏_pl2 = New System.Windows.Forms.Panel()
108 121
         Me.暫存簽名編碼_tb = New System.Windows.Forms.TextBox()
109 122
         Me.組別_dgv = New System.Windows.Forms.DataGridView()
@@ -252,6 +265,18 @@ Partial Class 製程配方表
252 265
         Me.開簽名檔_bt = New System.Windows.Forms.Button()
253 266
         Me.簽名檔_dgv = New System.Windows.Forms.DataGridView()
254 267
         Me.暫存簽名檔圖片_pb = New System.Windows.Forms.PictureBox()
268
+        Me.Panel6 = New System.Windows.Forms.Panel()
269
+        Me.PictureBox2 = New System.Windows.Forms.PictureBox()
270
+        Me.Search_列表編號_cb = New System.Windows.Forms.CheckBox()
271
+        Me.Search_列表名稱_cb = New System.Windows.Forms.CheckBox()
272
+        Me.關鍵字1_tb = New System.Windows.Forms.TextBox()
273
+        Me.列表關鍵字_bt = New System.Windows.Forms.Button()
274
+        Me.關鍵字1_lb = New System.Windows.Forms.Label()
275
+        Me.列表儲存_bt = New System.Windows.Forms.Button()
276
+        Me.配方列表_dgv = New System.Windows.Forms.DataGridView()
277
+        Me.油脂種類1_cb = New System.Windows.Forms.ComboBox()
278
+        Me.Label2 = New System.Windows.Forms.Label()
279
+        Me.關閉列表_bt = New System.Windows.Forms.Button()
255 280
         CType(Me.配方原料油_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
256 281
         CType(Me.配方香料_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
257 282
         CType(Me.配方乳化劑_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -263,6 +288,9 @@ Partial Class 製程配方表
263 288
         CType(Me.版本_nud, System.ComponentModel.ISupportInitialize).BeginInit()
264 289
         Me.隱藏_pl1.SuspendLayout()
265 290
         Me.Panel1.SuspendLayout()
291
+        CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
292
+        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
293
+        Me.Panel5.SuspendLayout()
266 294
         Me.隱藏_pl2.SuspendLayout()
267 295
         CType(Me.組別_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
268 296
         CType(Me.淨重單位_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -291,6 +319,9 @@ Partial Class 製程配方表
291 319
         Me.最高權限_pl.SuspendLayout()
292 320
         CType(Me.簽名檔_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
293 321
         CType(Me.暫存簽名檔圖片_pb, System.ComponentModel.ISupportInitialize).BeginInit()
322
+        Me.Panel6.SuspendLayout()
323
+        CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
324
+        CType(Me.配方列表_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
294 325
         Me.SuspendLayout()
295 326
         '
296 327
         '配方原料油_dgv
@@ -620,15 +651,10 @@ Partial Class 製程配方表
620 651
         '隱藏_pl1
621 652
         '
622 653
         Me.隱藏_pl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
623
-        Me.隱藏_pl1.Controls.Add(Me.Button1)
624 654
         Me.隱藏_pl1.Controls.Add(Me.簽名_DTP)
625
-        Me.隱藏_pl1.Controls.Add(Me.TextBox4)
626 655
         Me.隱藏_pl1.Controls.Add(Me.規格刪單_bt)
627
-        Me.隱藏_pl1.Controls.Add(Me.TextBox3)
628 656
         Me.隱藏_pl1.Controls.Add(Me.規格入單_bt)
629
-        Me.隱藏_pl1.Controls.Add(Me.TextBox2)
630 657
         Me.隱藏_pl1.Controls.Add(Me.原料刪單_bt)
631
-        Me.隱藏_pl1.Controls.Add(Me.TextBox1)
632 658
         Me.隱藏_pl1.Controls.Add(Me.原料入單_bt)
633 659
         Me.隱藏_pl1.Controls.Add(Me.原料重量_tb)
634 660
         Me.隱藏_pl1.Controls.Add(Me.油脂比_tb)
@@ -731,6 +757,44 @@ Partial Class 製程配方表
731 757
         Me.配方_DTP.TabIndex = 1942
732 758
         Me.配方_DTP.Value = New Date(2023, 12, 8, 11, 34, 6, 0)
733 759
         '
760
+        '匯入Excel_bt
761
+        '
762
+        Me.匯入Excel_bt.Location = New System.Drawing.Point(425, 0)
763
+        Me.匯入Excel_bt.Name = "匯入Excel_bt"
764
+        Me.匯入Excel_bt.Size = New System.Drawing.Size(96, 28)
765
+        Me.匯入Excel_bt.TabIndex = 2067
766
+        Me.匯入Excel_bt.Text = "匯入 Excel"
767
+        Me.匯入Excel_bt.TextAlign = System.Drawing.ContentAlignment.MiddleRight
768
+        Me.匯入Excel_bt.UseVisualStyleBackColor = True
769
+        '
770
+        '讀取日期_tb
771
+        '
772
+        Me.讀取日期_tb.Location = New System.Drawing.Point(6, 94)
773
+        Me.讀取日期_tb.Name = "讀取日期_tb"
774
+        Me.讀取日期_tb.Size = New System.Drawing.Size(100, 23)
775
+        Me.讀取日期_tb.TabIndex = 2066
776
+        '
777
+        '讀取料號_tb
778
+        '
779
+        Me.讀取料號_tb.Location = New System.Drawing.Point(6, 65)
780
+        Me.讀取料號_tb.Name = "讀取料號_tb"
781
+        Me.讀取料號_tb.Size = New System.Drawing.Size(100, 23)
782
+        Me.讀取料號_tb.TabIndex = 2065
783
+        '
784
+        '讀取品名_tb
785
+        '
786
+        Me.讀取品名_tb.Location = New System.Drawing.Point(6, 36)
787
+        Me.讀取品名_tb.Name = "讀取品名_tb"
788
+        Me.讀取品名_tb.Size = New System.Drawing.Size(100, 23)
789
+        Me.讀取品名_tb.TabIndex = 2064
790
+        '
791
+        '讀取檔名_tb
792
+        '
793
+        Me.讀取檔名_tb.Location = New System.Drawing.Point(6, 7)
794
+        Me.讀取檔名_tb.Name = "讀取檔名_tb"
795
+        Me.讀取檔名_tb.Size = New System.Drawing.Size(100, 23)
796
+        Me.讀取檔名_tb.TabIndex = 2063
797
+        '
734 798
         '規格項目名稱_tb
735 799
         '
736 800
         Me.規格項目名稱_tb.Location = New System.Drawing.Point(368, 2)
@@ -921,6 +985,11 @@ Partial Class 製程配方表
921 985
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
922 986
         Me.Panel1.AutoScroll = True
923 987
         Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
988
+        Me.Panel1.Controls.Add(Me.PictureBox3)
989
+        Me.Panel1.Controls.Add(Me.PictureBox1)
990
+        Me.Panel1.Controls.Add(Me.檢視油脂列表_bt)
991
+        Me.Panel1.Controls.Add(Me.匯入Excel_bt)
992
+        Me.Panel1.Controls.Add(Me.Panel5)
924 993
         Me.Panel1.Controls.Add(Me.隱藏_pl1)
925 994
         Me.Panel1.Controls.Add(Me.隱藏_pl2)
926 995
         Me.Panel1.Controls.Add(Me.配方香料_dgv)
@@ -973,42 +1042,102 @@ Partial Class 製程配方表
973 1042
         Me.Panel1.Size = New System.Drawing.Size(975, 634)
974 1043
         Me.Panel1.TabIndex = 2013
975 1044
         '
976
-        'Button1
977
-        '
978
-        Me.Button1.Location = New System.Drawing.Point(223, 132)
979
-        Me.Button1.Name = "Button1"
980
-        Me.Button1.Size = New System.Drawing.Size(75, 23)
981
-        Me.Button1.TabIndex = 2067
982
-        Me.Button1.Text = "Button1"
983
-        Me.Button1.UseVisualStyleBackColor = True
984
-        '
985
-        'TextBox4
986
-        '
987
-        Me.TextBox4.Location = New System.Drawing.Point(223, 103)
988
-        Me.TextBox4.Name = "TextBox4"
989
-        Me.TextBox4.Size = New System.Drawing.Size(100, 23)
990
-        Me.TextBox4.TabIndex = 2066
991
-        '
992
-        'TextBox3
993
-        '
994
-        Me.TextBox3.Location = New System.Drawing.Point(223, 78)
995
-        Me.TextBox3.Name = "TextBox3"
996
-        Me.TextBox3.Size = New System.Drawing.Size(100, 23)
997
-        Me.TextBox3.TabIndex = 2065
998
-        '
999
-        'TextBox2
1000
-        '
1001
-        Me.TextBox2.Location = New System.Drawing.Point(223, 54)
1002
-        Me.TextBox2.Name = "TextBox2"
1003
-        Me.TextBox2.Size = New System.Drawing.Size(100, 23)
1004
-        Me.TextBox2.TabIndex = 2064
1005
-        '
1006
-        'TextBox1
1007
-        '
1008
-        Me.TextBox1.Location = New System.Drawing.Point(223, 28)
1009
-        Me.TextBox1.Name = "TextBox1"
1010
-        Me.TextBox1.Size = New System.Drawing.Size(100, 23)
1011
-        Me.TextBox1.TabIndex = 2063
1045
+        'PictureBox3
1046
+        '
1047
+        Me.PictureBox3.BackgroundImage = Global.OW_ERP_SYS.My.Resources.Resources.Open_file_01
1048
+        Me.PictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
1049
+        Me.PictureBox3.Location = New System.Drawing.Point(304, 3)
1050
+        Me.PictureBox3.Name = "PictureBox3"
1051
+        Me.PictureBox3.Size = New System.Drawing.Size(22, 22)
1052
+        Me.PictureBox3.TabIndex = 2084
1053
+        Me.PictureBox3.TabStop = False
1054
+        '
1055
+        'PictureBox1
1056
+        '
1057
+        Me.PictureBox1.BackgroundImage = Global.OW_ERP_SYS.My.Resources.Resources.Excel
1058
+        Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
1059
+        Me.PictureBox1.Location = New System.Drawing.Point(429, 3)
1060
+        Me.PictureBox1.Name = "PictureBox1"
1061
+        Me.PictureBox1.Size = New System.Drawing.Size(22, 22)
1062
+        Me.PictureBox1.TabIndex = 2070
1063
+        Me.PictureBox1.TabStop = False
1064
+        '
1065
+        '檢視油脂列表_bt
1066
+        '
1067
+        Me.檢視油脂列表_bt.Location = New System.Drawing.Point(299, 0)
1068
+        Me.檢視油脂列表_bt.Name = "檢視油脂列表_bt"
1069
+        Me.檢視油脂列表_bt.Size = New System.Drawing.Size(125, 28)
1070
+        Me.檢視油脂列表_bt.TabIndex = 2071
1071
+        Me.檢視油脂列表_bt.Text = "檢 視 油 脂 列 表"
1072
+        Me.檢視油脂列表_bt.TextAlign = System.Drawing.ContentAlignment.MiddleRight
1073
+        Me.檢視油脂列表_bt.UseVisualStyleBackColor = True
1074
+        '
1075
+        'Panel5
1076
+        '
1077
+        Me.Panel5.Controls.Add(Me.讀取組別_tb)
1078
+        Me.Panel5.Controls.Add(Me.讀取標章_tb)
1079
+        Me.Panel5.Controls.Add(Me.讀取產量_tb)
1080
+        Me.Panel5.Controls.Add(Me.讀取代工_tb)
1081
+        Me.Panel5.Controls.Add(Me.讀取版本_tb)
1082
+        Me.Panel5.Controls.Add(Me.讀取檔名_tb)
1083
+        Me.Panel5.Controls.Add(Me.讀取季節_tb)
1084
+        Me.Panel5.Controls.Add(Me.讀取品名_tb)
1085
+        Me.Panel5.Controls.Add(Me.讀取料號_tb)
1086
+        Me.Panel5.Controls.Add(Me.讀取油種_tb)
1087
+        Me.Panel5.Controls.Add(Me.讀取日期_tb)
1088
+        Me.Panel5.Location = New System.Drawing.Point(561, 50)
1089
+        Me.Panel5.Name = "Panel5"
1090
+        Me.Panel5.Size = New System.Drawing.Size(332, 131)
1091
+        Me.Panel5.TabIndex = 2069
1092
+        '
1093
+        '讀取組別_tb
1094
+        '
1095
+        Me.讀取組別_tb.Location = New System.Drawing.Point(218, 65)
1096
+        Me.讀取組別_tb.Name = "讀取組別_tb"
1097
+        Me.讀取組別_tb.Size = New System.Drawing.Size(100, 23)
1098
+        Me.讀取組別_tb.TabIndex = 2073
1099
+        '
1100
+        '讀取標章_tb
1101
+        '
1102
+        Me.讀取標章_tb.Location = New System.Drawing.Point(218, 36)
1103
+        Me.讀取標章_tb.Name = "讀取標章_tb"
1104
+        Me.讀取標章_tb.Size = New System.Drawing.Size(100, 23)
1105
+        Me.讀取標章_tb.TabIndex = 2072
1106
+        '
1107
+        '讀取產量_tb
1108
+        '
1109
+        Me.讀取產量_tb.Location = New System.Drawing.Point(218, 7)
1110
+        Me.讀取產量_tb.Name = "讀取產量_tb"
1111
+        Me.讀取產量_tb.Size = New System.Drawing.Size(100, 23)
1112
+        Me.讀取產量_tb.TabIndex = 2071
1113
+        '
1114
+        '讀取代工_tb
1115
+        '
1116
+        Me.讀取代工_tb.Location = New System.Drawing.Point(112, 94)
1117
+        Me.讀取代工_tb.Name = "讀取代工_tb"
1118
+        Me.讀取代工_tb.Size = New System.Drawing.Size(100, 23)
1119
+        Me.讀取代工_tb.TabIndex = 2070
1120
+        '
1121
+        '讀取版本_tb
1122
+        '
1123
+        Me.讀取版本_tb.Location = New System.Drawing.Point(112, 65)
1124
+        Me.讀取版本_tb.Name = "讀取版本_tb"
1125
+        Me.讀取版本_tb.Size = New System.Drawing.Size(100, 23)
1126
+        Me.讀取版本_tb.TabIndex = 2069
1127
+        '
1128
+        '讀取季節_tb
1129
+        '
1130
+        Me.讀取季節_tb.Location = New System.Drawing.Point(112, 36)
1131
+        Me.讀取季節_tb.Name = "讀取季節_tb"
1132
+        Me.讀取季節_tb.Size = New System.Drawing.Size(100, 23)
1133
+        Me.讀取季節_tb.TabIndex = 2068
1134
+        '
1135
+        '讀取油種_tb
1136
+        '
1137
+        Me.讀取油種_tb.Location = New System.Drawing.Point(112, 7)
1138
+        Me.讀取油種_tb.Name = "讀取油種_tb"
1139
+        Me.讀取油種_tb.Size = New System.Drawing.Size(100, 23)
1140
+        Me.讀取油種_tb.TabIndex = 2067
1012 1141
         '
1013 1142
         '隱藏_pl2
1014 1143
         '
@@ -2524,7 +2653,6 @@ Partial Class 製程配方表
2524 2653
         Me.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
2525 2654
         Me.Panel2.Controls.Add(Me.規格_pl)
2526 2655
         Me.Panel2.Controls.Add(Me.Panel1)
2527
-        Me.Panel2.Controls.Add(Me.配方選擇_pl)
2528 2656
         Me.Panel2.Location = New System.Drawing.Point(1, 54)
2529 2657
         Me.Panel2.Name = "Panel2"
2530 2658
         Me.Panel2.Size = New System.Drawing.Size(1339, 634)
@@ -2550,7 +2678,7 @@ Partial Class 製程配方表
2550 2678
         Me.配方選擇_pl.Controls.Add(Me.配方分類_dgv)
2551 2679
         Me.配方選擇_pl.Controls.Add(Me.配方控制表_dgv)
2552 2680
         Me.配方選擇_pl.Cursor = System.Windows.Forms.Cursors.Hand
2553
-        Me.配方選擇_pl.Location = New System.Drawing.Point(1, 0)
2681
+        Me.配方選擇_pl.Location = New System.Drawing.Point(3, 54)
2554 2682
         Me.配方選擇_pl.Name = "配方選擇_pl"
2555 2683
         Me.配方選擇_pl.Size = New System.Drawing.Size(874, 547)
2556 2684
         Me.配方選擇_pl.TabIndex = 2015
@@ -2648,6 +2776,8 @@ Partial Class 製程配方表
2648 2776
         'Search_編號_cb
2649 2777
         '
2650 2778
         Me.Search_編號_cb.AutoSize = True
2779
+        Me.Search_編號_cb.Checked = True
2780
+        Me.Search_編號_cb.CheckState = System.Windows.Forms.CheckState.Checked
2651 2781
         Me.Search_編號_cb.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
2652 2782
         Me.Search_編號_cb.Location = New System.Drawing.Point(575, 3)
2653 2783
         Me.Search_編號_cb.Margin = New System.Windows.Forms.Padding(2)
@@ -2660,8 +2790,6 @@ Partial Class 製程配方表
2660 2790
         'Search_名稱_cb
2661 2791
         '
2662 2792
         Me.Search_名稱_cb.AutoSize = True
2663
-        Me.Search_名稱_cb.Checked = True
2664
-        Me.Search_名稱_cb.CheckState = System.Windows.Forms.CheckState.Checked
2665 2793
         Me.Search_名稱_cb.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
2666 2794
         Me.Search_名稱_cb.Location = New System.Drawing.Point(629, 3)
2667 2795
         Me.Search_名稱_cb.Margin = New System.Windows.Forms.Padding(2)
@@ -2810,6 +2938,161 @@ Partial Class 製程配方表
2810 2938
         Me.暫存簽名檔圖片_pb.TabIndex = 1393
2811 2939
         Me.暫存簽名檔圖片_pb.TabStop = False
2812 2940
         '
2941
+        'Panel6
2942
+        '
2943
+        Me.Panel6.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
2944
+            Or System.Windows.Forms.AnchorStyles.Left) _
2945
+            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
2946
+        Me.Panel6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
2947
+        Me.Panel6.Controls.Add(Me.PictureBox2)
2948
+        Me.Panel6.Controls.Add(Me.Search_列表編號_cb)
2949
+        Me.Panel6.Controls.Add(Me.Search_列表名稱_cb)
2950
+        Me.Panel6.Controls.Add(Me.關鍵字1_tb)
2951
+        Me.Panel6.Controls.Add(Me.列表關鍵字_bt)
2952
+        Me.Panel6.Controls.Add(Me.關鍵字1_lb)
2953
+        Me.Panel6.Controls.Add(Me.列表儲存_bt)
2954
+        Me.Panel6.Controls.Add(Me.配方列表_dgv)
2955
+        Me.Panel6.Controls.Add(Me.油脂種類1_cb)
2956
+        Me.Panel6.Controls.Add(Me.Label2)
2957
+        Me.Panel6.Controls.Add(Me.關閉列表_bt)
2958
+        Me.Panel6.Location = New System.Drawing.Point(1, 0)
2959
+        Me.Panel6.Name = "Panel6"
2960
+        Me.Panel6.Size = New System.Drawing.Size(1339, 687)
2961
+        Me.Panel6.TabIndex = 2072
2962
+        '
2963
+        'PictureBox2
2964
+        '
2965
+        Me.PictureBox2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
2966
+        Me.PictureBox2.BackgroundImage = Global.OW_ERP_SYS.My.Resources.Resources.Save_Win11
2967
+        Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
2968
+        Me.PictureBox2.Location = New System.Drawing.Point(1216, 4)
2969
+        Me.PictureBox2.Name = "PictureBox2"
2970
+        Me.PictureBox2.Size = New System.Drawing.Size(24, 24)
2971
+        Me.PictureBox2.TabIndex = 2083
2972
+        Me.PictureBox2.TabStop = False
2973
+        '
2974
+        'Search_列表編號_cb
2975
+        '
2976
+        Me.Search_列表編號_cb.AutoSize = True
2977
+        Me.Search_列表編號_cb.Checked = True
2978
+        Me.Search_列表編號_cb.CheckState = System.Windows.Forms.CheckState.Checked
2979
+        Me.Search_列表編號_cb.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
2980
+        Me.Search_列表編號_cb.Location = New System.Drawing.Point(704, 6)
2981
+        Me.Search_列表編號_cb.Margin = New System.Windows.Forms.Padding(2)
2982
+        Me.Search_列表編號_cb.Name = "Search_列表編號_cb"
2983
+        Me.Search_列表編號_cb.Size = New System.Drawing.Size(58, 23)
2984
+        Me.Search_列表編號_cb.TabIndex = 2082
2985
+        Me.Search_列表編號_cb.Text = "編號"
2986
+        Me.Search_列表編號_cb.UseVisualStyleBackColor = True
2987
+        '
2988
+        'Search_列表名稱_cb
2989
+        '
2990
+        Me.Search_列表名稱_cb.AutoSize = True
2991
+        Me.Search_列表名稱_cb.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
2992
+        Me.Search_列表名稱_cb.Location = New System.Drawing.Point(766, 6)
2993
+        Me.Search_列表名稱_cb.Margin = New System.Windows.Forms.Padding(2)
2994
+        Me.Search_列表名稱_cb.Name = "Search_列表名稱_cb"
2995
+        Me.Search_列表名稱_cb.Size = New System.Drawing.Size(58, 23)
2996
+        Me.Search_列表名稱_cb.TabIndex = 2081
2997
+        Me.Search_列表名稱_cb.Text = "名稱"
2998
+        Me.Search_列表名稱_cb.UseVisualStyleBackColor = True
2999
+        '
3000
+        '關鍵字1_tb
3001
+        '
3002
+        Me.關鍵字1_tb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
3003
+        Me.關鍵字1_tb.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3004
+        Me.關鍵字1_tb.Location = New System.Drawing.Point(341, 3)
3005
+        Me.關鍵字1_tb.Name = "關鍵字1_tb"
3006
+        Me.關鍵字1_tb.Size = New System.Drawing.Size(321, 27)
3007
+        Me.關鍵字1_tb.TabIndex = 2078
3008
+        '
3009
+        '列表關鍵字_bt
3010
+        '
3011
+        Me.列表關鍵字_bt.BackgroundImage = Global.OW_ERP_SYS.My.Resources.Resources.Search_01
3012
+        Me.列表關鍵字_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
3013
+        Me.列表關鍵字_bt.Location = New System.Drawing.Point(665, 2)
3014
+        Me.列表關鍵字_bt.Name = "列表關鍵字_bt"
3015
+        Me.列表關鍵字_bt.Size = New System.Drawing.Size(28, 28)
3016
+        Me.列表關鍵字_bt.TabIndex = 2080
3017
+        Me.列表關鍵字_bt.UseVisualStyleBackColor = True
3018
+        '
3019
+        '關鍵字1_lb
3020
+        '
3021
+        Me.關鍵字1_lb.AutoSize = True
3022
+        Me.關鍵字1_lb.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3023
+        Me.關鍵字1_lb.Location = New System.Drawing.Point(277, 7)
3024
+        Me.關鍵字1_lb.Name = "關鍵字1_lb"
3025
+        Me.關鍵字1_lb.Size = New System.Drawing.Size(62, 19)
3026
+        Me.關鍵字1_lb.TabIndex = 2079
3027
+        Me.關鍵字1_lb.Text = "關 鍵 字"
3028
+        '
3029
+        '列表儲存_bt
3030
+        '
3031
+        Me.列表儲存_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
3032
+        Me.列表儲存_bt.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3033
+        Me.列表儲存_bt.Location = New System.Drawing.Point(1211, 1)
3034
+        Me.列表儲存_bt.Name = "列表儲存_bt"
3035
+        Me.列表儲存_bt.Size = New System.Drawing.Size(93, 30)
3036
+        Me.列表儲存_bt.TabIndex = 2077
3037
+        Me.列表儲存_bt.Text = "儲  存   "
3038
+        Me.列表儲存_bt.TextAlign = System.Drawing.ContentAlignment.MiddleRight
3039
+        Me.列表儲存_bt.UseVisualStyleBackColor = True
3040
+        '
3041
+        '配方列表_dgv
3042
+        '
3043
+        DataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
3044
+        Me.配方列表_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle20
3045
+        Me.配方列表_dgv.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
3046
+            Or System.Windows.Forms.AnchorStyles.Left) _
3047
+            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
3048
+        Me.配方列表_dgv.BackgroundColor = System.Drawing.Color.White
3049
+        Me.配方列表_dgv.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
3050
+        DataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
3051
+        DataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Window
3052
+        DataGridViewCellStyle21.Font = New System.Drawing.Font("微軟正黑體", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3053
+        DataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.ControlText
3054
+        DataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight
3055
+        DataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText
3056
+        DataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
3057
+        Me.配方列表_dgv.DefaultCellStyle = DataGridViewCellStyle21
3058
+        Me.配方列表_dgv.Location = New System.Drawing.Point(3, 32)
3059
+        Me.配方列表_dgv.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
3060
+        Me.配方列表_dgv.Name = "配方列表_dgv"
3061
+        Me.配方列表_dgv.RowHeadersWidth = 5
3062
+        Me.配方列表_dgv.RowTemplate.Height = 24
3063
+        Me.配方列表_dgv.Size = New System.Drawing.Size(1331, 647)
3064
+        Me.配方列表_dgv.TabIndex = 2075
3065
+        '
3066
+        '油脂種類1_cb
3067
+        '
3068
+        Me.油脂種類1_cb.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3069
+        Me.油脂種類1_cb.FormattingEnabled = True
3070
+        Me.油脂種類1_cb.Location = New System.Drawing.Point(72, 3)
3071
+        Me.油脂種類1_cb.Name = "油脂種類1_cb"
3072
+        Me.油脂種類1_cb.Size = New System.Drawing.Size(193, 27)
3073
+        Me.油脂種類1_cb.TabIndex = 2074
3074
+        '
3075
+        'Label2
3076
+        '
3077
+        Me.Label2.AutoSize = True
3078
+        Me.Label2.Font = New System.Drawing.Font("微軟正黑體", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
3079
+        Me.Label2.Location = New System.Drawing.Point(4, 7)
3080
+        Me.Label2.Name = "Label2"
3081
+        Me.Label2.Size = New System.Drawing.Size(76, 19)
3082
+        Me.Label2.TabIndex = 2073
3083
+        Me.Label2.Text = "油脂種類 :"
3084
+        '
3085
+        '關閉列表_bt
3086
+        '
3087
+        Me.關閉列表_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
3088
+        Me.關閉列表_bt.BackgroundImage = Global.OW_ERP_SYS.My.Resources.Resources.Cancel_01
3089
+        Me.關閉列表_bt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
3090
+        Me.關閉列表_bt.Location = New System.Drawing.Point(1305, 1)
3091
+        Me.關閉列表_bt.Name = "關閉列表_bt"
3092
+        Me.關閉列表_bt.Size = New System.Drawing.Size(30, 30)
3093
+        Me.關閉列表_bt.TabIndex = 2072
3094
+        Me.關閉列表_bt.UseVisualStyleBackColor = True
3095
+        '
2813 3096
         '製程配方表
2814 3097
         '
2815 3098
         Me.AutoScaleDimensions = New System.Drawing.SizeF(10.0!, 20.0!)
@@ -2818,6 +3101,8 @@ Partial Class 製程配方表
2818 3101
         Me.Controls.Add(Me.最高權限_pl)
2819 3102
         Me.Controls.Add(Me.Panel3)
2820 3103
         Me.Controls.Add(Me.Panel2)
3104
+        Me.Controls.Add(Me.Panel6)
3105
+        Me.Controls.Add(Me.配方選擇_pl)
2821 3106
         Me.Font = New System.Drawing.Font("微軟正黑體", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
2822 3107
         Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
2823 3108
         Me.MaximizeBox = False
@@ -2838,6 +3123,10 @@ Partial Class 製程配方表
2838 3123
         Me.隱藏_pl1.PerformLayout()
2839 3124
         Me.Panel1.ResumeLayout(False)
2840 3125
         Me.Panel1.PerformLayout()
3126
+        CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit()
3127
+        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
3128
+        Me.Panel5.ResumeLayout(False)
3129
+        Me.Panel5.PerformLayout()
2841 3130
         Me.隱藏_pl2.ResumeLayout(False)
2842 3131
         Me.隱藏_pl2.PerformLayout()
2843 3132
         CType(Me.組別_dgv, System.ComponentModel.ISupportInitialize).EndInit()
@@ -2876,6 +3165,10 @@ Partial Class 製程配方表
2876 3165
         Me.最高權限_pl.PerformLayout()
2877 3166
         CType(Me.簽名檔_dgv, System.ComponentModel.ISupportInitialize).EndInit()
2878 3167
         CType(Me.暫存簽名檔圖片_pb, System.ComponentModel.ISupportInitialize).EndInit()
3168
+        Me.Panel6.ResumeLayout(False)
3169
+        Me.Panel6.PerformLayout()
3170
+        CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
3171
+        CType(Me.配方列表_dgv, System.ComponentModel.ISupportInitialize).EndInit()
2879 3172
         Me.ResumeLayout(False)
2880 3173
 
2881 3174
     End Sub
@@ -3084,9 +3377,32 @@ Partial Class 製程配方表
3084 3377
     Friend WithEvents 中間距_ch As CheckBox
3085 3378
     Friend WithEvents 大間距_ch As CheckBox
3086 3379
     Friend WithEvents Search_全油種_cb As CheckBox
3087
-    Friend WithEvents TextBox4 As TextBox
3088
-    Friend WithEvents TextBox3 As TextBox
3089
-    Friend WithEvents TextBox2 As TextBox
3090
-    Friend WithEvents TextBox1 As TextBox
3091
-    Friend WithEvents Button1 As Button
3380
+    Friend WithEvents 讀取日期_tb As TextBox
3381
+    Friend WithEvents 讀取料號_tb As TextBox
3382
+    Friend WithEvents 讀取品名_tb As TextBox
3383
+    Friend WithEvents 讀取檔名_tb As TextBox
3384
+    Friend WithEvents 匯入Excel_bt As Button
3385
+    Friend WithEvents 讀取季節_tb As TextBox
3386
+    Friend WithEvents 讀取油種_tb As TextBox
3387
+    Friend WithEvents Panel5 As Panel
3388
+    Friend WithEvents 讀取代工_tb As TextBox
3389
+    Friend WithEvents 讀取版本_tb As TextBox
3390
+    Friend WithEvents 讀取標章_tb As TextBox
3391
+    Friend WithEvents 讀取產量_tb As TextBox
3392
+    Friend WithEvents 讀取組別_tb As TextBox
3393
+    Friend WithEvents PictureBox1 As PictureBox
3394
+    Friend WithEvents 檢視油脂列表_bt As Button
3395
+    Friend WithEvents Panel6 As Panel
3396
+    Friend WithEvents 關閉列表_bt As Button
3397
+    Friend WithEvents 配方列表_dgv As DataGridView
3398
+    Friend WithEvents 油脂種類1_cb As ComboBox
3399
+    Friend WithEvents Label2 As Label
3400
+    Friend WithEvents 列表儲存_bt As Button
3401
+    Friend WithEvents PictureBox2 As PictureBox
3402
+    Friend WithEvents Search_列表編號_cb As CheckBox
3403
+    Friend WithEvents Search_列表名稱_cb As CheckBox
3404
+    Friend WithEvents 關鍵字1_tb As TextBox
3405
+    Friend WithEvents 列表關鍵字_bt As Button
3406
+    Friend WithEvents 關鍵字1_lb As Label
3407
+    Friend WithEvents PictureBox3 As PictureBox
3092 3408
 End Class

+ 453
- 46
OW-ERP-SYS/05、技術管理系統/製程配方表.vb Dosyayı Görüntüle

@@ -2,7 +2,8 @@
2 2
 Imports System.Globalization
3 3
 Imports System.IO
4 4
 Imports System.Runtime.InteropServices
5
-'Imports Microsoft.Office.Interop.Excel
5
+Imports System.Text.RegularExpressions
6
+Imports System.ComponentModel
6 7
 
7 8
 Public Class 製程配方表
8 9
     Dim 加入原料按鈕, 原料選項_pl顯示, 加入規格按鈕, 規格選項_pl顯示, 修改狀態, 刪除原料種類, 刪除規格種類, 搜尋暫存_油脂種類 As String
@@ -12,6 +13,7 @@ Public Class 製程配方表
12 13
     Dim 重合計 As Decimal
13 14
     Private isProgrammaticChange As Boolean = False
14 15
     Private Button_light As Boolean = False
16
+    Private Const MaxColumnWidth As Integer = 1500 ' 定義最大列寬
15 17
     Private Sub Set_配方控制表_油脂種類_讀取()
16 18
         Dim ds1 As New DataSet : 配方分類_dgv.DataSource = Nothing : ds1.Clear()
17 19
         配方分類_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -37,6 +39,25 @@ Public Class 製程配方表
37 39
         配方控制表_dgv.Columns(10).FillWeight = 20 : 配方控制表_dgv.Columns(17).FillWeight = 20
38 40
         For i As Integer = 0 To 配方控制表_dgv.Rows.Count - 1 : 配方控制表_dgv.Rows(i).Cells("項次").Value = i + 1 : Next
39 41
     End Sub
42
+    Private Sub Set_製程配方控制表_完整顯示(油脂種類 As String)
43
+        Dim ds1 As New DataSet : 配方列表_dgv.DataSource = Nothing : ds1.Clear()
44
+        SetDGV樣式值(配方列表_dgv)
45
+        SQL_配方控制表_讀取_列表用(油脂種類)
46
+        da.Fill(ds1) : 配方列表_dgv.DataSource = ds1.Tables(0) : conn.Close()
47
+        ' 隱藏指定範圍的列
48
+        For i As Integer = 0 To 24
49
+            If i = 0 Or i = 10 Then ' 保留第 N 列
50
+                配方列表_dgv.Columns(i).Visible = False
51
+            End If
52
+        Next
53
+        配方列表_dgv.Columns(0).ReadOnly = True : 配方列表_dgv.Columns(1).ReadOnly = True : 配方列表_dgv.Columns(2).ReadOnly = True
54
+        配方列表_dgv.Columns(3).ReadOnly = True : 配方列表_dgv.Columns(4).ReadOnly = True
55
+
56
+        ' 凍結前五列
57
+        配方列表_dgv.Columns(4).Frozen = True
58
+        ConfigureDataGridView()
59
+
60
+    End Sub
40 61
     Public Sub Set_搜尋配方清單()
41 62
         Dim ds1 As New DataSet : 配方控制表_dgv.DataSource = Nothing : ds1.Clear()
42 63
         SetDGV樣式值(配方控制表_dgv)
@@ -67,6 +88,31 @@ Public Class 製程配方表
67 88
         配方控制表_dgv.Columns(10).FillWeight = 20 : 配方控制表_dgv.Columns(18).FillWeight = 20
68 89
         For i As Integer = 0 To 配方控制表_dgv.Rows.Count - 1 : 配方控制表_dgv.Rows(i).Cells("項次").Value = i + 1 : Next
69 90
     End Sub
91
+    Public Sub Set_搜尋配方列表清單()
92
+        Dim ds1 As New DataSet : 配方列表_dgv.DataSource = Nothing : ds1.Clear()
93
+        SetDGV樣式值(配方列表_dgv)
94
+        Dim Search_select As String = String.Empty
95
+        Dim keyword As String = 關鍵字1_tb.Text
96
+        If Search_列表名稱_cb.Checked Then : Search_select = "產品名稱"
97
+        ElseIf Search_列表編號_cb.Checked Then : Search_select = "舊編號"
98
+        End If
99
+        If Not String.IsNullOrEmpty(Search_select) Then
100
+            SQL_搜尋配方控制表_讀取_列表用(keyword, Search_select)
101
+        End If
102
+        da.Fill(ds1) : 配方列表_dgv.DataSource = ds1.Tables(0) : conn.Close()
103
+        ' 隱藏指定範圍的列
104
+        For i As Integer = 0 To 24
105
+            If i = 0 Or i = 10 Then ' 保留第 N 列
106
+                配方列表_dgv.Columns(i).Visible = False
107
+            End If
108
+        Next
109
+        配方列表_dgv.Columns(0).ReadOnly = True : 配方列表_dgv.Columns(1).ReadOnly = True : 配方列表_dgv.Columns(2).ReadOnly = True
110
+        配方列表_dgv.Columns(3).ReadOnly = True : 配方列表_dgv.Columns(4).ReadOnly = True
111
+
112
+        ' 凍結前五列
113
+        配方列表_dgv.Columns(4).Frozen = True
114
+        ConfigureDataGridView()
115
+    End Sub
70 116
     Private Sub Set_配方明細表原料油_讀取(配方編號 As String)
71 117
         Dim ds2 As New DataSet : 配方原料油_dgv.DataSource = Nothing : ds2.Clear()
72 118
         配方原料油_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -257,7 +303,8 @@ Public Class 製程配方表
257 303
         配方產品規格_dgv.EditMode = DataGridViewEditMode.EditOnEnter
258 304
 
259 305
 
260
-        介面 = "H201" : 表頭(16) = "單位" : 登入使用者_tb.Text = gUserName : 隱藏_pl1.SendToBack() : 隱藏_pl2.SendToBack() : 加入規格內容_pl.SendToBack()
306
+        介面 = "H201" : 表頭(16) = "單位" : 登入使用者_tb.Text = gUserName
307
+        隱藏_pl1.SendToBack() : 隱藏_pl2.SendToBack() : 加入規格內容_pl.SendToBack() : Panel5.SendToBack() : Panel6.SendToBack()
261 308
         配方選擇_pl.Visible = False : 配方原料選項_pl.Visible = False : 配方規格選項_pl.Visible = False
262 309
         最高權限_pl.Height = 73 : 最高權限_pl.Width = 159
263 310
         If 登入人級別 = "00" Then : 最高權限_pl.Visible = True
@@ -269,16 +316,11 @@ Public Class 製程配方表
269 316
             End If
270 317
         End If
271 318
 
272
-        新增配方_bt.Enabled = True : 修改_bt.Enabled = True : 儲存_bt.Enabled = False : 刪除配方_bt.Enabled = True : 另存新檔_bt.Enabled = True
319
+        新增配方_bt.Enabled = True : 修改_bt.Enabled = True : 儲存_bt.Enabled = True : 刪除配方_bt.Enabled = True : 另存新檔_bt.Enabled = True
273 320
         加入原料油_bt.Enabled = False : 加入乳化劑_bt.Enabled = False : 加入香料_bt.Enabled = False : 加入其他_bt.Enabled = False : 加入著色劑_bt.Enabled = False
274 321
         加入原料油脂規格_bt.Enabled = False : 加入產品規格_bt.Enabled = False
275 322
         修改狀態 = ""
276
-        產品名稱_tb.ReadOnly = True : 產品名稱_tb.BackColor = SystemColors.Window : 產品流水號_tb.ReadOnly = True : 產品流水號_tb.BackColor = SystemColors.Window
277
-        產品編號_tb.ReadOnly = True : 產品編號_tb.BackColor = SystemColors.Window
278
-        備註_tb.ReadOnly = True : 備註_tb.BackColor = SystemColors.Window : 油脂種類_cb.Enabled = False : 油脂種類_cb.BackColor = SystemColors.Window
279
-        季節_cb.Enabled = True : 季節_cb.BackColor = SystemColors.Window : 認證標章_cb.Enabled = True : 認證標章_cb.BackColor = SystemColors.Window
280
-        出貨類型_cb.Enabled = True : 出貨類型_cb.BackColor = SystemColors.Window : 生產噸數_nud.Enabled = True : 生產噸數_nud.BackColor = SystemColors.Window
281
-        版本_nud.Enabled = True : 版本_nud.BackColor = SystemColors.Window : 組別_cb.Enabled = True : 組別_cb.BackColor = SystemColors.Window
323
+        產品流水號_tb.ReadOnly = True : 產品流水號_tb.BackColor = SystemColors.Window
282 324
 
283 325
         原料油比總和_tb.ReadOnly = True : 原料油比總和_tb.BackColor = SystemColors.Window : 原料油產品和_tb.ReadOnly = True : 原料油產品和_tb.BackColor = SystemColors.Window
284 326
         原料油重總和_tb.ReadOnly = True : 原料油重總和_tb.BackColor = SystemColors.Window
@@ -287,12 +329,6 @@ Public Class 製程配方表
287 329
         其他產品和_tb.ReadOnly = True : 其他產品和_tb.BackColor = SystemColors.Window : 其他重總和_tb.ReadOnly = True : 其他重總和_tb.BackColor = SystemColors.Window
288 330
         著色劑產品和_tb.ReadOnly = True : 著色劑產品和_tb.BackColor = SystemColors.Window : 著色劑重總和_tb.ReadOnly = True : 著色劑重總和_tb.BackColor = SystemColors.Window
289 331
         合計產品比_tb.ReadOnly = True : 合計產品比_tb.BackColor = SystemColors.Window : 合計重量_tb.ReadOnly = True : 合計重量_tb.BackColor = SystemColors.Window
290
-        油比規格_tb.ReadOnly = True : 油比規格_tb.BackColor = SystemColors.Window : 熟成溫度_tb.ReadOnly = True : 熟成溫度_tb.BackColor = SystemColors.Window
291
-        熟成時間_tb.ReadOnly = True : 熟成時間_tb.BackColor = SystemColors.Window : 包材類型_tb.ReadOnly = True : 包材類型_tb.BackColor = SystemColors.Window
292
-        打包帶_tb.ReadOnly = True : 打包帶_tb.BackColor = SystemColors.Window : 淨重_tb.ReadOnly = True : 淨重_tb.BackColor = SystemColors.Window
293
-        淨重單位_cb.Enabled = False : 淨重單位_cb.BackColor = SystemColors.Window : 保存條件_tb.ReadOnly = True : 保存條件_tb.BackColor = SystemColors.Window
294
-        保存期限_tb.ReadOnly = True : 保存期限_tb.BackColor = SystemColors.Window : 有效日期_tb.ReadOnly = True : 有效日期_tb.BackColor = SystemColors.Window
295
-        過敏原_tb.ReadOnly = True : 過敏原_tb.BackColor = SystemColors.Window
296 332
 
297 333
         配方原料油_dgv.ReadOnly = True : 配方乳化劑_dgv.ReadOnly = True : 配方香料_dgv.ReadOnly = True : 配方其他_dgv.ReadOnly = True : 配方著色劑_dgv.ReadOnly = True
298 334
         配方油脂規格_dgv.ReadOnly = True : 配方產品規格_dgv.ReadOnly = True
@@ -311,6 +347,17 @@ Public Class 製程配方表
311 347
 
312 348
         '為每個項目添加事件處理程序
313 349
         AddHandler txtKeyword_tb.KeyDown, AddressOf txtKeyword_tb_KeyDown
350
+        AddHandler 關鍵字1_tb.KeyDown, AddressOf 關鍵字1_tb_KeyDown
351
+
352
+    End Sub
353
+    Private Sub 關鍵字1_tb_KeyDown(sender As Object, e As KeyEventArgs)
354
+        If e.KeyCode = Keys.Enter Then
355
+            Set_搜尋配方列表清單()
356
+
357
+            ' 如果您不希望在按下Enter鍵時換行或進行其他默認操作,可以添加以下代碼:
358
+            e.Handled = True
359
+            e.SuppressKeyPress = True
360
+        End If
314 361
     End Sub
315 362
     Private Sub txtKeyword_tb_KeyDown(sender As Object, e As KeyEventArgs)
316 363
         If e.KeyCode = Keys.Enter Then
@@ -1316,14 +1363,24 @@ Public Class 製程配方表
1316 1363
     End Sub
1317 1364
     Private Sub CheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles Search_名稱_cb.CheckedChanged, Search_編號_cb.CheckedChanged,
1318 1365
                                                                                   Search_標章_cb.CheckedChanged, Search_代工_cb.CheckedChanged
1319
-
1320 1366
         Dim 選中Ch_Box As Windows.Forms.CheckBox = DirectCast(sender, Windows.Forms.CheckBox)
1321
-
1322 1367
         If 選中Ch_Box.Checked Then
1323 1368
             Dim 其餘Ch_Box As New List(Of Windows.Forms.CheckBox) From {
1324 1369
                 Search_名稱_cb, Search_編號_cb, Search_標章_cb, Search_代工_cb
1325 1370
             }
1326
-
1371
+            For Each 其餘中的任一Ch_Box In 其餘Ch_Box
1372
+                If 其餘中的任一Ch_Box IsNot 選中Ch_Box Then
1373
+                    其餘中的任一Ch_Box.Checked = False
1374
+                End If
1375
+            Next
1376
+        End If
1377
+    End Sub
1378
+    Private Sub 列表CB_CheckedChanged(sender As Object, e As EventArgs) Handles Search_列表名稱_cb.CheckedChanged, Search_列表編號_cb.CheckedChanged
1379
+        Dim 選中Ch_Box As Windows.Forms.CheckBox = DirectCast(sender, Windows.Forms.CheckBox)
1380
+        If 選中Ch_Box.Checked Then
1381
+            Dim 其餘Ch_Box As New List(Of Windows.Forms.CheckBox) From {
1382
+                Search_列表名稱_cb, Search_列表編號_cb
1383
+            }
1327 1384
             For Each 其餘中的任一Ch_Box In 其餘Ch_Box
1328 1385
                 If 其餘中的任一Ch_Box IsNot 選中Ch_Box Then
1329 1386
                     其餘中的任一Ch_Box.Checked = False
@@ -1607,12 +1664,67 @@ Public Class 製程配方表
1607 1664
     Private Sub 表單簽名_bt_MouseEnter(sender As Object, e As EventArgs) Handles 表單簽名_bt.MouseEnter
1608 1665
         ToolTip1.SetToolTip(Me.表單簽名_bt, "配方表單簽名審核")
1609 1666
     End Sub
1667
+    Private Sub 檢視油脂列表_bt_Click(sender As Object, e As EventArgs) Handles 檢視油脂列表_bt.Click
1668
+        Panel6.BringToFront()
1669
+        油脂種類1_cb.Items.Clear() ' 清空 ComboBox2 的項目
1670
+        For Each item In 油脂種類_cb.Items
1671
+            油脂種類1_cb.Items.Add(item)
1672
+        Next
1673
+    End Sub
1674
+    Private Sub 關閉列表_bt_Click(sender As Object, e As EventArgs) Handles 關閉列表_bt.Click
1675
+        Panel6.SendToBack()
1676
+    End Sub
1677
+    Private Sub 油脂種類1_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 油脂種類1_cb.SelectedIndexChanged
1678
+        Set_製程配方控制表_完整顯示(油脂種類1_cb.Text)
1679
+    End Sub
1680
+    Private Sub 列表關鍵字_bt_Click(sender As Object, e As EventArgs) Handles 列表關鍵字_bt.Click
1681
+        Set_搜尋配方列表清單()
1682
+    End Sub
1610 1683
 
1611
-    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
1612
-        ReadExcelToTextBoxes()
1684
+    Private Sub 列表儲存_bt_Click(sender As Object, e As EventArgs) Handles 列表儲存_bt.Click
1685
+        MGB("確 定 要 儲 存 資 料 嗎?", 2) ' 確認刪除操作
1686
+        If 訊息回應 <> "YES" Then Exit Sub
1687
+
1688
+        For i As Integer = 0 To 配方列表_dgv.Rows.Count - 1
1689
+            Dim 配方編號 As String = 配方列表_dgv.Rows(i).Cells("配方編號").Value.ToString
1690
+            Dim 產品編號 As String = 配方列表_dgv.Rows(i).Cells("產品編號").Value.ToString
1691
+            Dim 產品名稱 As String = 配方列表_dgv.Rows(i).Cells("產品名稱").Value.ToString
1692
+            Dim 季節 As String = 配方列表_dgv.Rows(i).Cells("季節").Value.ToString
1693
+            Dim 版本 As String = 配方列表_dgv.Rows(i).Cells("版本").Value.ToString
1694
+            Dim 制定日期 As String = 配方列表_dgv.Rows(i).Cells("制定日期").Value.ToString
1695
+            Dim 生產噸數 As String = 配方列表_dgv.Rows(i).Cells("生產噸數").Value.ToString
1696
+            Dim 認證標章 As String = 配方列表_dgv.Rows(i).Cells("認證標章").Value.ToString
1697
+            Dim 代工 As Boolean = 配方列表_dgv.Rows(i).Cells("代工").Value
1698
+            Dim 出貨類型 As String = 配方列表_dgv.Rows(i).Cells("出貨類型").Value.ToString
1699
+            Dim 物料料號 As String = 配方列表_dgv.Rows(i).Cells("物料料號").Value.ToString
1700
+            Dim 停用 As Boolean = 配方列表_dgv.Rows(i).Cells("停用").Value
1701
+            Dim 油脂比例規格 As String = 配方列表_dgv.Rows(i).Cells("油脂比例規格").Value.ToString
1702
+            Dim 熟成溫度 As String = 配方列表_dgv.Rows(i).Cells("熟成溫度").Value.ToString
1703
+            Dim 熟成時間 As String = 配方列表_dgv.Rows(i).Cells("熟成時間").Value.ToString
1704
+            Dim 包材類型 As String = 配方列表_dgv.Rows(i).Cells("包材類型").Value.ToString
1705
+            Dim 打包帶 As String = 配方列表_dgv.Rows(i).Cells("打包帶").Value.ToString
1706
+            Dim 淨重 As String = 配方列表_dgv.Rows(i).Cells("淨重").Value.ToString
1707
+            Dim 淨重單位 As String = 配方列表_dgv.Rows(i).Cells("淨重單位").Value.ToString
1708
+            Dim 保存條件 As String = 配方列表_dgv.Rows(i).Cells("保存條件").Value.ToString
1709
+            Dim 保存期限 As String = 配方列表_dgv.Rows(i).Cells("保存期限").Value.ToString
1710
+            Dim 有效日期 As String = 配方列表_dgv.Rows(i).Cells("有效日期").Value.ToString
1711
+            Dim 過敏原信息 As String = 配方列表_dgv.Rows(i).Cells("過敏原信息").Value.ToString
1712
+            Dim 備註 As String = 配方列表_dgv.Rows(i).Cells("備註").Value.ToString
1713
+            Dim 組別 As String = 配方列表_dgv.Rows(i).Cells("組別").Value.ToString
1714
+
1715
+            SQL_配方控制表_列表更新(配方編號, 產品編號, 產品名稱, 季節, 版本, 生產噸數, 認證標章, 出貨類型, 代工, 物料料號, 停用,
1716
+                           制定日期, 油脂比例規格, 熟成溫度, 熟成時間, 包材類型, 打包帶, 淨重, 淨重單位, 保存條件, 保存期限, 有效日期,
1717
+                           過敏原信息, 備註, 組別)
1718
+        Next
1719
+        'Set_製程配方控制表_完整顯示(油脂種類1_cb.Text)
1720
+        MGB("儲存完畢!", 1)
1721
+    End Sub
1722
+
1723
+    Private Sub 匯入Excel_bt_Click(sender As Object, e As EventArgs) Handles 匯入Excel_bt.Click
1724
+        讀取Excel到TextBox()
1613 1725
     End Sub
1614 1726
 
1615
-    Private Sub ReadExcelToTextBoxes()
1727
+    Private Sub 讀取Excel到TextBox()
1616 1728
         Dim excelApp As Microsoft.Office.Interop.Excel.Application = Nothing
1617 1729
         Dim workbook As Microsoft.Office.Interop.Excel.Workbook = Nothing
1618 1730
         Dim worksheet As Microsoft.Office.Interop.Excel.Worksheet = Nothing
@@ -1626,48 +1738,210 @@ Public Class 製程配方表
1626 1738
             If openFileDialog.ShowDialog() = DialogResult.OK Then
1627 1739
                 Dim filePath As String = openFileDialog.FileName
1628 1740
 
1629
-                ' 讀取文件名到 TextBox1
1630
-                TextBox1.Text = IO.Path.GetFileName(filePath)
1741
+                原料油比總和_tb.Text = "" : 原料油產品和_tb.Text = "" : 原料油重總和_tb.Text = "" : 乳化劑產品和_tb.Text = "" : 乳化劑重總和_tb.Text = ""
1742
+                香料產品和_tb.Text = "" : 香料重總和_tb.Text = "" : 其他產品和_tb.Text = "" : 其他重總和_tb.Text = "" : 著色劑產品和_tb.Text = "" : 著色劑重總和_tb.Text = ""
1743
+                配方原料油_dgv.DataSource = Nothing : 配方乳化劑_dgv.DataSource = Nothing : 配方香料_dgv.DataSource = Nothing
1744
+                配方其他_dgv.DataSource = Nothing : 配方著色劑_dgv.DataSource = Nothing
1745
+                配方油脂規格_dgv.DataSource = Nothing : 配方產品規格_dgv.DataSource = Nothing
1746
+                油比規格_tb.Text = "" : 熟成溫度_tb.Text = "" : 熟成時間_tb.Text = "" : 包材類型_tb.Text = "" : 打包帶_tb.Text = "" : 淨重_tb.Text = ""
1747
+                淨重單位_cb.Text = "" : 保存條件_tb.Text = "" : 保存期限_tb.Text = "" : 有效日期_tb.Text = "" : 過敏原_tb.Text = "" : 組別_cb.Text = ""
1748
+                油脂種類_cb.Text = "" : 季節_cb.Text = "" : 認證標章_cb.Text = "" : 出貨類型_cb.Text = "" : 產品編號_tb.Text = ""
1749
+
1750
+                讀取檔名_tb.Text = "" : 讀取品名_tb.Text = "" : 讀取料號_tb.Text = "" : 讀取日期_tb.Text = ""
1751
+                讀取季節_tb.Text = "" : 讀取組別_tb.Text = "" : 讀取產量_tb.Text = "" : 讀取版本_tb.Text = ""
1752
+                讀取油種_tb.Text = "" : 讀取標章_tb.Text = "" : 讀取代工_tb.Text = ""
1753
+
1754
+                ' 讀取文件名
1755
+                讀取檔名_tb.Text = IO.Path.GetFileName(filePath)
1631 1756
 
1632 1757
                 ' 創建 Excel 應用程序實例
1633 1758
                 excelApp = New Microsoft.Office.Interop.Excel.Application()
1634 1759
                 workbook = excelApp.Workbooks.Open(filePath)
1635 1760
                 worksheet = workbook.Worksheets(1)
1636 1761
 
1637
-                ' 讀取 B2 單元格內容到 TextBox2
1638
-                TextBox2.Text = CStr(worksheet.Range("B2").Value)
1639
-
1640
-                ' 讀取 A3 單元格內容,提取料號到 TextBox3
1641
-                Dim cellA3 As String = CStr(worksheet.Range("A3").Value)
1642
-                Dim startIndex As Integer = cellA3.IndexOf("料號:") + 3
1643
-                If startIndex > 2 Then
1644
-                    Dim productNumber = cellA3.Substring(startIndex).Trim()
1645
-                    ' 移除最後的 ")"
1646
-                    If productNumber.EndsWith(")") Then
1647
-                        productNumber = productNumber.Substring(0, productNumber.Length - 1)
1648
-                    End If
1649
-                    TextBox3.Text = productNumber
1650
-                End If
1762
+                Dim startIndex As Integer
1651 1763
 
1652
-                ' 讀取 F3 單元格內容,提取日期到 TextBox4
1653
-                Dim cellF3 As String = CStr(worksheet.Range("F3").Value)
1764
+                ' 讀取 F3 單元格內容,提取日期
1765
+                Dim cellF3 As String = CStr(worksheet.Range("F5").Value)
1654 1766
                 startIndex = cellF3.IndexOf("制定日期:") + 5
1655 1767
                 If startIndex > 4 Then
1656 1768
                     Dim dateString = cellF3.Substring(startIndex).Trim()
1657 1769
                     ' 嘗試解析日期並重新格式化
1658 1770
                     Dim 提取日期 As DateTime
1659 1771
                     If DateTime.TryParseExact(dateString, "yyyy.MM.dd", CultureInfo.InvariantCulture, DateTimeStyles.None, 提取日期) Then
1660
-                        TextBox4.Text = 提取日期.ToString("yyyy/MM/dd")
1772
+                        讀取日期_tb.Text = 提取日期.ToString("yyyy/MM/dd")
1661 1773
                     Else
1662
-                        TextBox4.Text = dateString  ' 如果解析失敗,保留原始字符串
1774
+                        讀取日期_tb.Text = dateString  ' 如果解析失敗,保留原始字符串
1663 1775
                     End If
1664 1776
                 End If
1665 1777
 
1666
-                MessageBox.Show("Excel 資料已成功匯入!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information)
1778
+                Dim cellC5 As String = CStr(worksheet.Range("C5").Value)
1779
+                startIndex = cellC5.IndexOf("代工產品:") + 5
1780
+                If startIndex > 4 Then
1781
+                    Dim productNumber = cellC5.Substring(startIndex).Trim()
1782
+                    讀取代工_tb.Text = If(productNumber = "是", "1", "0")
1783
+                Else
1784
+                    讀取代工_tb.Text = ""
1785
+                End If
1786
+
1787
+                讀取品名_tb.Text = ExtractCellValue(worksheet, "A2", "品名:", 3)
1788
+                讀取料號_tb.Text = ExtractCellValue(worksheet, "A3", "料號:", 3)
1789
+                讀取季節_tb.Text = ExtractCellValue(worksheet, "A4", "季節:", 3)
1790
+                讀取版本_tb.Text = ExtractCellValue(worksheet, "A5", "版本:", 3)
1791
+                讀取油種_tb.Text = ExtractCellValue(worksheet, "C3", "油脂種類:", 5)
1792
+                讀取組別_tb.Text = ExtractCellValue(worksheet, "C4", "組別:", 3)
1793
+                讀取標章_tb.Text = ExtractCellValue(worksheet, "G3", "認證標章:", 5)
1794
+
1795
+                讀取產量_tb.Text = CStr(worksheet.Range("B6").Value)
1796
+
1797
+                ' 定義需要搜尋的關鍵字及其初始行號
1798
+                Dim keywords As New Dictionary(Of String, Integer) From {
1799
+                    {"乳化劑", -1}, {"香   料", -1}, {"其   他", -1}, {"著色劑", -1}}
1800
+                Dim 規格keywords As New Dictionary(Of String, Integer) From {
1801
+                    {"原 料 油 脂 規 格", -1}, {"產  品  規  格", -1}, {"備            註", -1}}
1802
+
1803
+                ' 儲存 "小   計" 所在的所有行號
1804
+                Dim subtotalRows As New List(Of Integer)
1805
+
1806
+                ' 搜尋 A 列中的關鍵字和 "小   計"
1807
+                Dim lastRow As Integer = worksheet.Cells(worksheet.Rows.Count, "A").End(Microsoft.Office.Interop.Excel.XlDirection.xlUp).Row
1808
+
1809
+                For i As Integer = 1 To lastRow
1810
+                    Dim cellValue As Object = worksheet.Cells(i, "A").Value
1811
+                    Dim cellValue1 As Object = worksheet.Cells(i, "F").Value
1812
+                    If cellValue IsNot Nothing Then
1813
+                        Dim cellText As String = CStr(cellValue).Trim()
1814
+
1815
+                        ' 搜尋關鍵字
1816
+                        For Each keyword In keywords.Keys.ToList()
1817
+                            If cellText.Contains(keyword) Then
1818
+                                keywords(keyword) = i
1819
+                            End If
1820
+                        Next
1821
+                        ' 搜尋 "小   計"
1822
+                        If cellText.Contains("小   計") Then
1823
+                            subtotalRows.Add(i)
1824
+                        End If
1825
+                    End If
1826
+
1827
+                    If cellValue1 IsNot Nothing Then
1828
+                        Dim cellText As String = CStr(cellValue1).Trim()
1829
+
1830
+                        ' 搜尋關鍵字
1831
+                        For Each keyword In 規格keywords.Keys.ToList()
1832
+                            If cellText.Contains(keyword) Then
1833
+                                規格keywords(keyword) = i
1834
+                            End If
1835
+                        Next
1836
+                    End If
1837
+                Next
1838
+
1839
+                ' 檢查搜尋結果
1840
+                For Each kvp In keywords
1841
+                    If kvp.Value = -1 Then
1842
+                        MGB("在 EXCEL A 行中未找到 '" & kvp.Key.Trim() & "'", 1)
1843
+                    End If
1844
+                Next
1845
+
1846
+                ' 判斷 配方控制表 是否已經有 相同資料
1847
+                SQL_配方控制表_規格比對_讀取(讀取品名_tb.Text, 讀取料號_tb.Text, 讀取油種_tb.Text, 讀取季節_tb.Text, 讀取版本_tb.Text)
1848
+                If dr.Read Then
1849
+                    MGB("已存在以下 <" & 讀取油種_tb.Text & "> 的配方規格 : " & Environment.NewLine & Environment.NewLine & 讀取品名_tb.Text &
1850
+                " (" & 讀取料號_tb.Text & ")(" & 讀取季節_tb.Text & ")(第" & 讀取版本_tb.Text & "版)", 1)
1851
+                Else
1852
+                    ' 新增途徑: 先查出 最後一筆流水號 方可自動產生流水號 
1853
+                    產品流水號_tb.Text = 產生新流水號("PR", "配方控制表", "配方編號")
1854
+                    SQL_配方控制表_新增(產品流水號_tb.Text, 讀取品名_tb.Text, 讀取油種_tb.Text, 讀取季節_tb.Text, "", 讀取日期_tb.Text,
1855
+                            讀取產量_tb.Text, 讀取標章_tb.Text, 讀取代工_tb.Text, "", "", "", "", "", 讀取料號_tb.Text, "", 讀取版本_tb.Text, False,
1856
+                            "", "", "", "", "", "", "", "", "", "", "", 讀取組別_tb.Text)
1857
+
1858
+                    Dim 乳化劑Value As Integer = keywords("乳化劑")
1859
+                    Dim 香料Value As Integer = keywords("香   料")
1860
+                    Dim 其他Value As Integer = keywords("其   他")
1861
+                    Dim 著色劑Value As Integer = keywords("著色劑")
1862
+
1863
+                    ' 定義一個列表來儲存原料油內容
1864
+                    Dim rawMaterials As New List(Of Dictionary(Of String, String))()
1865
+
1866
+                    ' 假設數據從第8行開始,到遇到 "小   計" 或空白行為止
1867
+                    Dim startRow As Integer = 8
1868
+
1869
+                    For i As Integer = startRow To 乳化劑Value - 1
1870
+                        Dim cellValue As Object = worksheet.Cells(i, "A").Value
1871
+                        If cellValue IsNot Nothing Then
1872
+                            Dim cellText As String = CStr(cellValue).Trim()
1873
+
1874
+                            ' 遇到 "小 計" 或空白就停止
1875
+                            If cellText.Contains("小   計") OrElse String.IsNullOrEmpty(cellText) Then
1876
+                                Exit For
1877
+                            End If
1878
+
1879
+                            ' 獲取整行資料
1880
+                            Dim rowDict As New Dictionary(Of String, String)()
1881
+                            rowDict("原料油") = Regex.Replace(CStr(worksheet.Cells(i, "A").Value), "\s", "")
1882
+                            rowDict("油脂%") = CStr(worksheet.Cells(i, "B").Value)
1883
+                            rowDict("產品%") = CStr(worksheet.Cells(i, "C").Value)
1884
+                            rowDict("kg") = CStr(worksheet.Cells(i, "D").Value)
1885
+
1886
+                            rawMaterials.Add(rowDict)
1887
+                        End If
1888
+                    Next
1889
+
1890
+                    ' 顯示獲取到的數據
1891
+                    If rawMaterials.Count > 0 Then
1892
+                        For Each material As Dictionary(Of String, String) In rawMaterials
1893
+                            Dim 物料料號 As String = ""
1894
+                            SQL_配方_原料名稱比對_讀取("原料油", material("原料油"))
1895
+                            If dr.Read Then
1896
+                                物料料號 = dr("物料料號").ToString
1897
+                                明細流水號_新增 = 產生新流水號("PS", "配方明細表", "明細流水號")
1898
+                                SQL_配方明細表_原料_新增(明細流水號_新增, 產品流水號_tb.Text, "原料油", material("原料油"), material("油脂%"),
1899
+                                                 material("產品%"), material("kg"), "", 物料料號)
1900
+                            Else
1901
+                                MGB("原料油: " & material("原料油") & " 找不到物料編號!", 1)
1902
+                            End If
1903
+                        Next
1904
+                    End If
1905
+
1906
+                    EXCEL原料細項讀取(worksheet, 乳化劑Value + 1, 香料Value, "乳化劑")
1907
+                    EXCEL原料細項讀取(worksheet, 香料Value + 1, 其他Value, "香料")
1908
+                    EXCEL原料細項讀取(worksheet, 其他Value + 1, 著色劑Value, "其他")
1909
+                    EXCEL原料細項讀取(worksheet, 著色劑Value + 1, lastRow, "著色劑")
1910
+
1911
+                    ' 假設數據從第X行開始,到遇到空白行為止
1912
+                    Dim 油脂規格Value As Integer = 規格keywords("原 料 油 脂 規 格")
1913
+                    Dim 產品規格Value As Integer = 規格keywords("產  品  規  格")
1914
+                    Dim 備註Value As Integer = 規格keywords("備            註")
1915
+
1916
+                    EXCEL規格細項讀取(worksheet, 油脂規格Value + 2, 產品規格Value, "油脂規格")
1917
+                    EXCEL規格細項讀取(worksheet, 產品規格Value + 1, 備註Value, "產品規格")
1918
+
1919
+                    產品名稱_tb.Text = 讀取品名_tb.Text
1920
+                    油脂種類_cb.Text = 讀取油種_tb.Text
1921
+                    季節_cb.Text = 讀取季節_tb.Text
1922
+                    組別_cb.Text = 讀取組別_tb.Text
1923
+                    生產噸數_nud.Value = Convert.ToDecimal(If(IsDBNull(讀取產量_tb.Text), 0, 讀取產量_tb.Text))
1924
+                    認證標章_cb.Text = 讀取標章_tb.Text
1925
+                    配方_DTP.Text = 讀取日期_tb.Text
1926
+                    版本_nud.Value = Convert.ToDecimal(If(IsDBNull(讀取版本_tb.Text), 0, 讀取版本_tb.Text))
1927
+                    產品編號_tb.Text = 讀取料號_tb.Text
1928
+                    代工產品_ch.Checked = If(讀取代工_tb.Text = "是", True, False)
1929
+
1930
+                    Set_配方明細表原料油_讀取(產品流水號_tb.Text) : Set_配方明細表乳化劑_讀取(產品流水號_tb.Text) : Set_配方明細表香料_讀取(產品流水號_tb.Text)
1931
+                    Set_配方明細表其他_讀取(產品流水號_tb.Text)
1932
+                    Set_配方明細表著色劑_讀取(產品流水號_tb.Text) : Set_配方規格表油脂_讀取(產品流水號_tb.Text)
1933
+                    Set_配方規格表產品_讀取(產品流水號_tb.Text)
1934
+
1935
+                    MGB("Excel 資料已成功匯入!", 1)
1936
+                End If
1667 1937
             End If
1668 1938
 
1939
+        Catch ex As COMException
1940
+            MessageBox.Show("Excel COM 操作錯誤: " & ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
1941
+        Catch ex As IOException
1942
+            MessageBox.Show("文件 IO 錯誤: " & ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
1669 1943
         Catch ex As Exception
1670
-            MessageBox.Show("發生錯誤: " & ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
1944
+            MessageBox.Show("發生未預期的錯誤: " & ex.Message, "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error)
1671 1945
         Finally
1672 1946
             ' 清理資源
1673 1947
             If workbook IsNot Nothing Then
@@ -1675,9 +1949,7 @@ Public Class 製程配方表
1675 1949
             End If
1676 1950
             If excelApp IsNot Nothing Then
1677 1951
                 excelApp.Quit()
1678
-                ReleaseObject(worksheet)
1679
-                ReleaseObject(workbook)
1680
-                ReleaseObject(excelApp)
1952
+                ReleaseObject(worksheet) : ReleaseObject(workbook) : ReleaseObject(excelApp)
1681 1953
             End If
1682 1954
         End Try
1683 1955
     End Sub
@@ -1693,4 +1965,139 @@ Public Class 製程配方表
1693 1965
             GC.Collect()
1694 1966
         End Try
1695 1967
     End Sub
1968
+    Private Function ExtractCellValue(worksheet As Microsoft.Office.Interop.Excel.Worksheet, cellAddress As String, keyword As String, offset As Integer) As String
1969
+        Dim cellValue As String = CStr(worksheet.Range(cellAddress).Value)
1970
+        Dim startIndex As Integer = cellValue.IndexOf(keyword) + offset
1971
+        If startIndex > offset - 1 Then
1972
+            Return cellValue.Substring(startIndex).Trim()
1973
+        Else
1974
+            Return keyword & "未填"
1975
+        End If
1976
+    End Function
1977
+    Private Sub EXCEL原料細項讀取(worksheet As Microsoft.Office.Interop.Excel.Worksheet, startRow As Integer, endRow As Integer, materialType As String)
1978
+        Dim materials As New List(Of Dictionary(Of String, String))()
1979
+
1980
+        For i As Integer = startRow To endRow - 1
1981
+            Dim cellValue As Object = worksheet.Cells(i, "A").Value
1982
+            If cellValue IsNot Nothing Then
1983
+                Dim cellText As String = CStr(cellValue).Trim()
1984
+                If cellText.Contains("小   計") OrElse String.IsNullOrEmpty(cellText) Then
1985
+                    Exit For
1986
+                End If
1987
+
1988
+                Dim rowDict As New Dictionary(Of String, String)()
1989
+                rowDict(materialType) = Regex.Replace(CStr(cellText), "\s", "")
1990
+                rowDict("過敏原資訊") = CStr(worksheet.Cells(i, "B").Value)
1991
+                rowDict("產品%") = CStr(worksheet.Cells(i, "C").Value)
1992
+                rowDict("重量") = CStr(worksheet.Cells(i, "D").Value)
1993
+                materials.Add(rowDict)
1994
+            End If
1995
+        Next
1996
+
1997
+        If materials.Count > 0 Then
1998
+            For Each material As Dictionary(Of String, String) In materials
1999
+                Dim 物料料號 As String = ""
2000
+                SQL_配方_原料名稱比對_讀取(materialType, material(materialType))
2001
+                If dr.Read Then
2002
+                    物料料號 = dr("物料料號").ToString
2003
+                    明細流水號_新增 = 產生新流水號("PS", "配方明細表", "明細流水號")
2004
+                    SQL_配方明細表_原料_新增(明細流水號_新增, 產品流水號_tb.Text, materialType, material(materialType), "",
2005
+                                     material("產品%"), material("重量"), material("過敏原資訊"), 物料料號)
2006
+                Else
2007
+                    MGB(materialType & ": " & material(materialType) & " 找不到物料編號!", 1)
2008
+                End If
2009
+            Next
2010
+        End If
2011
+    End Sub
2012
+    Private Sub EXCEL規格細項讀取(worksheet As Microsoft.Office.Interop.Excel.Worksheet, startRow As Integer, endRow As Integer, materialType As String)
2013
+        Dim materials As New List(Of Dictionary(Of String, String))()
2014
+
2015
+        For i As Integer = startRow To endRow - 1
2016
+            Dim cellValue As Object = worksheet.Cells(i, "F").Value
2017
+            If cellValue IsNot Nothing Then
2018
+                Dim cellText As String = CStr(cellValue).Trim()
2019
+                ' 遇到空白就停止
2020
+                If String.IsNullOrEmpty(cellText) Then
2021
+                    Exit For
2022
+                End If
2023
+                ' 獲取整行資料
2024
+                Dim rowDict As New Dictionary(Of String, String)()
2025
+                rowDict("項目") = Regex.Replace(CStr(cellText), "\s", "")
2026
+                rowDict("標準") = CStr(worksheet.Cells(i, "G").Value)
2027
+                materials.Add(rowDict)
2028
+            End If
2029
+        Next
2030
+
2031
+        ' 顯示獲取到的數據
2032
+        If materials.Count > 0 Then
2033
+            For Each material As Dictionary(Of String, String) In materials
2034
+                Dim 規格編號 As String = ""
2035
+                SQL_配方規格選項_內容_讀取(materialType, material("項目"))
2036
+                If dr.Read Then
2037
+                    規格編號 = dr("流水號").ToString
2038
+                    規格流水號_新增 = 產生新流水號("SP", "配方規格表", "規格流水號")
2039
+                    SQL_配方規格表_新增(規格流水號_新增, 產品流水號_tb.Text, materialType, material("項目"), material("標準"))
2040
+                Else
2041
+                    MGB("項目: " & material("項目") & " 找不到規格編號!", 1)
2042
+                End If
2043
+            Next
2044
+        End If
2045
+    End Sub
2046
+
2047
+
2048
+    Private Sub ConfigureDataGridView()
2049
+        With 配方列表_dgv
2050
+            ' 基本設置
2051
+            .AllowUserToResizeColumns = True
2052
+            .DefaultCellStyle.WrapMode = DataGridViewTriState.True
2053
+            .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
2054
+            .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None
2055
+            .DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft
2056
+
2057
+            ' 設置最小列寬
2058
+            For Each column As DataGridViewColumn In .Columns
2059
+                column.MinimumWidth = 50
2060
+            Next
2061
+
2062
+            ' 添加事件處理器
2063
+            AddHandler .ColumnHeaderMouseDoubleClick, AddressOf 配方列表_dgv_ColumnHeaderDoubleClick
2064
+            AddHandler .ColumnWidthChanged, AddressOf 配方列表_dgv_ColumnWidthChanged
2065
+
2066
+            ' 定義列寬
2067
+            Dim columnWidths As New Dictionary(Of String, Integer) From {
2068
+            {"產品名稱", 180}, {"產品編號", 85}, {"版本", 50},
2069
+            {"季節", 70}, {"代工", 50}, {"停用", 50},
2070
+            {"生產噸數", 80}, {"油脂比例規格", 250}, {"熟成溫度", 80},
2071
+            {"熟成時間", 80}, {"淨重", 50}, {"淨重單位", 80},
2072
+            {"過敏原信息", 350}, {"備註", 550}, {"保存條件", 150},
2073
+            {"保存期限", 150}, {"有效日期", 150}
2074
+        }
2075
+
2076
+            ' 設置列寬
2077
+            For Each kvp In columnWidths
2078
+                If .Columns.Contains(kvp.Key) Then
2079
+                    .Columns(kvp.Key).Width = kvp.Value
2080
+                End If
2081
+            Next
2082
+        End With
2083
+    End Sub
2084
+
2085
+    Private Sub 配方列表_dgv_ColumnHeaderDoubleClick(sender As Object, e As DataGridViewCellMouseEventArgs)
2086
+        If e.ColumnIndex >= 0 AndAlso e.RowIndex = -1 Then
2087
+            Dim newWidth = Math.Min(配方列表_dgv.Columns(e.ColumnIndex).GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, True), MaxColumnWidth)
2088
+            配方列表_dgv.Columns(e.ColumnIndex).Width = newWidth
2089
+        End If
2090
+    End Sub
2091
+
2092
+    Private Sub 配方列表_dgv_ColumnWidthChanged(sender As Object, e As DataGridViewColumnEventArgs)
2093
+        ' 限制列寬不超過最大值
2094
+        If e.Column.Width > MaxColumnWidth Then
2095
+            e.Column.Width = MaxColumnWidth
2096
+        End If
2097
+
2098
+        ' 重新調整行高以適應新的列寬
2099
+        配方列表_dgv.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells)
2100
+    End Sub
2101
+
2102
+
1696 2103
 End Class

+ 67
- 0
OW-ERP-SYS/0、MyModule/主資料庫/SQL_技術管理系統.vb Dosyayı Görüntüle

@@ -70,6 +70,44 @@ Module SQL_技術管理系統
70 70
                 END, 版本 DESC"
71 71
         CmdSet_For_DGV()
72 72
     End Sub
73
+    Friend Sub SQL_配方控制表_讀取_列表用(油脂種類 As String)
74
+        ConnOpen()
75
+        SQL1 = "SELECT     配方編號, 舊編號 AS 產品編號, 產品名稱, 季節, 版本, 制定日期, 生產噸數, 認證標章, 代工, 
76
+                           出貨類型, 物料料號, 停用, 油脂比例規格, 熟成溫度, 熟成時間, 
77
+                           包材類型, 打包帶, 淨重, 淨重單位, 保存條件, 保存期限, 有效日期, 過敏原信息, 備註, 組別
78
+                FROM      配方控制表
79
+                WHERE     油脂種類 LIKE N'%" & 油脂種類 & "'
80
+                ORDER BY  產品名稱, 舊編號,
81
+				        CASE 季節 
82
+			        		WHEN '春' THEN 1
83
+			        		WHEN '夏' THEN 2
84
+		        			WHEN '秋' THEN 3
85
+		        			WHEN '冬' THEN 4
86
+		        			WHEN '春秋' THEN 5
87
+		        			WHEN '不分季' THEN 6
88
+                        ELSE 7
89
+                END, 版本 DESC"
90
+        CmdSet_For_DGV()
91
+    End Sub
92
+    Friend Sub SQL_搜尋配方控制表_讀取_列表用(Search_word As String, Search_select As String)
93
+        ConnOpen()
94
+        SQL1 = "SELECT     配方編號, 舊編號 AS 產品編號, 產品名稱, 季節, 版本, 制定日期, 生產噸數, 認證標章, 代工, 
95
+                           出貨類型, 物料料號, 停用, 油脂比例規格, 熟成溫度, 熟成時間, 
96
+                           包材類型, 打包帶, 淨重, 淨重單位, 保存條件, 保存期限, 有效日期, 過敏原信息, 備註, 組別
97
+                FROM      配方控制表
98
+                WHERE     (" & Search_select & " LIKE N'%" & Search_word & "%')
99
+                ORDER BY  產品名稱, 舊編號,
100
+				        CASE 季節 
101
+			        		WHEN '春' THEN 1
102
+			        		WHEN '夏' THEN 2
103
+		        			WHEN '秋' THEN 3
104
+		        			WHEN '冬' THEN 4
105
+		        			WHEN '春秋' THEN 5
106
+		        			WHEN '不分季' THEN 6
107
+                        ELSE 7
108
+                END, 版本 DESC"
109
+        CmdSet_For_DGV()
110
+    End Sub
73 111
     Friend Sub SQL_配方控制表_產品名稱查詢_讀取(產品名稱 As String, 油脂種類 As String, 季節 As String, 出貨類型 As String, 版本 As String)
74 112
         ConnOpen()
75 113
         SQL1 = "SELECT    產品名稱
@@ -117,6 +155,20 @@ Module SQL_技術管理系統
117 155
                 WHERE   (配方編號 LIKE N'" & 配方編號 & "')"
118 156
         CmdSet_For_dr()
119 157
     End Sub
158
+    Friend Sub SQL_配方控制表_列表更新(配方編號 As String, 舊編號 As String, 產品名稱 As String, 季節 As String, 版本 As String, 生產噸數 As String,
159
+                            認證標章 As String, 出貨類型 As String, 代工 As Boolean, 物料料號 As String, 停用 As Boolean, 制定日期 As String,
160
+                            油脂比例規格 As String, 熟成溫度 As String, 熟成時間 As String, 包材類型 As String, 打包帶 As String, 淨重 As String,
161
+                            淨重單位 As String, 保存條件 As String, 保存期限 As String, 有效日期 As String, 過敏原信息 As String, 備註 As String, 組別 As String)
162
+        ConnOpen()
163
+        SQL1 = "UPDATE  配方控制表 SET 產品名稱 = N'" & 產品名稱 & "', 季節 = N'" & 季節 & "', 出貨類型 = N'" & 出貨類型 & "'
164
+                        , 生產噸數 = N'" & 生產噸數 & "', 認證標章 = N'" & 認證標章 & "', 代工 = N'" & 代工 & "', 備註 = N'" & 備註 & "', 舊編號 = N'" & 舊編號 & "'
165
+                        , 物料料號 = N'" & 物料料號 & "', 版本 = N'" & 版本 & "', 停用 = N'" & 停用 & "', 制定日期 = N'" & 制定日期 & "', 油脂比例規格 = N'" & 油脂比例規格 & "'
166
+                        , 熟成溫度 = N'" & 熟成溫度 & "', 熟成時間 = N'" & 熟成時間 & "', 包材類型 = N'" & 包材類型 & "', 打包帶 = N'" & 打包帶 & "'
167
+                        , 淨重 = N'" & 淨重 & "', 淨重單位 = N'" & 淨重單位 & "', 保存條件 = N'" & 保存條件 & "', 保存期限 = N'" & 保存期限 & "'
168
+                        , 有效日期 = N'" & 有效日期 & "', 過敏原信息 = N'" & 過敏原信息 & "', 組別 = N'" & 組別 & "'
169
+                WHERE   (配方編號 LIKE N'" & 配方編號 & "')"
170
+        CmdSet_For_dr()
171
+    End Sub
120 172
     Friend Sub SQL_配方控制表_依配方編號_刪除(配方編號 As String)
121 173
         ConnOpen()
122 174
         SQL1 = "DELETE FROM 配方控制表 
@@ -306,6 +358,21 @@ Module SQL_技術管理系統
306 358
         SQL1 = String.Format("UPDATE {0} SET {1} = N'{2}', {3} = N'{4}' WHERE (配方編號 LIKE N'{5}')", 表名, 簽名編碼選擇, 暫存簽名編碼, 簽名日期字段, Strings.Format(Today(), "yyyy/MM/dd"), 配方編號)
307 359
         CmdSet_For_dr()
308 360
     End Sub
361
+    Friend Sub SQL_配方控制表_規格比對_讀取(產品名稱 As String, 產品編號 As String, 油脂種類 As String, 季節 As String, 版本 As String)
362
+        ConnOpen()
363
+        SQL1 = "SELECT      產品名稱, 舊編號, 油脂種類, 季節, 版本, 制定日期, 認證標章, 生產噸數, 代工
364
+                FROM        配方控制表
365
+                WHERE       (產品名稱 LIKE N'" & 產品名稱 & "') AND (舊編號 LIKE N'" & 產品編號 & "') AND (油脂種類 LIKE N'" & 油脂種類 & "')
366
+                             AND (季節 LIKE N'" & 季節 & "') AND (版本 LIKE N'" & 版本 & "')"
367
+        CmdSet_For_dr()
368
+    End Sub
369
+    Friend Sub SQL_配方_原料名稱比對_讀取(種類 As String, 名稱 As String)
370
+        ConnOpen()
371
+        SQL1 = "SELECT      物料料號
372
+                FROM        物料規格表
373
+                WHERE       (種類 LIKE N'" & 種類 & "') AND (名稱 LIKE N'" & 名稱 & "')"
374
+        CmdSet_For_dr()
375
+    End Sub
309 376
 
310 377
     ' ---------------------------- 設備點檢表 -----------------------------------
311 378
     Friend Sub SQL_點檢控制表_讀取(startDate As DateTime, deviceIds As String)

+ 1
- 1
OW-ERP-SYS/0、MyModule/模組/全域變數.vb Dosyayı Görüntüle

@@ -9,7 +9,7 @@
9 9
     '------LINE變數-------
10 10
     Public 發送對象, LINE_權限代號, PA201, PA202, PA203, PA204, PA205, 通知變數X, 通知變數Y As String
11 11
     '----系統版本----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12
-    Public 版本 As String = "2024082001" : Public 資料庫版本 As String
12
+    Public 版本 As String = "2024090201" : Public 資料庫版本 As String
13 13
     '----系統閒置----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
14 14
     Public 判斷重登, 重登確認, 主頁開啟, 首次開啟, 物料查詢, 深色風格, 不刪除檔案 As Boolean
15 15
     Public timeExit, timeExit2, timeNow, timeNow2 As Integer

BIN
OW-ERP-SYS/bin/Debug/OW-ERP-SYS.exe Dosyayı Görüntüle


BIN
OW-ERP-SYS/bin/Debug/OW-ERP-SYS.pdb Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/DesignTimeResolveAssemblyReferences.cache Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/Interop.ACTIVEXLib.dll Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/OW-ERP-SYS.exe Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/OW-ERP-SYS.pdb Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/OW-ERP-SYS.vbproj.GenerateResource.cache Dosyayı Görüntüle


BIN
OW-ERP-SYS/obj/Debug/OW-ERP-SYS.vbproj.ResolveComReference.cache Dosyayı Görüntüle


Loading…
İptal
Kaydet