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

📄 timeinfo.frm

📁 人力资源管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmTime_Piece_LiftInfo 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "员工计时信息:"
   ClientHeight    =   2505
   ClientLeft      =   4620
   ClientTop       =   5445
   ClientWidth     =   7560
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2505
   ScaleWidth      =   7560
   Begin VB.Frame Frame1 
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   7335
      Begin VB.PictureBox Picture1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   375
         Left            =   6120
         Picture         =   "TimeInfo.frx":0000
         ScaleHeight     =   375
         ScaleWidth      =   375
         TabIndex        =   22
         Top             =   720
         Width           =   375
      End
      Begin VB.CommandButton cmdOK 
         Caption         =   "确定(&O)"
         Height          =   375
         Left            =   3840
         TabIndex        =   21
         Top             =   1800
         Width           =   1215
      End
      Begin VB.CommandButton cmdCancel 
         Caption         =   "取消(&C)"
         Height          =   375
         Left            =   5520
         TabIndex        =   20
         Top             =   1800
         Width           =   1215
      End
      Begin VB.TextBox txtMonth 
         Enabled         =   0   'False
         Height          =   270
         Left            =   5160
         TabIndex        =   16
         Top             =   1440
         Width           =   1575
      End
      Begin VB.TextBox txtPrice 
         Height          =   270
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   15
         Top             =   1080
         Width           =   1335
      End
      Begin VB.TextBox txtSum 
         Height          =   270
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   14
         Top             =   1440
         Width           =   1335
      End
      Begin VB.TextBox txtCount 
         Height          =   270
         Left            =   5160
         TabIndex        =   13
         Top             =   1080
         Width           =   1215
      End
      Begin VB.TextBox txtName 
         Enabled         =   0   'False
         Height          =   270
         Left            =   5160
         TabIndex        =   12
         Top             =   360
         Width           =   1575
      End
      Begin VB.TextBox txtNum 
         Enabled         =   0   'False
         Height          =   270
         Left            =   1440
         TabIndex        =   11
         Top             =   360
         Width           =   1695
      End
      Begin VB.TextBox txtGongXu 
         Height          =   270
         Left            =   1440
         TabIndex        =   10
         Top             =   720
         Width           =   4695
      End
      Begin MSComCtl2.DTPicker DTPRegistDate 
         Height          =   375
         Left            =   1440
         TabIndex        =   9
         Top             =   1800
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   661
         _Version        =   393216
         Format          =   169476097
         CurrentDate     =   39103
      End
      Begin VB.Label lblID 
         Caption         =   "ID"
         Height          =   135
         Left            =   4080
         TabIndex        =   25
         Top             =   1920
         Width           =   735
      End
      Begin VB.Label lblprice 
         Caption         =   "新单价"
         Height          =   255
         Left            =   1440
         TabIndex        =   24
         Top             =   1080
         Width           =   615
      End
      Begin VB.Label lblgongxu 
         Caption         =   "新工序"
         Height          =   255
         Left            =   1440
         TabIndex        =   23
         Top             =   720
         Width           =   2415
      End
      Begin VB.Label Label11 
         Caption         =   "小时"
         Height          =   255
         Left            =   6480
         TabIndex        =   19
         Top             =   1080
         Width           =   495
      End
      Begin VB.Label Label10 
         Caption         =   "元"
         Height          =   255
         Left            =   2880
         TabIndex        =   18
         Top             =   1440
         Width           =   375
      End
      Begin VB.Label Label9 
         Caption         =   "元"
         Height          =   255
         Left            =   2880
         TabIndex        =   17
         Top             =   1080
         Width           =   255
      End
      Begin VB.Label Label8 
         Caption         =   "记录日期:"
         Height          =   375
         Left            =   360
         TabIndex        =   8
         Top             =   1800
         Width           =   1095
      End
      Begin VB.Label Label7 
         Caption         =   "所属工资月份:"
         Height          =   375
         Left            =   3720
         TabIndex        =   7
         Top             =   1440
         Width           =   1575
      End
      Begin VB.Label Label6 
         Caption         =   "小    计:"
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   1440
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "数    量:"
         Height          =   375
         Left            =   4080
         TabIndex        =   5
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "单    价:"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   1080
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "工序名称:"
         Height          =   375
         Left            =   360
         TabIndex        =   3
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "员工姓名:"
         Height          =   255
         Left            =   4080
         TabIndex        =   2
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "员工编号:"
         Height          =   255
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmTime_Piece_LiftInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
Appear_key = 0
End Sub

Private Sub cmdOK_Click()
If Appear = 0 Then
    Update
ElseIf Appear = 1 Then
    AddNew
End If
Appear_key = 0
End Sub

Private Sub Form_Activate()
If Appear = 0 And Appear_key = 0 Then
    fuzhi
    txtNum.Locked = True
    txtName.Locked = True
ElseIf Appear = 0 And Appear_key = 1 Then
    'fuzhi
    txtGongXu.Text = lblgongxu.Caption
    txtPrice.Text = lblprice.Caption
    txtNum.Locked = True
    txtName.Locked = True
ElseIf Appear = 1 And Appear_key = 1 Then
    txtGongXu.Text = lblgongxu.Caption
    txtPrice.Text = lblprice.Caption
End If
End Sub

Private Sub fuzhi()
    Dim adors As New Recordset
    Dim strSQL As String
    Set adors.ActiveConnection = ADOcn
    If WageType = "time" Then
    strSQL = "Select * From 计时工资表 Where ID=" + lblID
    adors.Open strSQL
       If Not adors.EOF Then
       txtNum = adors("员工编号")
       txtName = adors("员工姓名")
       txtGongXu = adors("工序名称")
       txtPrice = LTrim(adors("单价"))
       txtCount = LTrim(adors("数量"))
       txtSum = LTrim(adors("小计"))
       DTPRegistDate.Value = LTrim(adors("记录日期"))
       txtMonth = adors("所属工资月份")
       End If
    ElseIf WageType = "piece" Then
    strSQL = "Select * From 计件工资表 Where ID=" + lblID
    adors.Open strSQL
       If Not adors.EOF Then
       txtNum = adors("员工编号")
       txtName = adors("员工姓名")
       txtGongXu = adors("工序名称")
       txtPrice = LTrim(adors("单价"))
       txtCount = LTrim(adors("数量"))
       txtSum = LTrim(adors("小计"))
       DTPRegistDate.Value = LTrim(adors("记录日期"))
       txtMonth = adors("所属工资月份")
       End If
    ElseIf WageType = "lift" Then
    strSQL = "Select * From 提成工资表 Where ID=" + lblID
    adors.Open strSQL
       If Not adors.EOF Then
       txtNum = adors("员工编号")
       txtName = adors("员工姓名")
       txtGongXu = adors("提成项目")
       txtPrice = LTrim(adors("业务量"))
       txtCount = LTrim(adors("提成率"))
       txtSum = LTrim(adors("提成金额"))
       DTPRegistDate.Value = LTrim(adors("记录日期"))
       txtMonth = adors("所属工资月份")
       End If
    End If
End Sub
Private Sub Update()
    txtNum.Locked = True
    txtName.Locked = True
If txtGongXu = "" Or txtPrice = "" Or txtCount = "" Or txtSum = "" Or txtMonth = "" Then
        MsgBox "请输入完整信息,没有请填“0”!", vbCritical + vbOKOnly, "信息提示"
Else  '否则将界面上输入的数据增加到数据库中去
    Dim strSQL As String
     If WageType = "time" Then
    strSQL = "Update 计时工资表 Set 所属工资月份='" + txtMonth + "',工序名称= '" + txtGongXu + "',单价= " + txtPrice
    strSQL = strSQL + ",数量=" + txtCount + ",小计=" + txtSum + ",记录日期='" + CStr(DTPRegistDate.Value) + "'"
    strSQL = strSQL + " Where ID=" + lblID
    ADOcn.Execute strSQL
    MyRefresh_frmTimeWage
    ElseIf WageType = "piece" Then
    strSQL = "Update 计件工资表 Set 所属工资月份='" + txtMonth + "',工序名称= '" + txtGongXu + "',单价= " + txtPrice
    strSQL = strSQL + ",数量=" + txtCount + ",小计=" + txtSum + ",记录日期='" + CStr(DTPRegistDate.Value) + "'"
    strSQL = strSQL + " Where ID=" + lblID
    ADOcn.Execute strSQL
    MyRefresh_frmPieceWage
    ElseIf WageType = "lift" Then
    strSQL = "Update 提成工资表 Set 所属工资月份='" + txtMonth + "',提成项目= '" + txtGongXu + "',业务量= " + txtPrice
    strSQL = strSQL + ",提成率=" + txtCount + ",提成金额=" + txtSum + ",记录日期='" + CStr(DTPRegistDate.Value) + "'"
    strSQL = strSQL + " Where ID=" + lblID
    ADOcn.Execute strSQL
    MyRefresh_frmLiftWage
    End If
Unload Me
End If
End Sub



Private Sub Picture1_Click()
Appear_key = 1
frmGongXuType.Show
If WageType = "time" Then
frmGongXuType.Caption = "计件工序类型"
frmGongXuType.Frame1.Caption = "计件工序信息:"
ElseIf WageType = "lift" Then
frmGongXuType.Caption = "提成项目类型"
frmGongXuType.Frame1.Caption = "提成项目信息:"
frmGongXuType.Label2.Caption = "提成项目:"
End If
End Sub

Private Sub txtCount_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 And KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub

Private Sub txtCount_KeyUp(KeyCode As Integer, Shift As Integer)
txtSum = Val(txtCount) * Val(txtPrice)
End Sub

Private Sub txtPrice_Change()
txtSum = Val(txtCount) * Val(txtPrice)
End Sub
Private Sub AddNew()
    Dim adors As New Recordset
    Dim strSQL As String
    adors.ActiveConnection = ADOcn
    
    If txtGongXu = "" Or txtPrice = "" Or txtCount = "" Or txtSum = "" Or txtMonth = "" Then
        MsgBox "请输入完整信息,没有请填“0”!", vbCritical + vbOKOnly, "信息提示"
    Else
        If WageType = "time" Then
        strSQL = "Insert Into 计时工资表(员工编号,员工姓名,工序名称,单价,数量,小计,所属工资月份,记录日期) "
        strSQL = strSQL + " Values('" + txtNum + "','" + txtName + "','" + txtGongXu + "'," + txtPrice + "," + txtCount + "," + txtSum + ",'" + txtMonth + "','" + CStr(DTPRegistDate.Value) + "')"
        ADOcn.Execute strSQL
        MyRefresh_frmTimeWage
        ElseIf WageType = "piece" Then
        strSQL = "Insert Into 计件工资表(员工编号,员工姓名,工序名称,单价,数量,小计,所属工资月份,记录日期) "
        strSQL = strSQL + " Values('" + txtNum + "','" + txtName + "','" + txtGongXu + "'," + txtPrice + "," + txtCount + "," + txtSum + ",'" + txtMonth + "','" + CStr(DTPRegistDate.Value) + "')"
        ADOcn.Execute strSQL
        MyRefresh_frmPieceWage
        ElseIf WageType = "lift" Then
        strSQL = "Insert Into 提成工资表(员工编号,员工姓名,提成项目,业务量,提成率,提成金额,所属工资月份,记录日期) "
        strSQL = strSQL + " Values('" + txtNum + "','" + txtName + "','" + txtGongXu + "'," + txtPrice + "," + txtCount + "," + txtSum + ",'" + txtMonth + "','" + CStr(DTPRegistDate.Value) + "')"
        ADOcn.Execute strSQL
        MyRefresh_frmLiftWage
        End If
        Unload Me
    End If
End Sub

⌨️ 快捷键说明

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