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

📄 frm_gzgl.frm

📁 中小型企业员工管理系统 教程 教程 教程 教程 教程
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_gzgl 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "员工工资调整"
   ClientHeight    =   2820
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5535
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2820
   ScaleWidth      =   5535
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   165
      Top             =   2445
      Visible         =   0   'False
      Width           =   2325
      _ExtentX        =   4101
      _ExtentY        =   582
      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.CommandButton cmd_cancel 
      Caption         =   "取消"
      Height          =   345
      Left            =   4425
      TabIndex        =   16
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton cmd_ok 
      Caption         =   "确定调整"
      Height          =   345
      Left            =   3465
      TabIndex        =   15
      Top             =   2400
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Height          =   2265
      Left            =   135
      TabIndex        =   0
      Top             =   90
      Width           =   5280
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   5
         Left            =   3585
         TabIndex        =   14
         Top             =   1650
         Width           =   1440
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   4
         Left            =   1065
         TabIndex        =   13
         Top             =   1650
         Width           =   1440
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   3
         Left            =   3585
         TabIndex        =   12
         Top             =   1185
         Width           =   1440
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   2
         Left            =   1065
         TabIndex        =   11
         Top             =   1185
         Width           =   1440
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   1
         Left            =   3585
         TabIndex        =   10
         Top             =   705
         Width           =   1440
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   0
         Left            =   1065
         TabIndex        =   4
         Top             =   705
         Width           =   1440
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1065
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   195
         Width           =   1440
      End
      Begin VB.Label Label7 
         Caption         =   "出差补助"
         Height          =   240
         Left            =   2715
         TabIndex        =   9
         Top             =   1680
         Width           =   735
      End
      Begin VB.Label Label6 
         Caption         =   "项目奖金"
         Height          =   240
         Left            =   225
         TabIndex        =   8
         Top             =   1680
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "津贴"
         Height          =   240
         Left            =   2715
         TabIndex        =   7
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "伙食补助"
         Height          =   240
         Left            =   210
         TabIndex        =   6
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "奖金"
         Height          =   240
         Left            =   2715
         TabIndex        =   5
         Top             =   735
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "基本工资"
         Height          =   240
         Left            =   210
         TabIndex        =   3
         Top             =   735
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "员工姓名"
         Height          =   300
         Left            =   195
         TabIndex        =   1
         Top             =   270
         Width           =   1020
      End
   End
End
Attribute VB_Name = "Frm_gzgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub cmd_ok_Click()
  Adodc1.ConnectionString = MyStrs
  Adodc1.RecordSource = "select * from 工资信息 where 员工编号='" + YgNums + "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then   '修改信息
    c = MsgBox("确认调整该员工的工资信息吗", 33, "提示信息")
      If c = vbOK Then
          Set DB_AdoRs = Cnn.Execute("UPDATE 工资信息 SET 基本工资='" + Text1(0) + "',奖金='" + Text1(1) + "',伙食补助='" _
          + Text1(2) + "',津贴='" + Text1(3) + "',项目奖金='" + Text1(4) + "',出差补助='" + Text1(5) + "' where 员工编号='" + YgNums + "'")
          MsgBox "成功调整", 64, "提示信息"
      End If
  Else    '保存信息
    c = MsgBox("该员工的工资信息不存在,确认保存吗", 33, "提示信息")
      If c = vbOK Then
        Set DB_AdoRs = Cnn.Execute("insert into 工资信息 values('" & YgNums & "','" & Text1(0) & "','" & Text1(1) & "','" & Text1(2) & "','" & Text1(3) & "','" _
          & Text1(4) & "','" & Text1(5) & "')")
        MsgBox "员工工资信息保存成功", 64, "提示信息"
      End If
  End If
End Sub

Private Sub Combo1_Click()
  '获得员工编号
  Adodc1.ConnectionString = MyStrs
  Adodc1.RecordSource = "select * from 员工信息 where 员工姓名='" + Combo1.Text + "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
    YgNums = Adodc1.Recordset.Fields("员工编号")
  End If
  '判断该员工的工资信息是否已经存在
  Adodc1.ConnectionString = MyStrs
  Adodc1.RecordSource = "select * from 工资信息 where 员工编号='" + YgNums + "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
    Text1(0).Text = Adodc1.Recordset.Fields("基本工资")
    Text1(1).Text = Adodc1.Recordset.Fields("奖金")
    Text1(2).Text = Adodc1.Recordset.Fields("伙食补助")
    Text1(3).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
  For i = 1 To Adodc1.Recordset.RecordCount
    Combo1.AddItem Adodc1.Recordset.Fields("员工姓名")
    Adodc1.Recordset.MoveNext
  Next i
End Sub

⌨️ 快捷键说明

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