-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathView Process.frm
339 lines (323 loc) · 11.6 KB
/
View Process.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "MSCOMCTL.OCX"
Begin VB.Form ViewProcess
Caption = "Select Process to View"
ClientHeight = 6510
ClientLeft = 60
ClientTop = 345
ClientWidth = 10140
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6510
ScaleWidth = 10140
WindowState = 2 'Maximized
Begin VB.CommandButton Command3
Caption = "Command3"
Height = 675
Left = 6960
TabIndex = 10
Top = 4920
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "Filter Results"
Height = 615
Left = 5520
TabIndex = 4
Top = 3960
Width = 1455
End
Begin VB.ComboBox PartListCombo
Height = 315
Left = 3120
Style = 2 'Dropdown List
TabIndex = 3
Top = 4200
Width = 2295
End
Begin VB.ComboBox PlantListCombo
Height = 315
ItemData = "View Process.frx":0000
Left = 360
List = "View Process.frx":0002
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 4200
Width = 2535
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "Cancel"
Height = 615
Left = 7080
TabIndex = 1
Top = 3960
Width = 1455
End
Begin MSComctlLib.ListView ListView1
Height = 3495
Left = 0
TabIndex = 0
Top = 0
Width = 7695
_ExtentX = 13573
_ExtentY = 6165
View = 3
Arrange = 1
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
AllowReorder = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 7
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "ID"
Object.Width = 0
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Customer"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Part Family"
Object.Width = 10760
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Operation Description"
Object.Width = 6174
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "Op Number"
Object.Width = 3528
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Text = "Approved"
Object.Width = 0
EndProperty
BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 6
Text = "Obsolete"
Object.Width = 0
EndProperty
End
Begin VB.Label Label3
Caption = "Obsolete"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 14160
TabIndex = 8
Top = 9600
Width = 1815
End
Begin VB.Label Label2
Caption = "Approved and Active"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 9480
TabIndex = 7
Top = 9600
Width = 1815
End
Begin VB.Shape Shape3
FillColor = &H00C0C0C0&
FillStyle = 0 'Solid
Height = 375
Left = 13440
Top = 9480
Width = 615
End
Begin VB.Shape Shape2
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 375
Left = 11400
Top = 9480
Width = 615
End
Begin VB.Shape Shape1
FillColor = &H00008000&
FillStyle = 0 'Solid
Height = 375
Left = 8760
Top = 9480
Width = 615
End
Begin VB.Label Label1
Caption = "Part Number:"
Height = 255
Left = 3120
TabIndex = 6
Top = 3960
Width = 2055
End
Begin VB.Label Plant_Label
Caption = "Plant:"
Height = 255
Left = 360
TabIndex = 5
Top = 3960
Width = 2055
End
Begin VB.Label Label4
Caption = "Not Approved"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 12120
TabIndex = 9
Top = 9600
Width = 1815
End
End
Attribute VB_Name = "ViewProcess"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If (PlantListCombo.Text = "" Or PlantListCombo.Text = "All") And (PartListCombo.Text = "" Or PartListCombo.Text = "All") Then
openSQLStatement = "SELECT * FROM [TOOLLIST MASTER] WHERE [TOOLLIST MASTER].REVOFPROCESSID = 0 ORDER BY CUSTOMER, PARTFAMILY, OPERATIONDESCRIPTION"
ElseIf (PlantListCombo.Text = "" Or PlantListCombo.Text = "All") And (PartListCombo.Text <> "" And PartListCombo.Text <> "All") Then
openSQLStatement = "SELECT [TOOLLIST MASTER].PROCESSID, CUSTOMER, " & _
"PARTFAMILY, OPERATIONDESCRIPTION, OPERATIONNUMBER, PLANT, RELEASED, OBSOLETE FROM " & _
"[TOOLLIST MASTER],[TOOLLIST PLANT],[TOOLLIST PARTNUMBERS] " & _
"WHERE [TOOLLIST MASTER].PROCESSID = [TOOLLIST PARTNUMBERS].PROCESSID " & _
"AND [TOOLLIST MASTER].PROCESSID = [TOOLLIST PLANT].PROCESSID AND " & _
"PARTNUMBERS = '" + Trim(PartListCombo.Text) + "' AND [TOOLLIST MASTER].REVOFPROCESSID = 0 ORDER BY CUSTOMER, PARTFAMILY, OPERATIONDESCRIPTION"
ElseIf (PartListCombo.Text = "" Or PartListCombo.Text = "All") And (PlantListCombo.Text <> "" And PlantListCombo.Text <> "All") Then
openSQLStatement = "SELECT DISTINCT [TOOLLIST MASTER].PROCESSID, CUSTOMER, " & _
"PARTFAMILY, OPERATIONDESCRIPTION, OPERATIONNUMBER, PLANT, RELEASED, OBSOLETE FROM " & _
"[TOOLLIST MASTER],[TOOLLIST PLANT],[TOOLLIST PARTNUMBERS] " & _
"WHERE [TOOLLIST MASTER].PROCESSID = [TOOLLIST PARTNUMBERS].PROCESSID " & _
"AND [TOOLLIST MASTER].PROCESSID = [TOOLLIST PLANT].PROCESSID AND " & _
"PLANT = " + Trim(PlantListCombo.Text) + " AND [TOOLLIST MASTER].REVOFPROCESSID = 0 ORDER BY CUSTOMER, PARTFAMILY, OPERATIONDESCRIPTION"
Else
openSQLStatement = "SELECT [TOOLLIST MASTER].PROCESSID, CUSTOMER, " & _
"PARTFAMILY, OPERATIONDESCRIPTION, OPERATIONNUMBER, PLANT, RELEASED, OBSOLETE FROM " & _
"[TOOLLIST MASTER],[TOOLLIST PLANT],[TOOLLIST PARTNUMBERS] " & _
"WHERE [TOOLLIST MASTER].PROCESSID = [TOOLLIST PARTNUMBERS].PROCESSID " & _
"AND [TOOLLIST MASTER].PROCESSID = [TOOLLIST PLANT].PROCESSID AND " & _
"PLANT = " + Trim(PlantListCombo.Text) + " AND PARTNUMBERS = '" + Trim(PartListCombo.Text) + "' AND [TOOLLIST MASTER].REVOFPROCESSID = 0 ORDER BY CUSTOMER, PARTFAMILY, OPERATIONDESCRIPTION"
End If
ViewProcesses
End Sub
Private Sub Command2_Click()
ViewProcess.ListView1.ListItems.Clear
ViewProcess.Hide
MDIForm1.RefreshMenuOptions
End Sub
Private Sub Form_Resize()
ListView1.Top = 0
ListView1.Left = 0
If ScaleHeight > 750 Then
ListView1.Height = ScaleHeight - 750
End If
ListView1.Width = ScaleWidth
Command3.Top = ScaleHeight - 650
Command2.Top = ScaleHeight - 650
Command1.Top = ScaleHeight - 650
Label1.Top = ScaleHeight - 650
Label2.Top = ScaleHeight - 650
Label3.Top = ScaleHeight - 650
Label4.Top = ScaleHeight - 650
Shape1.Top = ScaleHeight - 650
Shape2.Top = ScaleHeight - 650
Shape3.Top = ScaleHeight - 650
Plant_Label.Top = ScaleHeight - 650
PlantListCombo.Top = ScaleHeight - 450
PartListCombo.Top = ScaleHeight - 450
End Sub
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As ColumnHeader)
oddEvenSort = oddEvenSort + 1
If oddEvenSort Mod 2 > 0 Then
ListView1.SortOrder = lvwAscending
Else
ListView1.SortOrder = lvwDescending
End If
ListView1.SortKey = ColumnHeader.Index - 1
ListView1.Sorted = True
End Sub
Private Sub ListView1_DblClick()
ProgressBar.Show
ProgressBar.Timer1.Enabled = False
DoEvents
Reset
WorkingLive = True
reportViewed = True
If ListView1.SelectedItem Is Nothing Then
Exit Sub
End If
processId = Val(ListView1.SelectedItem.Text)
OpenCRViewer (processId)
MDIForm1.CloseToolList.Enabled = True
ProgressBar.Hide
ProgressBar.Timer1.Enabled = False
End Sub
Public Sub SortByCustomer()
If oddEvenSort Mod 2 = 0 Or oddEvenSort = 0 Then
ListView1_ColumnClick ListView1.ColumnHeaders(2)
End If
End Sub
Private Sub ListView1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim i As Integer
If KeyCode = vbKeyReturn Then
If Not IsNull(ListView1.SelectedItem) Then
ListView1_DblClick
End If
End If
i = 1
While i <= ListView1.ListItems.Count
If ListView1.ListItems.Item(i).SubItems(1) <> "" Then
If Asc(Left(ListView1.ListItems.Item(i).SubItems(1), 1)) = KeyCode Then
ListView1.ListItems.Item(i).Selected = True
ListView1.ListItems.Item(i).EnsureVisible
Exit Sub
End If
End If
i = i + 1
Wend
End Sub