⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmprotypeman.frm

📁 电脑销售管理系统是典型的信息管理系统(MIS)
💻 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 + -