Przeglądaj źródła

版本號 : 2020081301

新增內容 :
1、物料檔案新增批量刪除功能。
2、刪除按鈕點擊後多一個再確認的動作,確保誤觸刪除資料。

Signed-off-by: B70340 <b70340@gmail.com>
B70340 5 lat temu
rodzic
commit
72e49a7241

BIN
.vs/YD-ERP-SYS/v16/.suo Wyświetl plik


+ 17
- 16
YD-ERP-SYS/LoginForm1.vb Wyświetl plik

@@ -110,22 +110,23 @@ Public Class LoginForm1
110 110
         Else : End If
111 111
     End Sub
112 112
     Private Sub 自動更新1()
113
-        Dim aa1 As MsgBoxResult
114
-        aa1 = MsgBox("系統版本號 與 資料庫版本號 對應不上,請開發人員注意是否有其他人員修改。並決定是否下載最新的執行檔?", MsgBoxStyle.OkCancel)
115
-        If aa1 = MsgBoxResult.Ok Then
116
-            With SaveFileDialog1 : .Filter = "所有文件(*.exe)|*.exe" : End With
117
-            SaveFileDialog1.FileName = "YD-ERP-SYS - " & 版本號 & ".exe"
118
-            SaveFileDialog1.ShowDialog()
119
-            If Strings.Right(SaveFileDialog1.FileName, 27) = "YD-ERP-SYS - " & 版本號 & ".exe" Then
120
-                My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "YD-ERP-SYS - " & 版本號 & ".exe", SaveFileDialog1.FileName, "", "", True, 10000, True)
121
-                MsgBox("下載完成,請手動刪除就的執行檔,並且用新的執行檔開啟。")
122
-                Me.Close()
123
-            Else
124
-                MsgBox("操作不正確,請用手動方式下載更新。")
125
-            End If
126
-        Else
127
-            登入程序()
128
-        End If
113
+        'Dim aa1 As MsgBoxResult
114
+        'aa1 = MsgBox("系統版本號 與 資料庫版本號 對應不上,請開發人員注意是否有其他人員修改。並決定是否下載最新的執行檔?", MsgBoxStyle.OkCancel)
115
+        'If aa1 = MsgBoxResult.Ok Then
116
+        '    With SaveFileDialog1 : .Filter = "所有文件(*.exe)|*.exe" : End With
117
+        '    SaveFileDialog1.FileName = "YD-ERP-SYS - " & 版本號 & ".exe"
118
+        '    SaveFileDialog1.ShowDialog()
119
+        '    If Strings.Right(SaveFileDialog1.FileName, 27) = "YD-ERP-SYS - " & 版本號 & ".exe" Then
120
+        '        My.Computer.Network.DownloadFile(Target & AA(0) & "/" & "YD-ERP-SYS - " & 版本號 & ".exe", SaveFileDialog1.FileName, "", "", True, 10000, True)
121
+        '        MsgBox("下載完成,請手動刪除就的執行檔,並且用新的執行檔開啟。")
122
+        '        Me.Close()
123
+        '    Else
124
+        '        MsgBox("操作不正確,請用手動方式下載更新。")
125
+        '    End If
126
+        'Else
127
+        '    登入程序()
128
+        'End If
129
+        登入程序()
129 130
     End Sub
130 131
     Private Sub 自動更新2()
131 132
         Dim aa1 As MsgBoxResult

+ 2
- 1
YD-ERP-SYS/Module/SQL_Module.vb Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 Imports System.Data.SqlClient
2 2
 Module SQL_Module
3
-    Public ConString As String : Public SQL1 As String : Public conn As New SqlConnection : Public cmd As New SqlCommand : Public dr As SqlDataReader : Public da As New SqlDataAdapter
3
+    Public ConString As String : Public SQL1 As String : Public SQL2 As String
4
+    Public conn As New SqlConnection : Public cmd As New SqlCommand : Public dr As SqlDataReader : Public da As New SqlDataAdapter
4 5
     Public DTP As String : Public DTP1 As String : Public DTP2 As String : Public DTP3 As String
5 6
     Public 登入權限 As String = "姓名, 帳號, 密碼, 職稱, 級別 "
6 7
     Public 權限數量 As Integer = 0

+ 10
- 10
YD-ERP-SYS/Module/SQL_倉儲系統管理.vb Wyświetl plik

@@ -4,18 +4,21 @@
4 4
         ConnOpen()
5 5
         If 物料檔案.查詢_tb.Text = "" Then
6 6
             If 物料檔案.供應商編碼_cb.Text = "" Then
7
-                SQL1 = "SELECT 料號, 供應商編號, 成本, 品名, 停用 FROM 物料資料庫 ORDER BY 料號"
7
+                SQL2 = ""
8 8
             Else
9
-                SQL1 = "SELECT 料號, 供應商編號, 成本, 品名, 停用 FROM 物料資料庫 WHERE 供應商編號 LIKE '" & 物料檔案.供應商編碼_cb.Text & "' ORDER BY 料號"
9
+                SQL2 = " WHERE 物料資料庫.供應商編號 LIKE '" & 物料檔案.供應商編碼_cb.Text & "' "
10 10
             End If
11 11
         Else
12 12
             If 物料檔案.供應商編碼_cb.Text = "" Then
13
-                SQL1 = "SELECT 料號, 供應商編號, 成本, 品名, 停用 FROM 物料資料庫 WHERE (料號 LIKE N'%" & PA & "%' OR 品名 LIKE N'%" & PA & "%') ORDER BY 料號"
13
+                SQL2 = " WHERE (物料資料庫.料號 LIKE N'%" & PA & "%' OR 物料資料庫.品名 LIKE N'%" & PA & "%') "
14 14
             Else
15
-                SQL1 = "SELECT 料號, 供應商編號, 成本, 品名, 停用 FROM 物料資料庫 
16
-                        WHERE (供應商編號 LIKE '" & 物料檔案.供應商編碼_cb.Text & "') AND (料號 LIKE N'%" & PA & "%' OR 品名 LIKE N'%" & PA & "%') ORDER BY 料號"
15
+                SQL2 = " WHERE (物料資料庫.供應商編號 LIKE '" & 物料檔案.供應商編碼_cb.Text & "') AND (物料資料庫.料號 LIKE N'%" & PA & "%' OR 物料資料庫.品名 LIKE N'%" & PA & "%') "
17 16
             End If
18 17
         End If
18
+        SQL1 = "SELECT 物料資料庫.料號, 物料資料庫.供應商編號 AS 供應商, 物料資料庫.成本, 物料資料庫.品名, 物料資料庫.停用, 物料資料庫.是否有圖 AS 圖片, 系統選擇按鈕.選擇 AS 刪除
19
+                FROM   物料資料庫 LEFT OUTER JOIN 系統選擇按鈕 ON 物料資料庫.料號 = 系統選擇按鈕.按鈕
20
+                " & SQL2 & "
21
+                ORDER BY 物料資料庫.料號"
19 22
         CmdSet_For_DGV()
20 23
     End Sub
21 24
     Friend Sub SQL_供應商_下拉清單()
@@ -52,13 +55,10 @@
52 55
         CmdSet_For_dr()
53 56
     End Sub
54 57
     Friend Sub SQL_物料檔案_修改()
55
-        ConnOpen()
56
-        SQL1 = "UPDATE 物料資料庫 SET 成本 = N'" & 物料檔案.成本_nud.Value & "', 品名 = N'" & 物料檔案.品名_tb.Text & "', 停用 = N'" & 物料檔案.停用_ch.Checked & "'
57
-                WHERE (料號 = N'" & 物料檔案.料號_tb.Text & "')"
58
-        CmdSet_For_dr()
58
+        ConnOpen() : SQL1 = "UPDATE 物料資料庫 SET 成本 = N'" & NU1 & "', 品名 = N'" & PA1 & "', 停用 = N'" & BL1 & "' WHERE (料號 = N'" & PA2 & "')" : CmdSet_For_dr()
59 59
     End Sub
60 60
     Friend Sub SQL_物料檔案_刪除()
61
-        ConnOpen() : SQL1 = "DELETE 物料資料庫 WHERE (料號 = N'" & 物料檔案.料號_tb.Text & "')" : CmdSet_For_dr()
61
+        ConnOpen() : SQL1 = "DELETE 物料資料庫 WHERE (料號 = N'" & PA20 & "')" : CmdSet_For_dr()
62 62
     End Sub
63 63
     Friend Sub SQL_物料檔案_是否有圖()
64 64
         ConnOpen() : SQL1 = "SELECT  是否有圖 FROM 物料資料庫 WHERE (料號 LIKE N'" & 物料檔案.料號_tb.Text & "%')" : CmdSet_For_dr()

+ 18
- 3
YD-ERP-SYS/Module/全域變數.vb Wyświetl plik

@@ -4,12 +4,27 @@
4 4
     Public 版本號 As String : Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public FTP物理位置 As String
5 5
     Public AA(99) As String : Public BB(99) As Boolean : Public CC(99) As Boolean : Public 登入判斷 As Boolean
6 6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7
-    Public 版本 As String = "2020080501"
7
+    Public 版本 As String = "2020081401"
8 8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 9
     Public 列印用SQL As String = "" : Public 列印用SQL2 As String : Public 公司編號 As String : Public 公司電話 As String : Public 公司統編 As String : Public 公司地址 As String
10 10
     Public 關鍵字編號 As String
11
-
11
+    '----全域字串變數
12 12
     Public PA As String = "" : Public PA1 As String = "" : Public PA2 As String = "" : Public PA3 As String = "" : Public PA4 As String = "" : Public PA5 As String = "" : Public PA6 As String = ""
13 13
     Public PA7 As String = "" : Public PA8 As String = "" : Public PA9 As String = "" : Public PA10 As String = "" : Public PA11 As String = "" : Public PA12 As String = "" : Public PA13 As String = ""
14
-    Public PA14 As String = "" : Public PA15 As String = "" : Public PA16 As String = "" : Public PA17 As String = "" : Public PA18 As String = "" : Public PA19 As String = ""
14
+    Public PA14 As String = "" : Public PA15 As String = "" : Public PA16 As String = "" : Public PA17 As String = "" : Public PA18 As String = "" : Public PA19 As String = "" : Public PA20 As String = ""
15
+    '----全域數字變數
16
+    Public NU1 As Double : Public NU2 As Double : Public NU3 As Double : Public NU4 As Double : Public NU5 As Double
17
+    '----全域布林含數
18
+    Public BL1 As Boolean : Public BL2 As Boolean : Public BL3 As Boolean : Public BL4 As Boolean : Public BL5 As Boolean
19
+
20
+    '----進度條計算式-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21
+    Public 平均數 As Integer : Public 最終數 As Integer = 0 : Public 資料數 As Integer = 0
22
+    Public Class MyModule1
23
+        Friend Shared Sub 進度條()
24
+            平均數 = 10000 / 資料數
25
+            最終數 += 平均數
26
+            If 最終數 > 10000 Then : 最終數 = 10000 : End If
27
+            YD_ERP_SYS.ToolStripProgressBar1.Value = 最終數
28
+        End Sub
29
+    End Class
15 30
 End Module

BIN
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.exe Wyświetl plik


BIN
YD-ERP-SYS/bin/Debug/YD-ERP-SYS.pdb Wyświetl plik


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.exe Wyświetl plik


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.pdb Wyświetl plik


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.vbproj.GenerateResource.cache Wyświetl plik


BIN
YD-ERP-SYS/obj/Debug/YD-ERP-SYS.vbprojAssemblyReference.cache Wyświetl plik


+ 5
- 2
YD-ERP-SYS/人事系統管理/人事資料表.vb Wyświetl plik

@@ -117,8 +117,11 @@ Public Class 人事資料表
117 117
         If 流水號_tb.Text = "" Then '--------------------設定條件讓流水號控件不為空
118 118
             MsgBox("沒有選擇要刪除的資料")
119 119
         Else
120
-            SQL_人事資料表_刪除() '--------------------資料刪除
121
-            Set_清單() '--------------------資料修改後重新讀取清單
120
+            Dim aa1 As MsgBoxResult = MsgBox("確定要執行刪除指令嗎?", MsgBoxStyle.OkCancel)
121
+            If aa1 = MsgBoxResult.Ok Then
122
+                SQL_人事資料表_刪除() '--------------------資料刪除
123
+                Set_清單() '--------------------資料修改後重新讀取清單
124
+            End If
122 125
         End If
123 126
     End Sub
124 127
     '-------------------滑鼠右鍵-------------------------------------------------------------------------------------------------------------------------------------------------------------------

+ 123
- 58
YD-ERP-SYS/倉儲系統管理/物料檔案.Designer.vb Wyświetl plik

@@ -23,8 +23,7 @@ Partial Class 物料檔案
23 23
     <System.Diagnostics.DebuggerStepThrough()> _
24 24
     Private Sub InitializeComponent()
25 25
         Me.components = New System.ComponentModel.Container()
26
-        Dim DataGridViewCellStyle13 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
27
-        Dim DataGridViewCellStyle14 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
26
+        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
28 27
         Me.物料清單_dgv = New System.Windows.Forms.DataGridView()
29 28
         Me.Label3 = New System.Windows.Forms.Label()
30 29
         Me.資料筆數_tb = New System.Windows.Forms.TextBox()
@@ -53,11 +52,11 @@ Partial Class 物料檔案
53 52
         Me.存檔_bt = New System.Windows.Forms.Button()
54 53
         Me.新增準備_bt = New System.Windows.Forms.Button()
55 54
         Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
56
-        Me.重新整理ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
55
+        Me.重新整理_tsm = New System.Windows.Forms.ToolStripMenuItem()
57 56
         Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
58
-        Me.新增準備ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
59
-        Me.存檔ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
60
-        Me.刪除ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
57
+        Me.新增準備_tsm = New System.Windows.Forms.ToolStripMenuItem()
58
+        Me.存檔_tsm = New System.Windows.Forms.ToolStripMenuItem()
59
+        Me.刪除_tsm = New System.Windows.Forms.ToolStripMenuItem()
61 60
         Me.下載圖檔_bt = New System.Windows.Forms.Button()
62 61
         Me.圖檔入系統_bt = New System.Windows.Forms.Button()
63 62
         Me.檔案名稱_tb = New System.Windows.Forms.TextBox()
@@ -73,6 +72,11 @@ Partial Class 物料檔案
73 72
         Me.檔名讀取_tb = New System.Windows.Forms.TextBox()
74 73
         Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
75 74
         Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
75
+        Me.批量存檔_bt = New System.Windows.Forms.Button()
76
+        Me.啟用批改_ch = New System.Windows.Forms.CheckBox()
77
+        Me.批輛停用選擇_ch = New System.Windows.Forms.CheckBox()
78
+        Me.批量刪除選擇_ch = New System.Windows.Forms.CheckBox()
79
+        Me.批量刪除_bt = New System.Windows.Forms.Button()
76 80
         CType(Me.物料清單_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
77 81
         CType(Me.成本_nud, System.ComponentModel.ISupportInitialize).BeginInit()
78 82
         Me.ContextMenuStrip1.SuspendLayout()
@@ -81,19 +85,17 @@ Partial Class 物料檔案
81 85
         '
82 86
         '物料清單_dgv
83 87
         '
84
-        DataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
85
-        Me.物料清單_dgv.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle13
86 88
         Me.物料清單_dgv.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
87 89
             Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
88 90
         Me.物料清單_dgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
89 91
         Me.物料清單_dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
90
-        Me.物料清單_dgv.Location = New System.Drawing.Point(12, 83)
92
+        Me.物料清單_dgv.Location = New System.Drawing.Point(12, 84)
91 93
         Me.物料清單_dgv.Name = "物料清單_dgv"
92 94
         Me.物料清單_dgv.RowHeadersWidth = 5
93
-        DataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
94
-        Me.物料清單_dgv.RowsDefaultCellStyle = DataGridViewCellStyle14
95
+        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
96
+        Me.物料清單_dgv.RowsDefaultCellStyle = DataGridViewCellStyle1
95 97
         Me.物料清單_dgv.RowTemplate.Height = 24
96
-        Me.物料清單_dgv.Size = New System.Drawing.Size(570, 600)
98
+        Me.物料清單_dgv.Size = New System.Drawing.Size(570, 564)
97 99
         Me.物料清單_dgv.TabIndex = 668
98 100
         '
99 101
         'Label3
@@ -108,9 +110,9 @@ Partial Class 物料檔案
108 110
         '
109 111
         '資料筆數_tb
110 112
         '
111
-        Me.資料筆數_tb.Location = New System.Drawing.Point(471, 57)
113
+        Me.資料筆數_tb.Location = New System.Drawing.Point(437, 57)
112 114
         Me.資料筆數_tb.Name = "資料筆數_tb"
113
-        Me.資料筆數_tb.Size = New System.Drawing.Size(67, 23)
115
+        Me.資料筆數_tb.Size = New System.Drawing.Size(96, 23)
114 116
         Me.資料筆數_tb.TabIndex = 1016
115 117
         Me.資料筆數_tb.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
116 118
         '
@@ -118,7 +120,7 @@ Partial Class 物料檔案
118 120
         '
119 121
         Me.Label4.AutoSize = True
120 122
         Me.Label4.ImeMode = System.Windows.Forms.ImeMode.NoControl
121
-        Me.Label4.Location = New System.Drawing.Point(449, 60)
123
+        Me.Label4.Location = New System.Drawing.Point(411, 60)
122 124
         Me.Label4.Name = "Label4"
123 125
         Me.Label4.Size = New System.Drawing.Size(20, 16)
124 126
         Me.Label4.TabIndex = 1015
@@ -267,17 +269,17 @@ Partial Class 物料檔案
267 269
         '
268 270
         '成本_nud
269 271
         '
270
-        Me.成本_nud.Location = New System.Drawing.Point(491, 5)
272
+        Me.成本_nud.Location = New System.Drawing.Point(437, 31)
271 273
         Me.成本_nud.Maximum = New Decimal(New Integer() {10000000, 0, 0, 0})
272 274
         Me.成本_nud.Name = "成本_nud"
273
-        Me.成本_nud.Size = New System.Drawing.Size(91, 23)
275
+        Me.成本_nud.Size = New System.Drawing.Size(96, 23)
274 276
         Me.成本_nud.TabIndex = 1094
275 277
         Me.成本_nud.ThousandsSeparator = True
276 278
         '
277 279
         'Label25
278 280
         '
279 281
         Me.Label25.AutoSize = True
280
-        Me.Label25.Location = New System.Drawing.Point(459, 8)
282
+        Me.Label25.Location = New System.Drawing.Point(405, 34)
281 283
         Me.Label25.Name = "Label25"
282 284
         Me.Label25.Size = New System.Drawing.Size(32, 16)
283 285
         Me.Label25.TabIndex = 1095
@@ -287,16 +289,16 @@ Partial Class 物料檔案
287 289
         '
288 290
         Me.停用_ch.AutoSize = True
289 291
         Me.停用_ch.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
290
-        Me.停用_ch.Location = New System.Drawing.Point(405, 7)
292
+        Me.停用_ch.Location = New System.Drawing.Point(412, 7)
291 293
         Me.停用_ch.Name = "停用_ch"
292
-        Me.停用_ch.Size = New System.Drawing.Size(51, 20)
294
+        Me.停用_ch.Size = New System.Drawing.Size(123, 20)
293 295
         Me.停用_ch.TabIndex = 1096
294
-        Me.停用_ch.Text = "停用"
296
+        Me.停用_ch.Text = "此料號為停用狀態"
295 297
         Me.停用_ch.UseVisualStyleBackColor = True
296 298
         '
297 299
         '供應商編碼_tb
298 300
         '
299
-        Me.供應商編碼_tb.Location = New System.Drawing.Point(898, 4)
301
+        Me.供應商編碼_tb.Location = New System.Drawing.Point(133, 111)
300 302
         Me.供應商編碼_tb.Name = "供應商編碼_tb"
301 303
         Me.供應商編碼_tb.Size = New System.Drawing.Size(67, 23)
302 304
         Me.供應商編碼_tb.TabIndex = 1097
@@ -304,12 +306,12 @@ Partial Class 物料檔案
304 306
         '狀態_lb
305 307
         '
306 308
         Me.狀態_lb.AutoSize = True
307
-        Me.狀態_lb.Font = New System.Drawing.Font("微軟正黑體", 14.25!)
309
+        Me.狀態_lb.Font = New System.Drawing.Font("微軟正黑體", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
308 310
         Me.狀態_lb.ForeColor = System.Drawing.Color.Red
309 311
         Me.狀態_lb.ImeMode = System.Windows.Forms.ImeMode.NoControl
310
-        Me.狀態_lb.Location = New System.Drawing.Point(405, 31)
312
+        Me.狀態_lb.Location = New System.Drawing.Point(864, 9)
311 313
         Me.狀態_lb.Name = "狀態_lb"
312
-        Me.狀態_lb.Size = New System.Drawing.Size(86, 24)
314
+        Me.狀態_lb.Size = New System.Drawing.Size(145, 40)
313 315
         Me.狀態_lb.TabIndex = 1102
314 316
         Me.狀態_lb.Text = "編輯狀態"
315 317
         '
@@ -317,9 +319,9 @@ Partial Class 物料檔案
317 319
         '
318 320
         Me.刪除_bt.ForeColor = System.Drawing.Color.Red
319 321
         Me.刪除_bt.ImeMode = System.Windows.Forms.ImeMode.NoControl
320
-        Me.刪除_bt.Location = New System.Drawing.Point(746, 4)
322
+        Me.刪除_bt.Location = New System.Drawing.Point(718, 4)
321 323
         Me.刪除_bt.Name = "刪除_bt"
322
-        Me.刪除_bt.Size = New System.Drawing.Size(73, 51)
324
+        Me.刪除_bt.Size = New System.Drawing.Size(64, 51)
323 325
         Me.刪除_bt.TabIndex = 1101
324 326
         Me.刪除_bt.Text = "刪除"
325 327
         Me.刪除_bt.UseVisualStyleBackColor = True
@@ -328,9 +330,9 @@ Partial Class 物料檔案
328 330
         '
329 331
         Me.存檔_bt.ForeColor = System.Drawing.Color.Green
330 332
         Me.存檔_bt.ImeMode = System.Windows.Forms.ImeMode.NoControl
331
-        Me.存檔_bt.Location = New System.Drawing.Point(667, 4)
333
+        Me.存檔_bt.Location = New System.Drawing.Point(653, 4)
332 334
         Me.存檔_bt.Name = "存檔_bt"
333
-        Me.存檔_bt.Size = New System.Drawing.Size(73, 51)
335
+        Me.存檔_bt.Size = New System.Drawing.Size(64, 51)
334 336
         Me.存檔_bt.TabIndex = 1100
335 337
         Me.存檔_bt.Text = "存檔"
336 338
         Me.存檔_bt.UseVisualStyleBackColor = True
@@ -341,48 +343,48 @@ Partial Class 物料檔案
341 343
         Me.新增準備_bt.ImeMode = System.Windows.Forms.ImeMode.NoControl
342 344
         Me.新增準備_bt.Location = New System.Drawing.Point(588, 4)
343 345
         Me.新增準備_bt.Name = "新增準備_bt"
344
-        Me.新增準備_bt.Size = New System.Drawing.Size(73, 51)
346
+        Me.新增準備_bt.Size = New System.Drawing.Size(64, 51)
345 347
         Me.新增準備_bt.TabIndex = 1099
346 348
         Me.新增準備_bt.Text = "新增準備"
347 349
         Me.新增準備_bt.UseVisualStyleBackColor = True
348 350
         '
349 351
         'ContextMenuStrip1
350 352
         '
351
-        Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.重新整理ToolStripMenuItem, Me.ToolStripSeparator3, Me.新增準備ToolStripMenuItem, Me.存檔ToolStripMenuItem, Me.刪除ToolStripMenuItem})
353
+        Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.重新整理_tsm, Me.ToolStripSeparator3, Me.新增準備_tsm, Me.存檔_tsm, Me.刪除_tsm})
352 354
         Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
353 355
         Me.ContextMenuStrip1.Size = New System.Drawing.Size(123, 98)
354 356
         '
355
-        '重新整理ToolStripMenuItem
357
+        '重新整理_tsm
356 358
         '
357
-        Me.重新整理ToolStripMenuItem.Name = "重新整理ToolStripMenuItem"
358
-        Me.重新整理ToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
359
-        Me.重新整理ToolStripMenuItem.Text = "重新整理"
359
+        Me.重新整理_tsm.Name = "重新整理_tsm"
360
+        Me.重新整理_tsm.Size = New System.Drawing.Size(122, 22)
361
+        Me.重新整理_tsm.Text = "重新整理"
360 362
         '
361 363
         'ToolStripSeparator3
362 364
         '
363 365
         Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
364 366
         Me.ToolStripSeparator3.Size = New System.Drawing.Size(119, 6)
365 367
         '
366
-        '新增準備ToolStripMenuItem
368
+        '新增準備_tsm
367 369
         '
368
-        Me.新增準備ToolStripMenuItem.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
369
-        Me.新增準備ToolStripMenuItem.Name = "新增準備ToolStripMenuItem"
370
-        Me.新增準備ToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
371
-        Me.新增準備ToolStripMenuItem.Text = "新增準備"
370
+        Me.新增準備_tsm.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
371
+        Me.新增準備_tsm.Name = "新增準備_tsm"
372
+        Me.新增準備_tsm.Size = New System.Drawing.Size(122, 22)
373
+        Me.新增準備_tsm.Text = "新增準備"
372 374
         '
373
-        '存檔ToolStripMenuItem
375
+        '存檔_tsm
374 376
         '
375
-        Me.存檔ToolStripMenuItem.ForeColor = System.Drawing.Color.Green
376
-        Me.存檔ToolStripMenuItem.Name = "存檔ToolStripMenuItem"
377
-        Me.存檔ToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
378
-        Me.存檔ToolStripMenuItem.Text = "存檔"
377
+        Me.存檔_tsm.ForeColor = System.Drawing.Color.Green
378
+        Me.存檔_tsm.Name = "存檔_tsm"
379
+        Me.存檔_tsm.Size = New System.Drawing.Size(122, 22)
380
+        Me.存檔_tsm.Text = "存檔"
379 381
         '
380
-        '刪除ToolStripMenuItem
382
+        '刪除_tsm
381 383
         '
382
-        Me.刪除ToolStripMenuItem.ForeColor = System.Drawing.Color.Red
383
-        Me.刪除ToolStripMenuItem.Name = "刪除ToolStripMenuItem"
384
-        Me.刪除ToolStripMenuItem.Size = New System.Drawing.Size(122, 22)
385
-        Me.刪除ToolStripMenuItem.Text = "刪除"
384
+        Me.刪除_tsm.ForeColor = System.Drawing.Color.Red
385
+        Me.刪除_tsm.Name = "刪除_tsm"
386
+        Me.刪除_tsm.Size = New System.Drawing.Size(122, 22)
387
+        Me.刪除_tsm.Text = "刪除"
386 388
         '
387 389
         '下載圖檔_bt
388 390
         '
@@ -491,10 +493,10 @@ Partial Class 物料檔案
491 493
             Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
492 494
         Me.物料圖_pb.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
493 495
         Me.物料圖_pb.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
494
-        Me.物料圖_pb.Location = New System.Drawing.Point(588, 56)
496
+        Me.物料圖_pb.Location = New System.Drawing.Point(588, 84)
495 497
         Me.物料圖_pb.Margin = New System.Windows.Forms.Padding(3, 4, 3, 4)
496 498
         Me.物料圖_pb.Name = "物料圖_pb"
497
-        Me.物料圖_pb.Size = New System.Drawing.Size(421, 627)
499
+        Me.物料圖_pb.Size = New System.Drawing.Size(421, 599)
498 500
         Me.物料圖_pb.TabIndex = 1112
499 501
         Me.物料圖_pb.TabStop = False
500 502
         '
@@ -512,7 +514,7 @@ Partial Class 物料檔案
512 514
         '
513 515
         Me.下載檔名_tb.Font = New System.Drawing.Font("微軟正黑體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
514 516
         Me.下載檔名_tb.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer))
515
-        Me.下載檔名_tb.Location = New System.Drawing.Point(825, 4)
517
+        Me.下載檔名_tb.Location = New System.Drawing.Point(60, 111)
516 518
         Me.下載檔名_tb.Name = "下載檔名_tb"
517 519
         Me.下載檔名_tb.Size = New System.Drawing.Size(67, 23)
518 520
         Me.下載檔名_tb.TabIndex = 1125
@@ -522,7 +524,7 @@ Partial Class 物料檔案
522 524
         '
523 525
         Me.檔名讀取_tb.AllowDrop = True
524 526
         Me.檔名讀取_tb.ForeColor = System.Drawing.Color.Black
525
-        Me.檔名讀取_tb.Location = New System.Drawing.Point(825, 31)
527
+        Me.檔名讀取_tb.Location = New System.Drawing.Point(60, 138)
526 528
         Me.檔名讀取_tb.Multiline = True
527 529
         Me.檔名讀取_tb.Name = "檔名讀取_tb"
528 530
         Me.檔名讀取_tb.Size = New System.Drawing.Size(67, 23)
@@ -534,12 +536,70 @@ Partial Class 物料檔案
534 536
         Me.SaveFileDialog1.SupportMultiDottedExtensions = True
535 537
         Me.SaveFileDialog1.Title = "指定檔案名稱與選擇檔案路徑"
536 538
         '
539
+        '批量存檔_bt
540
+        '
541
+        Me.批量存檔_bt.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
542
+        Me.批量存檔_bt.ForeColor = System.Drawing.Color.Green
543
+        Me.批量存檔_bt.ImeMode = System.Windows.Forms.ImeMode.NoControl
544
+        Me.批量存檔_bt.Location = New System.Drawing.Point(13, 653)
545
+        Me.批量存檔_bt.Name = "批量存檔_bt"
546
+        Me.批量存檔_bt.Size = New System.Drawing.Size(569, 30)
547
+        Me.批量存檔_bt.TabIndex = 1126
548
+        Me.批量存檔_bt.Text = "批量存檔"
549
+        Me.批量存檔_bt.UseVisualStyleBackColor = True
550
+        '
551
+        '啟用批改_ch
552
+        '
553
+        Me.啟用批改_ch.AutoSize = True
554
+        Me.啟用批改_ch.Location = New System.Drawing.Point(588, 59)
555
+        Me.啟用批改_ch.Name = "啟用批改_ch"
556
+        Me.啟用批改_ch.Size = New System.Drawing.Size(75, 20)
557
+        Me.啟用批改_ch.TabIndex = 1127
558
+        Me.啟用批改_ch.Text = "啟用批改"
559
+        Me.啟用批改_ch.UseVisualStyleBackColor = True
560
+        '
561
+        '批輛停用選擇_ch
562
+        '
563
+        Me.批輛停用選擇_ch.AutoSize = True
564
+        Me.批輛停用選擇_ch.Location = New System.Drawing.Point(669, 59)
565
+        Me.批輛停用選擇_ch.Name = "批輛停用選擇_ch"
566
+        Me.批輛停用選擇_ch.Size = New System.Drawing.Size(99, 20)
567
+        Me.批輛停用選擇_ch.TabIndex = 1128
568
+        Me.批輛停用選擇_ch.Text = "批量停用選擇"
569
+        Me.批輛停用選擇_ch.UseVisualStyleBackColor = True
570
+        '
571
+        '批量刪除選擇_ch
572
+        '
573
+        Me.批量刪除選擇_ch.AutoSize = True
574
+        Me.批量刪除選擇_ch.Location = New System.Drawing.Point(774, 59)
575
+        Me.批量刪除選擇_ch.Name = "批量刪除選擇_ch"
576
+        Me.批量刪除選擇_ch.Size = New System.Drawing.Size(99, 20)
577
+        Me.批量刪除選擇_ch.TabIndex = 1129
578
+        Me.批量刪除選擇_ch.Text = "批量刪除選擇"
579
+        Me.批量刪除選擇_ch.UseVisualStyleBackColor = True
580
+        '
581
+        '批量刪除_bt
582
+        '
583
+        Me.批量刪除_bt.ForeColor = System.Drawing.Color.Red
584
+        Me.批量刪除_bt.ImeMode = System.Windows.Forms.ImeMode.NoControl
585
+        Me.批量刪除_bt.Location = New System.Drawing.Point(784, 4)
586
+        Me.批量刪除_bt.Name = "批量刪除_bt"
587
+        Me.批量刪除_bt.Size = New System.Drawing.Size(64, 51)
588
+        Me.批量刪除_bt.TabIndex = 1130
589
+        Me.批量刪除_bt.Text = "批量刪除"
590
+        Me.批量刪除_bt.UseVisualStyleBackColor = True
591
+        '
537 592
         '物料檔案
538 593
         '
539 594
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
540 595
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
541 596
         Me.ClientSize = New System.Drawing.Size(1312, 691)
542 597
         Me.ContextMenuStrip = Me.ContextMenuStrip1
598
+        Me.Controls.Add(Me.批量刪除_bt)
599
+        Me.Controls.Add(Me.批量刪除選擇_ch)
600
+        Me.Controls.Add(Me.批輛停用選擇_ch)
601
+        Me.Controls.Add(Me.啟用批改_ch)
602
+        Me.Controls.Add(Me.批量存檔_bt)
543 603
         Me.Controls.Add(Me.下載檔名_tb)
544 604
         Me.Controls.Add(Me.檔名讀取_tb)
545 605
         Me.Controls.Add(Me.下載圖檔_bt)
@@ -621,11 +681,11 @@ Partial Class 物料檔案
621 681
     Friend WithEvents 存檔_bt As Windows.Forms.Button
622 682
     Friend WithEvents 新增準備_bt As Windows.Forms.Button
623 683
     Friend WithEvents ContextMenuStrip1 As Windows.Forms.ContextMenuStrip
624
-    Friend WithEvents 重新整理ToolStripMenuItem As Windows.Forms.ToolStripMenuItem
684
+    Friend WithEvents 重新整理_tsm As Windows.Forms.ToolStripMenuItem
625 685
     Friend WithEvents ToolStripSeparator3 As Windows.Forms.ToolStripSeparator
626
-    Friend WithEvents 新增準備ToolStripMenuItem As Windows.Forms.ToolStripMenuItem
627
-    Friend WithEvents 存檔ToolStripMenuItem As Windows.Forms.ToolStripMenuItem
628
-    Friend WithEvents 刪除ToolStripMenuItem As Windows.Forms.ToolStripMenuItem
686
+    Friend WithEvents 新增準備_tsm As Windows.Forms.ToolStripMenuItem
687
+    Friend WithEvents 存檔_tsm As Windows.Forms.ToolStripMenuItem
688
+    Friend WithEvents 刪除_tsm As Windows.Forms.ToolStripMenuItem
629 689
     Friend WithEvents 下載圖檔_bt As Windows.Forms.Button
630 690
     Friend WithEvents 圖檔入系統_bt As Windows.Forms.Button
631 691
     Friend WithEvents 檔案名稱_tb As Windows.Forms.TextBox
@@ -641,4 +701,9 @@ Partial Class 物料檔案
641 701
     Friend WithEvents 檔名讀取_tb As Windows.Forms.TextBox
642 702
     Friend WithEvents FolderBrowserDialog1 As Windows.Forms.FolderBrowserDialog
643 703
     Friend WithEvents SaveFileDialog1 As Windows.Forms.SaveFileDialog
704
+    Friend WithEvents 批量存檔_bt As Windows.Forms.Button
705
+    Friend WithEvents 啟用批改_ch As Windows.Forms.CheckBox
706
+    Friend WithEvents 批輛停用選擇_ch As Windows.Forms.CheckBox
707
+    Friend WithEvents 批量刪除選擇_ch As Windows.Forms.CheckBox
708
+    Friend WithEvents 批量刪除_bt As Windows.Forms.Button
644 709
 End Class

+ 106
- 13
YD-ERP-SYS/倉儲系統管理/物料檔案.vb Wyświetl plik

@@ -14,13 +14,20 @@ Public Class 物料檔案
14 14
         SQL_物料檔案_清單()
15 15
         da.Fill(ds1) : 物料清單_dgv.DataSource = ds1.Tables(0) : conn.Close()
16 16
 
17
-        物料清單_dgv.Columns("料號").FillWeight = 70 : 物料清單_dgv.Columns("供應商編號").FillWeight = 50 : 物料清單_dgv.Columns("成本").FillWeight = 50
18
-        物料清單_dgv.Columns("品名").FillWeight = 200 : 物料清單_dgv.Columns("停用").FillWeight = 40
17
+        物料清單_dgv.Columns("料號").FillWeight = 70 : 物料清單_dgv.Columns("供應商").FillWeight = 40 : 物料清單_dgv.Columns("成本").FillWeight = 50
18
+        物料清單_dgv.Columns("品名").FillWeight = 170 : 物料清單_dgv.Columns("停用").FillWeight = 40 : 物料清單_dgv.Columns("圖片").FillWeight = 40
19
+        物料清單_dgv.Columns("刪除").FillWeight = 40
19 20
 
20 21
         物料清單_dgv.Columns("成本").DefaultCellStyle.Format = "#,##0"
21 22
         物料清單_dgv.Columns("成本").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
22 23
         物料清單_dgv.Columns("成本").HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
24
+
25
+        物料清單_dgv.Columns("料號").ReadOnly = True : 物料清單_dgv.Columns("供應商").ReadOnly = True : 物料清單_dgv.Columns("成本").ReadOnly = True : 物料清單_dgv.Columns("圖片").ReadOnly = True
23 26
         資料筆數_tb.Text = 物料清單_dgv.Rows.Count
27
+
28
+        For i As Integer = 0 To 物料清單_dgv.Rows.Count - 1
29
+            物料清單_dgv("刪除", i).Value = False
30
+        Next
24 31
     End Sub
25 32
     Private Sub 地區碼_下拉表單資料載入()
26 33
         SQL_地區碼_下拉清單() : 地區_cb.Items.Clear() : 地區編碼_cb.Items.Clear()
@@ -33,12 +40,12 @@ Public Class 物料檔案
33 40
     Private Sub 物料檔案_Load(sender As Object, e As EventArgs) Handles MyBase.Load
34 41
         Me.MdiParent = YD_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
35 42
         地區編碼_cb.Enabled = False : 下載檔名_tb.Visible = False : 檔名讀取_tb.Visible = False : 供應商編碼_tb.Visible = False '--------------------控件隱藏、操作許可設定與其他基本顯示設定
36
-        料號_tb.Enabled = False : 狀態_lb.Text = "預覽狀態"
43
+        料號_tb.Enabled = False : 批量存檔_bt.Enabled = False : 批輛停用選擇_ch.Enabled = False : 批量刪除選擇_ch.Enabled = False : 批量刪除_bt.Enabled = False : 狀態_lb.Text = "預覽狀態"
37 44
 
38 45
         If Val(登入人級別) <= 2 Then '--------------------刪除資料權限
39
-            刪除ToolStripMenuItem.Enabled = True : 刪除_bt.Enabled = True
46
+            刪除_tsm.Enabled = True : 刪除_bt.Enabled = True : 批量刪除_bt.Enabled = True
40 47
         Else
41
-            刪除ToolStripMenuItem.Enabled = False : 刪除_bt.Enabled = False
48
+            刪除_tsm.Enabled = False : 刪除_bt.Enabled = False : 批量刪除_bt.Enabled = False
42 49
         End If
43 50
 
44 51
         地區碼_下拉表單資料載入() : Set_清單() '--------------------資料讀取
@@ -48,12 +55,12 @@ Public Class 物料檔案
48 55
     End Sub
49 56
     Private Sub 供應商資料表_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
50 57
         If 資料新增判斷 = True Then '--------------------如果再關閉介面時,資料新增判斷是開啟的,就無條件刪除控件上的那筆資料
51
-            SQL_物料檔案_刪除() '--------------------資料刪除
58
+            PA20 = 料號_tb.Text : SQL_物料檔案_刪除() '--------------------資料刪除
52 59
         End If
53 60
     End Sub
54 61
     Private Sub 物料清單_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 物料清單_dgv.CellClick
55 62
         If e.RowIndex = -1 Then : Else
56
-            料號_tb.Text = 物料清單_dgv("料號", e.RowIndex).Value.ToString : 供應商編碼_tb.Text = 物料清單_dgv("供應商編號", e.RowIndex).Value.ToString
63
+            料號_tb.Text = 物料清單_dgv("料號", e.RowIndex).Value.ToString : 供應商編碼_tb.Text = 物料清單_dgv("供應商", e.RowIndex).Value.ToString
57 64
             成本_nud.Value = 物料清單_dgv("成本", e.RowIndex).Value : 品名_tb.Text = 物料清單_dgv("品名", e.RowIndex).Value.ToString
58 65
             停用_ch.Checked = 物料清單_dgv("停用", e.RowIndex).Value
59 66
 
@@ -73,6 +80,39 @@ Public Class 物料檔案
73 80
                     物料圖_pb.Image = Nothing
74 81
                 End If
75 82
             End If : conn.Close()
83
+
84
+            If 批輛停用選擇_ch.Checked = True Then '--------------------批輛停用選擇功能
85
+                If 物料清單_dgv("停用", e.RowIndex).Value = False Then
86
+                    物料清單_dgv("停用", e.RowIndex).Value = True
87
+                ElseIf 物料清單_dgv("停用", e.RowIndex).Value = True Then
88
+                    物料清單_dgv("停用", e.RowIndex).Value = False
89
+                End If
90
+            End If
91
+
92
+            If 批量刪除選擇_ch.Checked = True Then '--------------------批輛停用選擇功能
93
+                If 物料清單_dgv("刪除", e.RowIndex).Value = False Then
94
+                    物料清單_dgv("刪除", e.RowIndex).Value = True
95
+                ElseIf 物料清單_dgv("刪除", e.RowIndex).Value = True Then
96
+                    物料清單_dgv("刪除", e.RowIndex).Value = False
97
+                End If
98
+            End If
99
+        End If
100
+    End Sub
101
+    Private Sub 物料清單_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 物料清單_dgv.RowPostPaint
102
+        Dim linePen As New Pen(Color.Blue, 2)
103
+        If e.RowIndex = 物料清單_dgv.Rows.Count - 1 Then : Exit Sub : Else
104
+            If 物料清單_dgv("供應商", e.RowIndex).Value.ToString <> 物料清單_dgv("供應商", e.RowIndex + 1).Value.ToString Then
105
+                Dim startX As Integer = IIf(物料清單_dgv.RowHeadersVisible, 物料清單_dgv.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
106
+                Dim endX As Integer = startX + 物料清單_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 物料清單_dgv.HorizontalScrollingOffset
107
+                e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
108
+            End If
109
+            For i As Integer = 0 To 物料清單_dgv.Rows.Count - 1
110
+                If 物料清單_dgv("圖片", i).Value = True And 物料清單_dgv("停用", i).Value = False Then : 物料清單_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightGoldenrodYellow : End If
111
+                If 物料清單_dgv("圖片", i).Value = False And 物料清單_dgv("停用", i).Value = False Then : 物料清單_dgv.Rows(i).DefaultCellStyle.BackColor = Color.White : End If
112
+                If 物料清單_dgv("停用", i).Value = True Then : 物料清單_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightPink : End If
113
+                If 物料清單_dgv("刪除", i).Value = True Then : 物料清單_dgv.Rows(i).DefaultCellStyle.ForeColor = Color.Red : End If
114
+                If 物料清單_dgv("刪除", i).Value = False Then : 物料清單_dgv.Rows(i).DefaultCellStyle.ForeColor = Color.Black : End If
115
+            Next
76 116
         End If
77 117
     End Sub
78 118
     Private Sub 地區_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 地區_cb.SelectedIndexChanged
@@ -211,6 +251,7 @@ Public Class 物料檔案
211 251
             資料新增判斷 = False '--------------------目前的編輯狀態
212 252
             狀態_lb.Text = "預覽狀態"
213 253
             物料清單_dgv.Enabled = True : 查詢_tb.Enabled = True '--------------------開啟DGV與關鍵字查詢控件的點選控制功能
254
+            NU1 = 成本_nud.Value : PA1 = 品名_tb.Text : BL1 = 停用_ch.Checked : PA2 = 料號_tb.Text
214 255
             SQL_物料檔案_修改() '--------------------資料修改
215 256
             Set_清單() '--------------------資料修改後重新讀取清單
216 257
         End If
@@ -219,21 +260,73 @@ Public Class 物料檔案
219 260
         If 料號_tb.Text = "" Then '--------------------設定條件讓流水號控件不為空
220 261
             MsgBox("沒有選擇要刪除的資料")
221 262
         Else
222
-            SQL_物料檔案_刪除() '--------------------資料刪除
223
-            Set_清單() '--------------------資料修改後重新讀取清單
263
+            Dim aa1 As MsgBoxResult = MsgBox("確定要執行刪除指令嗎?", MsgBoxStyle.OkCancel)
264
+            If aa1 = MsgBoxResult.Ok Then
265
+                PA20 = 料號_tb.Text : SQL_物料檔案_刪除() '--------------------資料刪除
266
+                Set_清單() '--------------------資料修改後重新讀取清單
267
+            End If
268
+        End If
269
+    End Sub
270
+    Private Sub 啟用批改_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 啟用批改_ch.Click
271
+        If 啟用批改_ch.Checked = True Then
272
+            批量存檔_bt.Enabled = True : 新增準備_bt.Enabled = False : 存檔_bt.Enabled = False : 刪除_bt.Enabled = False
273
+            批輛停用選擇_ch.Enabled = True : 啟用批改_ch.Checked = True : 重新整理_tsm.Enabled = False
274
+            新增準備_tsm.Enabled = False : 存檔_tsm.Enabled = False : 刪除_tsm.Enabled = False : 批量刪除選擇_ch.Enabled = True : 批量刪除_bt.Enabled = True
275
+            物料清單_dgv.EditMode = DataGridViewEditMode.EditOnEnter : 狀態_lb.Text = "批改狀態" '--------------------控件隱藏、操作許可設定與其他基本顯示設定
276
+            MsgBox("已啟用批改模式。")
277
+        ElseIf 啟用批改_ch.Checked = False Then
278
+            批量存檔_bt.Enabled = False : 新增準備_bt.Enabled = True : 存檔_bt.Enabled = True : 刪除_bt.Enabled = True
279
+            批輛停用選擇_ch.Enabled = False : 批輛停用選擇_ch.Checked = False : 啟用批改_ch.Checked = False : 重新整理_tsm.Enabled = True
280
+            新增準備_tsm.Enabled = True : 存檔_tsm.Enabled = True : 刪除_tsm.Enabled = True : 批量刪除選擇_ch.Enabled = False : 批量刪除_bt.Enabled = False
281
+            物料清單_dgv.EditMode = DataGridViewEditMode.EditOnF2 : 狀態_lb.Text = "預覽狀態" '--------------------控件隱藏、操作許可設定與其他基本顯示設定
282
+        End If
283
+    End Sub
284
+    Private Sub 批量存檔_bt_Click(sender As Object, e As EventArgs) Handles 批量存檔_bt.Click
285
+        批量存檔_bt.Enabled = False : 新增準備_bt.Enabled = True : 存檔_bt.Enabled = True : 刪除_bt.Enabled = True
286
+        批輛停用選擇_ch.Enabled = False : 批輛停用選擇_ch.Checked = False : 啟用批改_ch.Checked = False : 重新整理_tsm.Enabled = True
287
+        新增準備_tsm.Enabled = True : 存檔_tsm.Enabled = True : 刪除_tsm.Enabled = True : 批量刪除選擇_ch.Enabled = False : 批量刪除_bt.Enabled = False
288
+        物料清單_dgv.EditMode = DataGridViewEditMode.EditOnF2 : 狀態_lb.Text = "預覽狀態" '--------------------控件隱藏、操作許可設定與其他基本顯示設定
289
+
290
+        For i As Integer = 0 To 物料清單_dgv.Rows.Count - 1
291
+            資料數 = 物料清單_dgv.Rows.Count : MyModule1.進度條()
292
+            NU1 = 物料清單_dgv("成本", i).Value : PA1 = 物料清單_dgv("品名", i).Value
293
+            BL1 = 物料清單_dgv("停用", i).Value : PA2 = 物料清單_dgv("料號", i).Value
294
+            SQL_物料檔案_修改() '--------------------資料修改
295
+        Next : conn.Close : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
296
+
297
+        MsgBox("存檔完成。")
298
+    End Sub
299
+    Private Sub 批量刪除_bt_Click(sender As Object, e As EventArgs) Handles 批量刪除_bt.Click
300
+        If 批量刪除選擇_ch.Checked = False Then
301
+            MsgBox("批量刪除選擇的功能要先打勾,並正確選擇要刪除的料號。")
302
+        Else
303
+            Dim aa1 As MsgBoxResult = MsgBox("確定要執行刪除指令嗎?", MsgBoxStyle.OkCancel)
304
+            If aa1 = MsgBoxResult.Ok Then
305
+                批量存檔_bt.Enabled = False : 新增準備_bt.Enabled = True : 存檔_bt.Enabled = True : 刪除_bt.Enabled = True
306
+                批輛停用選擇_ch.Enabled = False : 批輛停用選擇_ch.Checked = False : 啟用批改_ch.Checked = False : 重新整理_tsm.Enabled = True
307
+                新增準備_tsm.Enabled = True : 存檔_tsm.Enabled = True : 刪除_tsm.Enabled = True : 批量刪除選擇_ch.Enabled = False : 批量刪除_bt.Enabled = False
308
+                物料清單_dgv.EditMode = DataGridViewEditMode.EditOnF2 : 狀態_lb.Text = "預覽狀態" '--------------------控件隱藏、操作許可設定與其他基本顯示設定
309
+
310
+                For i As Integer = 0 To 物料清單_dgv.Rows.Count - 1
311
+                    資料數 = 物料清單_dgv.Rows.Count : MyModule1.進度條()
312
+                    PA20 = 物料清單_dgv("料號", i).Value : SQL_物料檔案_刪除() '--------------------資料刪除
313
+                Next : conn.Close() : YD_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
314
+
315
+                MsgBox("刪除完成。") : Set_清單() '--------------------資料修改後重新讀取清單
316
+            End If
224 317
         End If
225 318
     End Sub
226 319
     '-------------------滑鼠右鍵-------------------------------------------------------------------------------------------------------------------------------------------------------------------
227
-    Private Sub 重新整理ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 重新整理ToolStripMenuItem.Click
320
+    Private Sub 重新整理_tsm_Click(sender As Object, e As EventArgs) Handles 重新整理_tsm.Click
228 321
         地區碼_下拉表單資料載入() : 供應商_cb.Items.Clear() : 供應商編碼_cb.Items.Clear() : 查詢_tb.Text = "" : Set_清單()
229 322
     End Sub
230
-    Private Sub 新增準備ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 新增準備ToolStripMenuItem.Click
323
+    Private Sub 新增準備_tsm_Click(sender As Object, e As EventArgs) Handles 新增準備_tsm.Click
231 324
         新增準備_bt.PerformClick()
232 325
     End Sub
233
-    Private Sub 存檔ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 存檔ToolStripMenuItem.Click
326
+    Private Sub 存檔_tsm_Click(sender As Object, e As EventArgs) Handles 存檔_tsm.Click
234 327
         存檔_bt.PerformClick()
235 328
     End Sub
236
-    Private Sub 刪除ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 刪除ToolStripMenuItem.Click
329
+    Private Sub 刪除_tsm_Click(sender As Object, e As EventArgs) Handles 刪除_tsm.Click
237 330
         刪除_bt.PerformClick()
238 331
     End Sub
239 332
 End Class

+ 5
- 2
YD-ERP-SYS/採購系統管理/供應商資料表.vb Wyświetl plik

@@ -141,8 +141,11 @@ Public Class 供應商資料表
141 141
         If 編號_tb.Text = "" Then '--------------------設定條件讓流水號控件不為空
142 142
             MsgBox("沒有選擇要刪除的資料")
143 143
         Else
144
-            SQL_供應商資料表_刪除() '--------------------資料刪除
145
-            Set_清單() '--------------------資料修改後重新讀取清單
144
+            Dim aa1 As MsgBoxResult = MsgBox("確定要執行刪除指令嗎?", MsgBoxStyle.OkCancel)
145
+            If aa1 = MsgBoxResult.Ok Then
146
+                SQL_供應商資料表_刪除() '--------------------資料刪除
147
+                Set_清單() '--------------------資料修改後重新讀取清單
148
+            End If
146 149
         End If
147 150
     End Sub
148 151
     '-------------------滑鼠右鍵-------------------------------------------------------------------------------------------------------------------------------------------------------------------

+ 5
- 2
YD-ERP-SYS/業務系統管理/客戶資料表.vb Wyświetl plik

@@ -120,8 +120,11 @@ Public Class 客戶資料表
120 120
         If 流水號_tb.Text = "" Then '--------------------設定條件讓流水號控件不為空
121 121
             MsgBox("沒有選擇要刪除的資料")
122 122
         Else
123
-            SQL_客戶資料表_刪除() '--------------------資料刪除
124
-            Set_清單() '--------------------資料修改後重新讀取清單
123
+            Dim aa1 As MsgBoxResult = MsgBox("確定要執行刪除指令嗎?", MsgBoxStyle.OkCancel)
124
+            If aa1 = MsgBoxResult.Ok Then
125
+                SQL_客戶資料表_刪除() '--------------------資料刪除
126
+                Set_清單() '--------------------資料修改後重新讀取清單
127
+            End If
125 128
         End If
126 129
     End Sub
127 130
     '-------------------滑鼠右鍵-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Ładowanie…
Anuluj
Zapisz