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

📄 frmformula.frm

📁 企业工资管理
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmFormula 
   Caption         =   "计算公式"
   ClientHeight    =   6600
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5535
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6600
   ScaleWidth      =   5535
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取  消"
      Height          =   615
      Left            =   3720
      TabIndex        =   8
      Top             =   5520
      Width           =   1335
   End
   Begin VB.CommandButton cmdDefault 
      Caption         =   "恢复默认值"
      Height          =   615
      Left            =   2040
      TabIndex        =   7
      Top             =   5520
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "设  置"
      Height          =   615
      Left            =   360
      TabIndex        =   6
      Top             =   5520
      Width           =   1335
   End
   Begin VB.TextBox textLE 
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   840
      TabIndex        =   5
      Top             =   4200
      Width           =   855
   End
   Begin VB.TextBox textAbsent 
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   840
      TabIndex        =   4
      Top             =   3600
      Width           =   855
   End
   Begin VB.TextBox textErrand 
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   840
      TabIndex        =   3
      Top             =   3000
      Width           =   855
   End
   Begin VB.TextBox textOvertimeSpe 
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2040
      TabIndex        =   2
      Top             =   2400
      Width           =   855
   End
   Begin VB.TextBox textOvertimeCom 
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2040
      TabIndex        =   1
      Top             =   1800
      Width           =   855
   End
   Begin VB.Label Label13 
      Caption         =   "(元/次)×迟到早退次数"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   1800
      TabIndex        =   20
      Top             =   4200
      Width           =   3615
   End
   Begin VB.Label Label12 
      Caption         =   "-"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   19
      Top             =   4200
      Width           =   375
   End
   Begin VB.Label Label11 
      Caption         =   "+奖金+福利等-其他扣发"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   240
      TabIndex        =   18
      Top             =   4800
      Width           =   3135
   End
   Begin VB.Label Label10 
      Caption         =   "(元/天)×旷工次数"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   1800
      TabIndex        =   17
      Top             =   3600
      Width           =   3495
   End
   Begin VB.Label Label9 
      Caption         =   "-"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   16
      Top             =   3600
      Width           =   375
   End
   Begin VB.Label Label8 
      Caption         =   "(元/天)×出差时间"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   1680
      TabIndex        =   15
      Top             =   3000
      Width           =   3735
   End
   Begin VB.Label Label7 
      Caption         =   "+"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   14
      Top             =   3000
      Width           =   375
   End
   Begin VB.Label Label6 
      Caption         =   "%×特殊加班时间"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   2880
      TabIndex        =   13
      Top             =   2400
      Width           =   2295
   End
   Begin VB.Label Label5 
      Caption         =   "+基本工资×"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   12
      Top             =   2400
      Width           =   1575
   End
   Begin VB.Label Label4 
      Caption         =   "%×正常加班时间"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   2880
      TabIndex        =   11
      Top             =   1800
      Width           =   2295
   End
   Begin VB.Label Label2 
      Caption         =   "+基本工资×"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   10
      Top             =   1800
      Width           =   1575
   End
   Begin VB.Label Label3 
      Caption         =   "员工实际工资="
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   255
      Left            =   360
      TabIndex        =   9
      Top             =   720
      Width           =   1935
   End
   Begin VB.Label Label1 
      Caption         =   "基本工资(/每天)×月度正常工作时间"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000001&
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   1200
      Width           =   4695
   End
End
Attribute VB_Name = "frmFormula"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdCancel_Click()
    Unload Me
    Exit Sub
End Sub


Private Sub cmdDefault_Click()                           '设置默认值
    Me.textAbsent = 50
    Me.textErrand = 200
    Me.textOvertimeCom = 200
    Me.textOvertimeSpe = 400
    Me.textLE = 20
    Call setValue
End Sub

Private Sub setValue()                                   '添加记录
    Dim sql As String
    Dim rs As New ADODB.Recordset
    sql = "select * from FormulaSetting"
    Set rs = getRS(sql, "Salary")
    If rs.EOF = False Then                               '清除原记录
        sql = "delete from FormulaSetting"
        Call TransactSQL(sql, "Salary")
    End If
    rs.AddNew                                            '添加新记录
    rs.Fields(0) = Me.textOvertimeCom
    rs.Fields(1) = Me.textOvertimeSpe
    rs.Fields(2) = Me.textErrand
    rs.Fields(3) = Me.textAbsent
    rs.Fields(4) = Me.textLE
    rs.Update
    rs.Close
    MsgBox "已经设置公式!", vbOKOnly + vbExclamation, "设置结果!"
End Sub

Private Sub init()                                       '初始化
    Me.textAbsent = ""
    Me.textErrand = ""
    Me.textOvertimeCom = ""
    Me.textOvertimeSpe = ""
    Me.textLE = ""
    Me.textOvertimeCom.SetFocus
End Sub

Private Sub cmdOK_Click()
    If Me.textOvertimeCom = "" And IsNumeric(Me.textOvertimeCom) = False Then
        MsgBox "请输入正常加班工资百分比!", vbOKOnly + vbExclamation, "提示!"
        Me.textOvertimeCom = ""
        Me.textOvertimeCom.SetFocus
    ElseIf Me.textOvertimeSpe = "" And IsNumeric(Me.textOvertimeSpe) = False Then
        MsgBox "请输入特殊加班工资百分比!", vbOKOnly + vbExclamation, "提示!"
        Me.textOvertimeSpe = ""
        Me.textOvertimeSpe.SetFocus
    ElseIf Me.textErrand = "" And IsNumeric(Me.textErrand) = False Then
        MsgBox "请输入出差工资!", vbOKOnly + vbExclamation, "提示!"
        Me.textErrand = ""
        Me.textErrand.SetFocus
    ElseIf Me.textAbsent = "" And IsNumeric(Me.textAbsent) = False Then
        MsgBox "请输入旷工扣发金额!", vbOKOnly + vbExclamation, "提示!"
        Me.textAbsent = ""
        Me.textAbsent.SetFocus
    ElseIf Me.textLE = "" And IsNumeric(Me.textLE) = False Then
        MsgBox "请输入迟到早退扣发金额!", vbOKOnly + vbExclamation, "提示!"
        Me.textLE = ""
        Me.textLE.SetFocus
    Else
        Call setValue
        Call init
    End If
End Sub

⌨️ 快捷键说明

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