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

📄 frmzhaopinregister.frm

📁 vb编出的关于传销工资结算系统
💻 FRM
📖 第 1 页 / 共 4 页
字号:
     'SQL = "select * from 员工资料 where 工号= " & txt业务员工号.Text & "'"
     'Adodc2.RecordSource = SQL
     Adodc2.Recordset("工号") = txt业务员工号.Text
     Adodc2.Recordset("姓名") = txt姓名.Text
     Adodc2.Recordset("担保人工号") = txt担保人业务工号.Text
     Adodc2.Recordset("担保人姓名") = txt担保人姓名.Text
     
     Adodc2.Recordset("应聘日期") = msk填表聘用日期.Text
     Adodc2.Recordset("晋升日期") = msk填表聘用日期.Text
     Adodc2.Recordset.Update
  End If
End Sub


Private Sub cmdAddNew_Click()
  InputVar = False
  LockedOrNo (InputVar)
  
  msk填表聘用日期.Text = Date
  msk出生年月.Text = Date
  
  'txt业务员工号 = ""
  Adodc1.Recordset.AddNew
  Adodc2.Recordset.AddNew
  
  AddNewOrModify = True
   
  cmdQuery.Visible = True
End Sub
  
Private Sub cmdCancel_Click()
  Adodc1.Refresh
  Adodc1.Recordset.CancelUpdate
  
  If Adodc1.Recordset.RecordCount = 0 Then
     InputVar = True
     LockedOrNo (InputVar)
     
     Unload Me
     Exit Sub
  End If
  
  With Adodc1.Recordset
    If !担保人业务工号 = "" Then
       txt担保人业务工号 = ""
    End If
    If !担保人姓名 = "" Then
       txt担保人姓名 = ""
    End If
  End With
  
  Adodc2.Refresh
  Adodc2.Recordset.CancelUpdate
  
  Sql = "select * from 员工资料"
  Adodc2.RecordSource = Sql
  Adodc2.Refresh
  
  InputVar = True
  LockedOrNo (InputVar)
  
  cmdQuery.Visible = False
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub

Private Sub cmdDelete_Click()
  Dim DeleteSql As String
  Dim Password As String
  Dim varWarrantor As String
  
  Password = Trim(InputBox("请输入系统管理员口令", "口令验证", , (frmZhaopinRegister.Left + frmZhaopinRegister.Width / 4), (frmZhaopinRegister.Top + frmZhaopinRegister.Height / 4)))
  If Password = "" Then
     Exit Sub
  End If
  
  DeleteSql = "select * from 权限设置 where 权限等级名称= '" & "系统管理员" & "'"      ' '" & "系统管理员" & "'"
  Adodc3.RecordSource = DeleteSql
  Adodc3.Refresh
  
  If Adodc3.Recordset.RecordCount = 0 Then
     MsgBox "系统管理员权限级别没有设置,请先设置系统管理员!"
     Exit Sub
  End If
 
  With Adodc3.Recordset
    .MoveFirst
    Do While Not .EOF
       If !密码 = Password Then
          MsgBox "ok"
          ' 删除员工详细资料及员工资料表里相关记录
          Adodc1.Recordset.Delete
          DoEvents
          
          Sql = "select * from 员工资料 where 工号= '" & txt担保人业务工号.Text & "'"
          Adodc2.CommandType = adCmdText
          Adodc2.Refresh
          
          If Adodc2.Recordset.RecordCount = 0 Then
             MsgBox "该员工没有上级担保人!"
             varWarrantor = ""
          Else
             varWarrantor = Adodc2.Recordset("工号")
          End If
          
          Sql = "select * from 员工资料 where 担保人工号= '" & txt业务员工号.Text & "'"
          Adodc2.CommandType = adCmdText
          Adodc2.RecordSource = Sql
          Adodc2.Refresh
          
          If Adodc2.Recordset.RecordCount = 0 Then
             MsgBox "该员工没有发展下级员工!"
             
             Sql = "select * from 员工资料 where 工号= '" & txt业务员工号.Text & "'"
             Adodc2.CommandType = adCmdText
             Adodc2.RecordSource = Sql
             Adodc2.Refresh
             
             Adodc2.Recordset.Delete
             
             Adodc3.RecordSource = DeleteSql
             Adodc3.Refresh
             
             Sql = "select * from 员工资料"
             Adodc2.CommandType = adCmdText
             Adodc2.RecordSource = Sql
             Adodc2.Refresh
             
             Adodc1.Recordset.MoveFirst
             Exit Sub
          Else
            With Adodc2.Recordset
              Do While Not .EOF
                 !担保人工号 = varWarrantor
                 .MoveNext
              Loop
            End With
            
            Sql = "select * from 员工资料 where 工号= '" & txt业务员工号.Text & "'"
            Adodc2.CommandType = adCmdText
            Adodc2.RecordSource = Sql
            Adodc2.Refresh
             
            Adodc2.Recordset.Delete
            
            Adodc3.RecordSource = DeleteSql
            Adodc3.Refresh
             
            Sql = "select * from 员工资料"
            Adodc2.CommandType = adCmdText
            Adodc2.RecordSource = Sql
            Adodc2.Refresh
             
            Adodc1.Recordset.MoveFirst
            Exit Sub
          End If
       End If
       .MoveNext
    Loop
    MsgBox "口令不正确!"
  End With
End Sub

Private Sub cmdFirst_Click()
  With Adodc1.Recordset
    .MoveFirst
    
    If !担保人业务工号 = "" Then
       txt担保人业务工号 = ""
    End If
    If !担保人姓名 = "" Then
       txt担保人姓名 = ""
    End If
    
    msk填表聘用日期.Text = !填表聘用日期
    msk出生年月.Text = !出生年月
  End With
End Sub

Private Sub cmdLast_Click()
  With Adodc1.Recordset
    .MoveLast
    
    If !担保人业务工号 = "" Then
       txt担保人业务工号 = ""
    End If
    If !担保人姓名 = "" Then
       txt担保人姓名 = ""
    End If
    
    msk填表聘用日期.Text = !填表聘用日期
    msk出生年月.Text = !出生年月
  End With
End Sub

Private Sub cmdModify_Click()
  InputVar = False
  LockedOrNo (InputVar)
  txt业务员工号.Locked = True
  
  Sql = "select * from 员工资料 where 工号= '" & txt业务员工号.Text & "'"
  Adodc2.RecordSource = Sql
  Adodc2.Refresh
  
  If Adodc2.Recordset("历史积分") <> 0 Then
     MsgBox "此员工已经做过业务,系统禁止修改!"
       
     Sql = "select * from 员工资料"
     Adodc2.RecordSource = Sql
       
     InputVar = True
     LockedOrNo (InputVar)
     
     Exit Sub
  End If
  
  AddNewOrModify = False
End Sub

Private Sub cmdNext_Click()
  With Adodc1.Recordset
    .MoveNext
    If .EOF Then
       .MovePrevious
    End If
    
    If !担保人业务工号 = "" Then
       txt担保人业务工号 = ""
    End If
    If !担保人姓名 = "" Then
       txt担保人姓名 = ""
    End If
    
    msk填表聘用日期.Text = !填表聘用日期
    msk出生年月.Text = !出生年月
  End With
End Sub

Private Sub cmdPicModify_Click()
  On Error Resume Next
    With CommonDialog1
        .DialogTitle = "载入图片"
        .Filter = "(点阵图)*.bmp|*.bmp"
        .CancelError = True
        .ShowOpen
        If Err.Number <> cdlCancel Then
            Set Picture1.Picture = LoadPicture(.FileName)
            SavePictureToAdodc Adodc1.Recordset, .FileName
        End If
    End With
End Sub

Private Sub cmdPrevious_Click()
  With Adodc1.Recordset
    .MovePrevious
    If .BOF Then
       .MoveNext
    End If
    
    If !担保人业务工号 = "" Then
       txt担保人业务工号 = ""
    End If
    If !担保人姓名 = "" Then
       txt担保人姓名 = ""
    End If
    
    msk填表聘用日期.Text = !填表聘用日期
    msk出生年月.Text = !出生年月
  End With
End Sub

Private Sub cmdQuery_Click()
  frmSelectNo.Show 1
End Sub

Private Sub cmdSave_Click()
  If txt业务员工号.Text = "" Then
     MsgBox "核准工号不能为空!"
     Exit Sub
  End If
  
  If txt姓名.Text = "" Then
     MsgBox "业务员姓名不能为空!"
     Exit Sub
  End If
  
  Dim Sql As String
  
  Sql = "select * from 员工详细资料 where 工号= '" & txt业务员工号.Text & "'"
  Adodc6.RecordSource = Sql
  Adodc6.Refresh
  
  If Adodc6.Recordset.RecordCount <> 0 Then
     MsgBox "已有相同工号,请重输!"
     txt业务员工号.Text = ""
     txt业务员工号.SetFocus
     Exit Sub
  End If
  
  
  With Adodc1.Recordset
    !填表聘用日期 = msk填表聘用日期.Text
    !出生年月 = msk出生年月.Text
    .Update
  End With
  
  Sql = "select * from 员工资料 where 工号= '" & txt担保人业务工号.Text & "'"
  Adodc6.RecordSource = Sql
  Adodc6.Refresh
  
  If Adodc6.Recordset.RecordCount = 0 Then
     Adodc2.Recordset("担保人等级") = ""
  Else
     Adodc2.Recordset("担保人等级") = Adodc6.Recordset("等级")
  End If
  
  SaveRecordToYGZL (AddNewOrModify)
  
  Sql = "select * from 员工资料"
  Adodc2.RecordSource = Sql
  Adodc2.Refresh
  
  InputVar = True
  LockedOrNo (InputVar)
  
  cmdQuery.Visible = False
End Sub

Private Sub Form_Load()
  Adodc4.Refresh
  If Adodc4.Recordset.RecordCount <> 0 Then
     With Adodc4.Recordset
       .MoveFirst
       Do While Not .EOF
          cob文化程度.AddItem !文化程度
          .MoveNext
       Loop
     End With
  End If
  
  Adodc5.Refresh
  If Adodc5.Recordset.RecordCount <> 0 Then
     Adodc5.Refresh
     With Adodc5.Recordset
       .MoveFirst
       Do While Not .EOF
          cob存折种类.AddItem !存折种类
          .MoveNext
       Loop
     End With
  End If

  InputVar = True
  LockedOrNo (InputVar)
  
  cmdSave.Enabled = False
  If Adodc1.Recordset.RecordCount = 0 Then
     cmdFirst.Enabled = False
     cmdNext.Enabled = False
     cmdPrevious.Enabled = False
     cmdLast.Enabled = False
  End If
  
  cmdAddNew.Enabled = True
  cmdModify.Enabled = True
  cmdCancel.Enabled = False
  cmdSave.Enabled = False
  
  Adodc1.Refresh
  With Adodc1.Recordset
    If .RecordCount = 0 Then
       GoTo Line10
    End If
    
    .MoveFirst
    If !填表聘用日期 <> "" Then
       msk填表聘用日期.Text = !填表聘用日期
       msk出生年月.Text = !出生年月
    End If
  End With
  
Line10:
  Adodc2.Refresh
  
  cmdQuery.Visible = False
End Sub

Private Sub Label7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  lblprotocol.FontBold = False
  lblprotocol.ForeColor = vbBlue
End Sub

Private Sub lblprotocol_Click()
  frmProtocol.Show 1
End Sub

Private Sub lblprotocol_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If (X > 0 And X < lblprotocol.Width) And (Y > 0 And Y < lblprotocol.Height) Then
     lblprotocol.FontBold = True
     lblprotocol.ForeColor = vbRed
  End If
End Sub

Private Sub txt担保人业务工号_DblClick()
  If cmdSave.Enabled = True Then
     frmWarrantorSelect.Show 1
  End If
End Sub

Private Sub txt业务员工号_Change()
  txt业务员工号.Text = UCase(Trim(txt业务员工号.Text))
  txt业务员工号.SelStart = Len(txt业务员工号.Text)
End Sub

⌨️ 快捷键说明

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