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

📄 frmdepedit.frm

📁 这是一个利用VB编写的中小企业ERP。功能比较全
💻 FRM
字号:
Version 5.00
Begin VB.Form FrmDepEdit
    BorderStyle = 1 'Fixed Single
    Caption = "编辑部门信息"
    ClientHeight = 3120
    ClientLeft = 45
    ClientTop = 330
    ClientWidth = 4575
    Icon = "FrmDepEdit.frx":0000
    LinkTopic = "Form1"
    MaxButton = 0 'False
    MinButton = 0 'False
    ScaleHeight = 3120
    ScaleWidth = 4575
    StartUpPosition = 2 'CenterScreen
    Begin VB.Frame Frame1
        Height = 2415
        Left = 120
        TabIndex = 4
        Top = 120
        Width = 4335
        Begin VB.TextBox txtDep
            Height = 270
            Left = 1200
            MaxLength = 20
            TabIndex = 0
            Top = 795
            Width = 2895
        End
        Begin VB.TextBox txtDescribe
            Height = 855
            Left = 1200
            MultiLine = -1 'True
            ScrollBars = 2 'Vertical
            TabIndex = 1
            Top = 1320
            Width = 2895
        End
        Begin VB.Label Label2
            AutoSize = -1 'True
            BackColor = &H00FFC0C0&
            BackStyle = 0 'Transparent
            Caption = "部门名称"
            BeginProperty Font
            Name = "宋体"
            Size = 12
            Charset = 0
            Weight = 700
            Underline = 0 'False
            Italic = 0 'False
            Strikethrough = 0 'False
            EndProperty
            Height = 240
            Left = 120
            TabIndex = 8
            Top = 840
            Width = 1020
        End
        Begin VB.Label Label1
            AutoSize = -1 'True
            BackColor = &H00FFC0C0&
            BackStyle = 0 'Transparent
            Caption = "上级部门"
            BeginProperty Font
            Name = "宋体"
            Size = 12
            Charset = 0
            Weight = 700
            Underline = 0 'False
            Italic = 0 'False
            Strikethrough = 0 'False
            EndProperty
            Height = 240
            Left = 120
            TabIndex = 7
            Top = 360
            Width = 1020
        End
        Begin VB.Label lblUpper
            AutoSize = -1 'True
            BackColor = &H00FFC0C0&
            BackStyle = 0 'Transparent
            Caption = "上级部门"
            Height = 180
            Left = 1200
            TabIndex = 6
            Top = 360
            Width = 720
        End
        Begin VB.Label Label3
            AutoSize = -1 'True
            BackColor = &H00FFC0C0&
            BackStyle = 0 'Transparent
            Caption = "功能描述"
            BeginProperty Font
            Name = "宋体"
            Size = 12
            Charset = 0
            Weight = 700
            Underline = 0 'False
            Italic = 0 'False
            Strikethrough = 0 'False
            EndProperty
            Height = 240
            Left = 120
            TabIndex = 5
            Top = 1320
            Width = 1020
        End
    End
    Begin VB.Image Image4
        Height = 300
        Left = 2640
        Picture = "FrmDepEdit.frx":0CCA
        Top = 2640
        Width = 300
    End
    Begin VB.Label LblCancel
        BackStyle = 0 'Transparent
        Caption = "取 消"
        BeginProperty Font
        Name = "宋体"
        Size = 12
        Charset = 0
        Weight = 700
        Underline = 0 'False
        Italic = 0 'False
        Strikethrough = 0 'False
        EndProperty
        Height = 255
        Left = 3240
        MouseIcon = "FrmDepEdit.frx":10E6
        MousePointer = 99 'Custom
        TabIndex = 3
        Top = 2640
        Width = 855
    End
    Begin VB.Image Image3
        Height = 300
        Left = 600
        Picture = "FrmDepEdit.frx":13F0
        Top = 2640
        Width = 300
    End
    Begin VB.Label LblOK
        BackStyle = 0 'Transparent
        Caption = "确 定"
        BeginProperty Font
        Name = "宋体"
        Size = 12
        Charset = 0
        Weight = 700
        Underline = 0 'False
        Italic = 0 'False
        Strikethrough = 0 'False
        EndProperty
        Height = 255
        Left = 1200
        MouseIcon = "FrmDepEdit.frx":180C
        MousePointer = 99 'Custom
        TabIndex = 2
        Top = 2640
        Width = 735
    End
End
Attribute VB_Name = "FrmDepEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean

Private Sub LblCancel_Click()
    Unload Me
End Sub

Private Sub LblOK_Click()
    If Trim(txtDep) = "" Then
        MsgBox "请输入部门名称"
        Exit Sub
    End If
    '将新输入的数据保存到类变量中
    With MyDep
        .Dep_name = MakeStr(txtDep)
        .Describe = MakeStr(txtDescribe)
        
        If Modify = False Then '插入
            If .In_DB(.Dep_name, .UpperId) = True Then
                MsgBox Trim(txtDep) + " 已经存在"
                Exit Sub
            End If
            'CurDep中保存在部门管理窗体中选中的部门信息
            '当插入新记录时,新记录将做为当前部门的下级部门
            .UpperId = CurDep.Dep_Id
            Bh = .Insert
            '生成TreeView中一个结点的关键字
            Tmp_Key = "a" + Trim(Str(Bh))
            '设置结点的图像
            FrmDepMan.TreeView1.SelectedItem.Image = 1
            FrmDepMan.TreeView1.SelectedItem.ExpandedImage = 2
            FrmDepMan.TreeView1.SelectedItem.SelectedImage = 3
            '在树中添加一个结点
            Set TmpNode = FrmDepMan.TreeView1.Nodes.Add(FrmDepMan.TreeView1.SelectedItem.Key, _
                          tvwChild, Tmp_Key, .Dep_name, 4, 5)
            TmpNode.Selected = True
        Else '修改
            If CurDep.Dep_name <> Trim(txtDep) Then
                If .In_DB(Trim(txtDep), .UpperId) = True Then
                    MsgBox Trim(txtDep) + " 已经存在"
                    Exit Sub
                End If
            End If
            '当修改记录时,不能改变上下级之间的关系
            .UpperId = CurDep.UpperId
            .Update (CurDep.Dep_Id)
            If CurDep.Dep_name <> Trim(txtDep) Then
                FrmDepMan.TreeView1.SelectedItem.Text = Trim(txtDep)
            End If
            '设置CurDep变量
            CurDep.Dep_name = Trim(txtDep)
        End If
    End With
    '关闭窗口
    Unload Me
End Sub

Private Sub txtDep_KeyPress(KeyAscii As Integer)
    EnterTAB (KeyAscii)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -