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

📄 frm_yggl.frm

📁 中小型企业员工管理系统 教程 教程 教程 教程 教程
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Frm_yggl 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "员工信息管理"
   ClientHeight    =   4545
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7575
   LinkTopic       =   "Form2"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4545
   ScaleWidth      =   7575
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_save 
      Caption         =   "保存"
      Enabled         =   0   'False
      Height          =   375
      Left            =   6600
      TabIndex        =   22
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmd_edit 
      Caption         =   "修改"
      Enabled         =   0   'False
      Height          =   375
      Left            =   5760
      TabIndex        =   21
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmd_del 
      Caption         =   "删除"
      Enabled         =   0   'False
      Height          =   375
      Left            =   4920
      TabIndex        =   20
      Top             =   4080
      Width           =   855
   End
   Begin VB.CommandButton cmd_add 
      Caption         =   "添加"
      Enabled         =   0   'False
      Height          =   375
      Left            =   4080
      TabIndex        =   19
      Top             =   4080
      Width           =   855
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   120
      Top             =   4920
      Width           =   3615
      _ExtentX        =   6376
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Frame Frame1 
      Caption         =   "员工基本信息"
      Height          =   1695
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   7335
      Begin VB.ComboBox Combo3 
         Height          =   300
         ItemData        =   "Frm_yggl.frx":0000
         Left            =   5040
         List            =   "Frm_yggl.frx":0019
         Style           =   2  'Dropdown List
         TabIndex        =   14
         Top             =   720
         Width           =   2055
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         ItemData        =   "Frm_yggl.frx":0049
         Left            =   3240
         List            =   "Frm_yggl.frx":005F
         Style           =   2  'Dropdown List
         TabIndex        =   13
         Top             =   720
         Width           =   975
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "Frm_yggl.frx":008B
         Left            =   4920
         List            =   "Frm_yggl.frx":0095
         Style           =   2  'Dropdown List
         TabIndex        =   12
         Top             =   240
         Width           =   735
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   5
         Left            =   3240
         TabIndex        =   11
         Top             =   1200
         Width           =   3855
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   4
         Left            =   960
         TabIndex        =   10
         Top             =   1200
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   3
         Left            =   960
         TabIndex        =   9
         Top             =   720
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   2
         Left            =   6240
         TabIndex        =   8
         Top             =   240
         Width           =   855
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   1
         Left            =   3240
         TabIndex        =   7
         Top             =   240
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   0
         Left            =   960
         TabIndex        =   6
         Top             =   240
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "年龄"
         Height          =   255
         Index           =   3
         Left            =   5760
         TabIndex        =   18
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "性别"
         Height          =   255
         Index           =   2
         Left            =   4440
         TabIndex        =   17
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "员工姓名"
         Height          =   255
         Index           =   1
         Left            =   2400
         TabIndex        =   16
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "员工编号"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   15
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "现住址"
         Height          =   255
         Index           =   8
         Left            =   2400
         TabIndex        =   5
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "联系电话"
         Height          =   255
         Index           =   7
         Left            =   120
         TabIndex        =   4
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "职称"
         Height          =   255
         Index           =   6
         Left            =   4440
         TabIndex        =   3
         Top             =   840
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "文化程度"
         Height          =   255
         Index           =   5
         Left            =   2400
         TabIndex        =   2
         Top             =   840
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "籍贯"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   1
         Top             =   840
         Width           =   855
      End
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "Frm_yggl.frx":00A1
      Height          =   2160
      Left            =   120
      TabIndex        =   23
      Top             =   1845
      Width           =   7320
      _ExtentX        =   12912
      _ExtentY        =   3810
      _Version        =   393216
      AllowUpdate     =   0   'False
      AllowArrows     =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "Frm_yggl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_add_Click()
  Cmd_Add.Enabled = False
  cmd_save.Enabled = True
  '清空文本框数组中的内容
  For i = 0 To 5
    Text1(i).Text = ""
  Next i
  Text1(0).SetFocus
End Sub

Private Sub cmd_del_Click()
   c = MsgBox("确认要删除该信息吗", 17, "提示信息")
      If c = vbOK Then
         On Error Resume Next
         Set DB_AdoRs = Cnn.Execute("Delete 员工信息 from 员工信息 where 员工编号='" + Text1(0).Text + "'")
         '删除后刷新数据信息
         Adodc1.RecordSource = "select * from 员工信息 order by 员工编号"
         Adodc1.Refresh
      End If
      For i = 0 To 5
         Text1(i).Text = ""
      Next i
End Sub

Private Sub cmd_edit_Click()
  c = MsgBox("确认修改信息吗", 33, "提示信息")
  If c = vbOK Then
      Set DB_AdoRs = Cnn.Execute("UPDATE 员工信息 SET 员工姓名='" + Text1(1) + "',性别='" + Combo1.Text + "',年龄='" + Text1(2) + "',籍贯='" _
      + Text1(3) + "',文化程度='" + Combo2.Text + "',职称='" + Combo3.Text + "',联系电话='" + Text1(4) + "',现住址='" + Text1(5) + "' where 员工编号='" + Text1(0).Text + "'")
      MsgBox "数据修改成功", 64, "提示信息"
      Adodc1.RecordSource = "select * from 员工信息 order by 员工编号"
      Adodc1.Refresh
  End If
End Sub

Private Sub cmd_save_Click()
  If Text1(1).Text = "" Or Text1(3).Text = "" Then
      MsgBox "保存的数据信息不能为空", 48, "提示信息"
  Else
    DB_AdoRs.Open "select * from 员工信息 where 员工编号='" + Text1(0).Text + "'", Cnn, adOpenKeyset
      If DB_AdoRs.RecordCount > 0 Then                   '判断要保存的信息是否已经存在
           MsgBox "该员工的基本信息已经存在", 48, "提示信息"
           DB_AdoRs.Close
      Else
           DB_AdoRs.Close
         c = MsgBox("确认保存信息吗", 33, "提示信息")
           If c = vbOK Then                           '如果选择的是“确定”按钮则保存信息
             Set DB_AdoRs = Cnn.Execute("insert into 员工信息 values('" & Text1(0) & "','" & Text1(1) & "','" & Combo1.Text & "','" & Text1(2) & "','" & Text1(3) & "','" _
              & Combo2.Text & "','" & Combo3.Text & "','" & Text1(4) & "','" & Text1(5) & "')")
             MsgBox "员工信息数据保存成功", 64, "提示信息"
             cmd_save.Enabled = False
             Cmd_Add.Enabled = True
         Else
         End If
            Adodc1.RecordSource = "select * from 员工信息 order by 员工编号"
            Adodc1.Refresh
      End If
  End If
End Sub

Private Sub DataGrid1_Click()
   On Error Resume Next
   If Adodc1.Recordset.RecordCount > 0 Then
        Text1(0).Text = Adodc1.Recordset.Fields("员工编号")
        Text1(1).Text = Adodc1.Recordset.Fields("员工姓名")
        Combo1.Text = Adodc1.Recordset.Fields("性别")
        Text1(2).Text = Adodc1.Recordset.Fields("年龄")
        Text1(3).Text = Adodc1.Recordset.Fields("籍贯")
        Combo2.Text = Adodc1.Recordset.Fields("文化程度")
        Combo3.Text = Adodc1.Recordset.Fields("职称")
        Text1(4).Text = Adodc1.Recordset.Fields("联系电话")
        Text1(5).Text = Adodc1.Recordset.Fields("现住址")
    End If
End Sub

Private Sub Form_Load()
   Adodc1.ConnectionString = MyStrs
   Adodc1.RecordSource = "select * from 员工信息 order by 员工编号"
   Adodc1.Refresh
End Sub

⌨️ 快捷键说明

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