?? frmprotypeman.frm
字號:
VERSION 5.00
Begin VB.Form frmprotypeman
BorderStyle = 1 'Fixed Single
Caption = "產品類目管理"
ClientHeight = 5580
ClientLeft = 45
ClientTop = 330
ClientWidth = 6420
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5580
ScaleWidth = 6420
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_back
Caption = "返回"
Height = 495
Left = 5040
TabIndex = 7
Top = 4680
Width = 1215
End
Begin VB.CommandButton cmd_del
Caption = "刪除"
Height = 495
Left = 5040
TabIndex = 6
Top = 3480
Width = 1215
End
Begin VB.CommandButton cmd_modi
Caption = "修改"
Height = 495
Left = 5040
TabIndex = 5
Top = 2400
Width = 1215
End
Begin VB.CommandButton cmd_add
Caption = "添加"
Height = 495
Left = 5040
TabIndex = 4
Top = 1200
Width = 1215
End
Begin VB.ListBox List2
Height = 4020
Left = 2640
TabIndex = 3
Top = 1200
Width = 2175
End
Begin VB.ListBox List1
Height = 4020
Left = 360
TabIndex = 2
Top = 1200
Width = 2175
End
Begin VB.OptionButton Option2
Caption = "編輯二級類目"
Height = 495
Left = 2640
TabIndex = 1
Top = 360
Width = 1935
End
Begin VB.OptionButton Option1
Caption = "編輯一級類目"
Height = 495
Left = 360
TabIndex = 0
Top = 360
Width = 1695
End
End
Attribute VB_Name = "frmprotypeman"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Id1, Id2 As Integer
Private Sub Load_Type1()
List1.Clear
MyProType.Load_by_Upper (0)
i = 0
Do While Arr_ProType(i) <> ""
List1.AddItem Arr_ProType(i)
i = i + 1
Loop
If List1.ListCount > 0 Then
List1.ListIndex = 0
End If
End Sub
Private Sub Load_Type2()
List2.Clear
MyProType.Load_by_Upper (Id1)
i = 0
Do While Arr_ProType(i) <> ""
List2.AddItem Arr_ProType(i)
i = i + 1
Loop
If List2.ListCount > 0 Then
List2.ListIndex = 0
End If
End Sub
Private Sub Cmd_Add_Click()
If Option1.Value = False And List1.ListIndex < 0 Then
MsgBox "請選擇上級類目"
Exit Sub
End If
If Option1.Value = True Then
frmprotypeedit.OriUpper = 0
frmprotypeedit.lblUpper = ""
Else
frmprotypeedit.OriUpper = Id1
frmprotypeedit.lblUpper = List1.Text
End If
frmprotypeedit.Modify = False
frmprotypeedit.Show 1
Load_Type1
Load_Type2
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub Cmd_Del_Click()
Dim TmpId As Long
If (Option1.Value = True And List1.ListIndex < 0) _
Or (Option2.Value = True And List2.ListIndex < 0) Then
MsgBox "請選擇要刪除的類目"
Exit Sub
End If
If Option1.Value = True Then
TmpId = Id1
Else
TmpId = Id2
End If
'判斷一級類目是否包含子類目
If Option1.Value = True Then
If MyProType.HaveSon(TmpId) = True Then
MsgBox "此類目包含子類目,不能刪除"
Exit Sub
End If
End If
'判斷類目中是否包含產品
If MyPro.HaveType(TmpId) = True Or _
MyPro.HaveType(TmpId) = True Then
MsgBox "此類目中包含產品,不能刪除"
Exit Sub
End If
'確認刪除
If MsgBox("是否刪除此類目?", vbYesNo, "請確認") = vbYes Then
MyProType.Delete (TmpId)
Load_Type1
Load_Type2
End If
End Sub
Private Sub Cmd_Modi_Click()
If (Option1.Value = True And List1.ListIndex < 0) _
Or (Option2.Value = True And List2.ListIndex < 0) Then
MsgBox "請選擇要修改的類目"
Exit Sub
End If
If Option1.Value = True Then
frmprotypeedit.OriUpper = 0
frmprotypeedit.OriId = Id1
frmprotypeedit.OriName = List1.Text
frmprotypeedit.lblUpper = ""
frmprotypeedit.txtTypeName = List1.Text
Else
frmprotypeedit.OriUpper = Id1
frmprotypeedit.OriId = Id2
frmprotypeedit.OriName = List2.Text
frmprotypeedit.lblUpper = List1.Text
frmprotypeedit.txtTypeName = List2.Text
End If
frmprotypeedit.Modify = True
frmprotypeedit.Show 1
Load_Type1
Load_Type2
End Sub
Private Sub Form_Load()
Option1.Value = True
Load_Type1
End Sub
Private Sub List1_Click()
Id1 = MyProType.GetId(MakeStr(List1.Text))
Load_Type2
End Sub
Private Sub List2_Click()
Id2 = MyProType.GetId(MakeStr(List2.Text))
End Sub
Private Sub Option1_Click()
List2.Enabled = False
End Sub
Private Sub Option2_Click()
List2.Enabled = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -