frmgrcz.frm

来自「企业工资管理系统的具体实现」· FRM 代码 · 共 308 行

FRM
308
字号
VERSION 5.00
Begin VB.Form frmgrcz 
   Caption         =   "职工辞职"
   ClientHeight    =   3135
   ClientLeft      =   3285
   ClientTop       =   3420
   ClientWidth     =   5445
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3135
   ScaleWidth      =   5445
   Begin VB.Frame Frame1 
      Caption         =   "信息"
      Height          =   2520
      Left            =   15
      TabIndex        =   0
      Top             =   615
      Width           =   5415
      Begin VB.CommandButton Command2 
         Caption         =   "取  消"
         Height          =   375
         Left            =   4170
         TabIndex        =   10
         Top             =   2070
         Width           =   1200
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确  定"
         Height          =   375
         Left            =   2955
         TabIndex        =   9
         Top             =   2085
         Width           =   1200
      End
      Begin VB.Frame Frame2 
         Height          =   1845
         Left            =   45
         TabIndex        =   1
         Top             =   180
         Width           =   5325
         Begin VB.TextBox Text1 
            Height          =   345
            Left            =   180
            Locked          =   -1  'True
            TabIndex        =   17
            Top             =   300
            Width           =   855
         End
         Begin VB.TextBox Text2 
            Height          =   345
            Left            =   1470
            Locked          =   -1  'True
            TabIndex        =   16
            Top             =   285
            Width           =   615
         End
         Begin VB.TextBox Text4 
            Height          =   345
            Left            =   3585
            TabIndex        =   12
            Top             =   1305
            Width           =   1515
         End
         Begin VB.TextBox Text3 
            Height          =   345
            Left            =   3495
            TabIndex        =   11
            Top             =   780
            Width           =   1095
         End
         Begin VB.OptionButton Option1 
            Caption         =   "产品"
            Height          =   300
            Left            =   135
            TabIndex        =   5
            Top             =   810
            Value           =   -1  'True
            Width           =   660
         End
         Begin VB.OptionButton Option2 
            Caption         =   "工时"
            Height          =   285
            Left            =   135
            TabIndex        =   4
            Top             =   1335
            Width           =   675
         End
         Begin VB.TextBox Text5 
            Height          =   375
            Left            =   870
            TabIndex        =   3
            Top             =   750
            Width           =   1050
         End
         Begin VB.TextBox Text6 
            Enabled         =   0   'False
            Height          =   375
            Left            =   870
            TabIndex        =   2
            Top             =   1290
            Width           =   1050
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "年"
            Height          =   180
            Left            =   1155
            TabIndex        =   19
            Top             =   375
            Width           =   180
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            Caption         =   "月"
            Height          =   180
            Left            =   2250
            TabIndex        =   18
            Top             =   390
            Width           =   180
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            Caption         =   "迟到扣"
            Height          =   180
            Left            =   2805
            TabIndex        =   15
            Top             =   855
            Width           =   540
         End
         Begin VB.Label Label5 
            AutoSize        =   -1  'True
            Caption         =   "元/时"
            Height          =   180
            Left            =   4725
            TabIndex        =   14
            Top             =   870
            Width           =   450
         End
         Begin VB.Label Label8 
            AutoSize        =   -1  'True
            Caption         =   "津贴费:"
            Height          =   180
            Left            =   2790
            TabIndex        =   13
            Top             =   1395
            Width           =   720
         End
         Begin VB.Label Label6 
            AutoSize        =   -1  'True
            Caption         =   "元/件"
            Height          =   180
            Left            =   2100
            TabIndex        =   7
            Top             =   870
            Width           =   450
         End
         Begin VB.Label Label7 
            AutoSize        =   -1  'True
            Caption         =   "元/时"
            Height          =   180
            Left            =   2100
            TabIndex        =   6
            Top             =   1395
            Width           =   450
         End
      End
   End
   Begin VB.Image Image1 
      Height          =   855
      Left            =   240
      Picture         =   "frmgrcz.frx":0000
      Stretch         =   -1  'True
      Top             =   60
      Width           =   870
   End
   Begin VB.Label Label2 
      Caption         =   "为了便于统计,必须先对此职工本月工资进行统计。请填写以下信息。"
      Height          =   390
      Left            =   825
      TabIndex        =   8
      Top             =   120
      Width           =   4305
   End
End
Attribute VB_Name = "frmgrcz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim err1 As Integer
Dim cnn As New ADODB.Recordset
Dim cnn1 As New ADODB.Recordset
Dim cnn2 As New ADODB.Recordset
Dim gs As String
Call textchange(frmgrcz, err1)
If err1 = 1 Then Exit Sub
yf = Trim(Text1.Text) & "年" & Trim(Text2.Text) & "月"
With cnn
    .ActiveConnection = constr
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .LockType = adLockBatchOptimistic
    .Open "select * from sbqkb" & Trim(Text2.Text) & " where grdh='" & Trim(frmgrwh.Text2.Text) & "' and xm='" & Trim(frmgrwh.Text1.Text) & "'"
    If .EOF And .BOF Then
        MsgBox "查不到符合条件的工人,请检查输入是否有误!", vbCritical, "错误"
        Unload Me
        fcancle = 1
        Exit Sub
    Else
        With cnn1
            .ActiveConnection = constr
            .CursorLocation = adUseClient
            .CursorType = adOpenDynamic
            .LockType = adLockBatchOptimistic
            .Open "select jbsj from gzkcb where grdh='" & cnn.Fields("grdh").Value & "' and yf='" & yf & "'"
            If Not .EOF And Not .BOF Then
                gs = cnn.Fields("cx").Value + .Fields("jbsj").Value
            Else
                gs = cnn.Fields("cx").Value
            End If
            .Close
        End With
        Set cnn1 = Nothing
        With cnn1
            .ActiveConnection = constr
            .CursorLocation = adUseClient
            .CursorType = adOpenDynamic
            .LockType = adLockPessimistic
            .Open "select * from ygzqkb where grdh='" & cnn.Fields("grdh") & "' and yf='" & yf & "'"
            If .EOF And .BOF Then
                .AddNew
                .Fields("yf").Value = yf
                .Fields("cjdh").Value = cnn.Fields("cjdh").Value
                .Fields("grdh").Value = cnn.Fields("grdh").Value
                .Fields("xm").Value = cnn.Fields("xm").Value
            End If
            .Fields("gs").Value = gs
            .Fields("cpjs").Value = cnn.Fields("cpjs").Value
'            .Update
            With cnn2
                .ActiveConnection = constr
                .CursorLocation = adUseClient
                .CursorType = adOpenDynamic
                .LockType = adLockPessimistic
                .Open "select * from gzkcb where grdh='" & cnn.Fields("grdh").Value & "' and yf='" & yf & "'"
                If Not (.EOF And .BOF) Then
                    If .Fields("cdsj").Value = 0 Then cnn1.Fields("cdkc").Value = .Fields("cdsj").Value * Val(Trim(Text3.Text))
                    If Not IsNull(.Fields("cpkc").Value) Then cnn1.Fields("cpkc").Value = .Fields("cpkc").Value
                    If Not IsNull(.Fields("qtkc").Value) Then cnn1.Fields("qtkc").Value = .Fields("qtkc").Value
                Else
                    cnn1.Fields("cdkc").Value = 0
                    cnn1.Fields("cpkc").Value = 0
                    cnn1.Fields("qtkc").Value = 0
                End If
                If Text4.Text <> "" Then cnn1.Fields("jtf").Value = Val(Trim(Text4.Text))
'                .Update
                .Close
                End With
                Set cnn2 = Nothing
                If Option1.Value = True Then
                        kc = .Fields("cdkc").Value + .Fields("cpkc").Value + .Fields("qtkc").Value
                        .Fields("gzhj").Value = .Fields("cpjs").Value * Val(Trim(Text5.Text)) - kc + .Fields("jtf").Value
                    Else
                        kc = .Fields("cdkc").Value + .Fields("qtkc").Value
                        .Fields("gzhj").Value = .Fields("gs").Value * Val(Trim(Text6.Text)) - kc + .Fields("jtf").Value
                End If
                .Update
                .Close
            End With
            Set cnn1 = Nothing
        End If
    .Close
    End With
    Set cnn = Nothing
Unload Me
End Sub

Private Sub Command2_Click()
fcancle = 1
Unload Me
End Sub

Private Sub Form_Load()
Dim year1 As String
year1 = Now
v = Split(year1, "-")
Text1.Text = "20" & v(0)
If Len(v(1)) = 1 Then v(1) = "0" & v(1)
Text2.Text = v(1)
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
    Text5.Enabled = True
    Text6.Text = ""
    Text6.Enabled = False
End If
End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
    Text6.Enabled = True
    Text5.Text = ""
    Text5.Enabled = False
End If
End Sub

⌨️ 快捷键说明

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