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

📄 frmresult.frm

📁 VB版的毕业设计作品
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   Set rs = getrs(strquery, "salary")
   If rs.RecordCount = 0 Then
      MsgBox "没有工资设置", vbOKOnly + vbExclamation, "提示"
      frmbasicsetting.Show
      frmbasicsetting.ZOrder 0
   Else
      With Me.MSFlexGrid2
      .Rows = 1
         While Not rs.EOF
            .Rows = .Rows + 1
            .TextMatrix(.Rows - 1, 0) = rs(0)
            .TextMatrix(.Rows - 1, 1) = rs(1)
            sql = "select sname from stuffinfo where sid='" & rs(1) & "'"
            Set rs1 = getrs(sql, "salary")
            .TextMatrix(.Rows - 1, 2) = rs1(0)
            rs1.Close
            .TextMatrix(.Rows - 1, 3) = rs(2)
            .TextMatrix(.Rows - 1, 4) = rs(3) & "元"
            rs.MoveNext
         Wend
       End With
       rs.Close
   End If
End Sub
Private Sub cmdcheckall_Click()
   Dim sql As String
   If Trim(strusername) <> "admin" Then
     MsgBox "您没有这个权限!", vbOKOnly + vbExclamation, "警告"
     Exit Sub
   Else
   Select Case Me.SSTab1.Tab
    Case 0
       sql = "select * from salarysetting"
       Call basictopic
       Call showbasic(sql)
    Case 1
       sql = "select * from salaryother"
       Call othertopic
       Call showother(sql)
    Case 2
       sql = "select * from salarystatistics order by id desc"
       Call listtopic
       Call showdata(sql)
    End Select
    End If
  iclickflag = 2
End Sub
Private Sub cmdok_Click()
   Dim sql As String
   If Trim(strusername) <> "admin" Then
     MsgBox "您没有这个权限!", vbOKOnly + vbExclamation, "警告"
   Exit Sub
   Else
   Select Case Me.SSTab1.Tab
   Case 0
      sql = "select * from salarysetting where stuffid='" & Me.comid.Text & "'"
      Call basictopic
      Call showbasic(sql)
   Case 1
      sql = "select * from salaryother where stuffid='" & Me.comid.Text & "'"
      Call othertopic
      Call showother(sql)
   Case 2
      sql = "select * from salarystatistics where stuffid='" & Me.comid.Text & "'"
      Call listtopic
      Call showdata(sql)
      End Select
    End If
   iclickflag = 1
End Sub
Public Sub listtopic()
    Dim i As Integer
    With Me.MSFlexGrid1                            '设置表头
        .TextMatrix(0, 0) = "记录编号"
        .TextMatrix(0, 1) = "员工编号"
        .TextMatrix(0, 2) = "员工姓名"
        .TextMatrix(0, 3) = "统计日期"
        .TextMatrix(0, 4) = "基本工资"
        .TextMatrix(0, 5) = "奖    金"
        .TextMatrix(0, 6) = "福    利"
        .TextMatrix(0, 7) = "津    贴"
        .TextMatrix(0, 8) = "扣    发"
        .TextMatrix(0, 9) = "迟到早退"
        .TextMatrix(0, 10) = "旷工扣发"
        .TextMatrix(0, 11) = "加班费"
        .TextMatrix(0, 12) = "出差费"
        .TextMatrix(0, 13) = "其   他"
        .TextMatrix(0, 14) = "总   额"
        For i = 0 To 14                             '设置所有表格对齐方式
            .ColAlignment(i) = 4
        Next i
        For i = 0 To 14                             '设置每列宽度
            .ColWidth(i) = 1000
        Next i
    End With
End Sub
Public Sub showdata(strquery As String)
    Dim rs As New ADODB.Recordset
    Set rs = getrs(strquery, "salary")
    If rs.EOF = False Then
    With Me.MSFlexGrid1
        .Rows = 1
        While Not rs.EOF
            .Rows = .Rows + 1
            .TextMatrix(.Rows - 1, 0) = rs(0)
            .TextMatrix(.Rows - 1, 1) = rs(1)
            .TextMatrix(.Rows - 1, 2) = rs(2)
            .TextMatrix(.Rows - 1, 3) = rs(3)
            .TextMatrix(.Rows - 1, 4) = rs(4) & "元"
            .TextMatrix(.Rows - 1, 5) = rs(5) & "元"
            .TextMatrix(.Rows - 1, 6) = rs(6) & "元"
            .TextMatrix(.Rows - 1, 7) = rs(7) & "元"
            .TextMatrix(.Rows - 1, 8) = rs(8) & "元"
            .TextMatrix(.Rows - 1, 9) = rs(9) & "元"
            .TextMatrix(.Rows - 1, 10) = rs(10) & "元"
            .TextMatrix(.Rows - 1, 11) = rs(11) & "元"
            .TextMatrix(.Rows - 1, 12) = rs(12) & "元"
            .TextMatrix(.Rows - 1, 13) = rs(13) & "元"
            .TextMatrix(.Rows - 1, 14) = rs(14) & "元"
            rs.MoveNext
        Wend
    End With
    rs.Close
    End If
End Sub
Public Sub othertopic()
    Dim i As Integer
    With Me.MSFlexGrid3                            '设置表头
        .TextMatrix(0, 0) = "记录编号"
        .TextMatrix(0, 1) = "员工编号"
        .TextMatrix(0, 2) = "员工姓名"
        .TextMatrix(0, 3) = "添加日期"
        .TextMatrix(0, 4) = "名    称"
        .TextMatrix(0, 5) = "金    额"
        .TextMatrix(0, 6) = "备    注"
        For i = 0 To 6                             '设置所有表格对齐方式
            .ColAlignment(i) = 4
        Next i
        For i = 0 To 6                             '设置每列宽度
            .ColWidth(i) = 1000
        Next i
    End With
End Sub
Public Sub showother(strquery As String)
    Dim rs As New ADODB.Recordset
    Dim rs1 As New ADODB.Recordset
    Dim sql As String
    Set rs = getrs(strquery, "salary")
    If rs.EOF = False Then
        With Me.MSFlexGrid3
        .Rows = 1
            While Not rs.EOF
                .Rows = .Rows + 1
                .TextMatrix(.Rows - 1, 0) = rs(0)
                .TextMatrix(.Rows - 1, 1) = rs(1)
                sql = "select sname from stuffinfo where sid='" & rs(1) & "'"
                Set rs1 = getrs(sql, "salary")
                .TextMatrix(.Rows - 1, 2) = rs1(0)
                rs1.Close
                .TextMatrix(.Rows - 1, 3) = rs(2)
                .TextMatrix(.Rows - 1, 4) = rs(4)
                .TextMatrix(.Rows - 1, 5) = rs(5) & "元"
                .TextMatrix(.Rows - 1, 6) = rs(6)
                rs.MoveNext
            Wend
        End With
    rs.Close
    End If
End Sub
Private Sub MSFlexGrid2_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Shift = 0 And Button = 2 Then
        PopupMenu frmpopmenu.Popmenu
    End If
End Sub
Private Sub MSFlexGrid3_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
      If Shift = 0 And Button = 2 Then
        PopupMenu frmpopmenu.Popmenu2
    End If
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
    Dim sql As String
    Dim rs As New ADODB.Recordset
    If strusername = "admin" Then
    If iclickflag = 1 Then
        Select Case Me.SSTab1.Tab
        Case 0
            sql = "select * from salarysetting where stuffid='" & Me.comid.Text & "'"
            Call basictopic
            Call showbasic(sql)
        Case 1
            sql = "select * from salaryother where stuffid='" & Me.comid.Text & "'"
            Call othertopic
            Call showother(sql)
        Case 2
            sql = "select * from salarystatistics where stuffid='" & Me.comid.Text & "'"
            Call listtopic
            Call showdata(sql)
        End Select
    Else
    Select Case Me.SSTab1.Tab
        Case 0
            sql = "select * from salarysetting"
            Call basictopic
            Call showbasic(sql)
        Case 1
            sql = "select * from salaryother"
            Call othertopic
            Call showother(sql)
        Case 2
            sql = "select * from salarystatistics order by id desc"
            Call listtopic
            Call showdata(sql)
        End Select
     End If
     Else
      sql = "select sid from stuffinfo where sname='" & strusername & "'"
      Set rs = getrs(sql, "salary")
      While Not rs.EOF
         Me.comid.AddItem rs(0)
         rs.MoveNext
     Wend
     rs.MoveFirst
     sd = rs(0)
     rs.Close
     Me.comid.ListIndex = 0
      Select Case Me.SSTab1.Tab
        Case 0
             sql = "select * from salarysetting where stuffid='" & sd & "' "
             Call basictopic
             Call showbasic(sql)
         Case 1
             sql = "select * from salaryother where stuffid='" & sd & "'"
             Call othertopic
             Call showother(sql)
         Case 2
             sql = "select * from salarystatistics where stuffid='" & sd & "'"
             Call listtopic
             Call showdata(sql)
         End Select
      End If
End Sub

⌨️ 快捷键说明

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