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

📄 frmfloor.frm

📁 人事管理系统vb版,用于一般中小企业
💻 FRM
📖 第 1 页 / 共 4 页
字号:
                                .TextMatrix(.Rows - 1, 4) = mrc2.Fields("payoutvalue")
                            End With
                        Else                    '如果没有只显示项目有关的信息,值及id为空
                            With MSF1
                                .Rows = .Rows + 1
                                .TextMatrix(.Rows - 1, 0) = mrc1.Fields("payout_name")
                                .TextMatrix(.Rows - 1, 1) = ""
                                .TextMatrix(.Rows - 1, 2) = tempNumber   '当前员工编号保存在变量中tempNumber
                                .TextMatrix(.Rows - 1, 3) = mrc1.Fields("payout_id")
                                .TextMatrix(.Rows - 1, 4) = ""
                            End With
                        End If
                        
                        mrc1.MoveNext
                    Loop
                End If
                
                
            Case "调整项目"
                fraThird.Visible = True
                fraBoon.Visible = False   '先隐藏福利下的框架
                fraRevenue.Visible = False '先隐藏税收下的框架
                
                 '初始化编辑栏中的信息
                lblName.Caption = "调整项目名称"
                txtValue.Text = ""
                
                MSF1.Rows = 0
                MSF1.Tag = "3"
                '先取出所有的工资调整项目名称
                txtsql = "select * from pb_payadjust"
                If mrc1.State = adStateOpen Then mrc1.Close
                mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
                If mrc1.EOF = False Then
                    mrc1.MoveFirst
                    Do While Not mrc1.EOF
                        
                        '在结合该条调整项目编号及该节点的员工编号从员工工资调整明细表中查看是否有此条记录
                        txtsql2 = "select id,employeeid,payadjustid,payadjustvalue from pb_employeepayadjust where employeeid=" & "'" & tempNumber & "'" & "and  payadjustid=" & mrc1.Fields("payadjust_id")
                       If mrc2.State = adStateOpen Then mrc2.Close
                        mrc2.Open txtsql2, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
                        
                        If mrc2.EOF = False Then   '如果已经存在则显示
                            mrc2.MoveFirst
                            With MSF1
                                .Rows = .Rows + 1
                                .TextMatrix(.Rows - 1, 0) = mrc1.Fields("payadjust_name")
                                .TextMatrix(.Rows - 1, 1) = mrc2.Fields("id")
                                .TextMatrix(.Rows - 1, 2) = mrc2.Fields("employeeid")
                                .TextMatrix(.Rows - 1, 3) = mrc2.Fields("payadjustid")
                                .TextMatrix(.Rows - 1, 4) = mrc2.Fields("payadjustvalue")
                            End With
                        Else                    '如果没有只显示项目有关的信息,值及id为空
                            With MSF1
                                .Rows = .Rows + 1
                                .TextMatrix(.Rows - 1, 0) = mrc1.Fields("payadjust_name")
                                .TextMatrix(.Rows - 1, 1) = ""
                                .TextMatrix(.Rows - 1, 2) = tempNumber   '当前员工编号保存在变量中tempNumber
                                .TextMatrix(.Rows - 1, 3) = mrc1.Fields("payadjust_id")
                                .TextMatrix(.Rows - 1, 4) = ""
                            End With
                        End If
                        
                        mrc1.MoveNext
                    Loop
                End If
            
            
            Case "福利项目"
                fraThird.Visible = False
                fraRevenue.Visible = False '先隐藏税收下的框架
                fraBoon.Visible = True
                
                '设置右边表格的样式
                With MSF2
                    .Cols = 9
                    .ColWidth(0) = 2000  '显示福利项目名称
                    .ColWidth(1) = 0    '显示id
                    .ColWidth(2) = 0    '显示该员工id
                    .ColWidth(3) = 0    '显示福利项目编号
                    .ColWidth(4) = 1000 '调整工资值
                    .ColWidth(5) = 1000 '显示福利类型
                    .ColWidth(6) = 1000 '显示福利百分比
                    .ColWidth(7) = 0    '用来显示没保存做的福利值,但已经存在默认福利值
                    .ColWidth(8) = 1200  '用来显示已保存过的福利值
                    
                    .TextMatrix(0, 4) = "调整工资值"
                    .TextMatrix(0, 5) = "福利类型"
                    .TextMatrix(0, 6) = "百分比"
                    .TextMatrix(0, 8) = "福利值"
                     
                     .Rows = 1
                    .ColAlignment(4) = flexAlignRightCenter
                    .ColAlignment(5) = flexAlignRightCenter
                    .ColAlignment(6) = flexAlignRightCenter
                    .ColAlignment(8) = flexAlignRightCenter
                    '.MergeCells = flexMergeRestrictColumns
                   ' .MergeCol(0) = True
                End With
                
                MSF2.Rows = 1
                '先取出所有的福利项目名称
                txtsql = "select * from pb_boon order by boon_id"
                If mrc1.State = adStateOpen Then mrc1.Close
                mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
                If mrc1.EOF = False Then
                    mrc1.MoveFirst
                    Do While Not mrc1.EOF
                    
                    '从当前福利项目名称中到员工调整工资表中去查找对应的调整工资值
                   
                    tempAdjustvalue = 0   '防止再次循环时取上次的值
                    txtsql3 = "select payadjustvalue from pb_employeepayadjust where employeeid=" & "'" & tempNumber & "'" & "and  payadjustid=" & mrc1.Fields("boon_payadjustid")
                    If mrc3.State = adStateOpen Then mrc3.Close
                    mrc3.Open txtsql3, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
                    If mrc3.EOF = False Then
                        mrc3.MoveFirst
                        tempAdjustvalue = mrc3.Fields("payadjustvalue")
                    End If
                    mrc3.Close
                    
                    
                      '在结合该条福利项目编号,福利类型,及该节点的员工编号从员工福利明细表中查看是此记录
                        txtsql2 = "select id,employeeid,boonid,boontype,boonvalue from pb_employeeboon where employeeid=" & "'" & tempNumber & "'" & "and  boonid=" & mrc1.Fields("boon_id") & Space(1) & "order by boontype"
                        'txtsql2 = "select id,employeeid,boonid,boontype,boonvalue from pb_employeeboon where employeeid=" & "'" & tempNumber & "'" & "and  boonid=" & mrc1.Fields("boon_id") & Space(1) & "order by boonid"
                        If mrc2.State = adStateOpen Then mrc2.Close
                        mrc2.Open txtsql2, adoConn, adOpenDynamic, adLockPessimistic, adCmdText

                        If mrc2.EOF = False Then   '如果已经存在则显示
                            mrc2.MoveFirst
                                With MSF2
                                    .Rows = .Rows + 1
                                    .TextMatrix(.Rows - 1, 0) = mrc1.Fields("boon_name")
                                    .TextMatrix(.Rows - 1, 1) = mrc2.Fields("id")
                                    .TextMatrix(.Rows - 1, 2) = mrc2.Fields("employeeid")
                                    .TextMatrix(.Rows - 1, 3) = mrc2.Fields("boonid")
                                    
                                    .TextMatrix(.Rows - 1, 4) = tempAdjustvalue  '调整工资值

                                    
                                    .TextMatrix(.Rows - 1, 5) = IIf(mrc2.Fields("boontype") = 1, "个人部分", "公司部分")   '福利类型
                                    .TextMatrix(.Rows - 1, 6) = mrc1.Fields("boon_percent") '百分比
                                    .TextMatrix(.Rows - 1, 7) = Val(tempAdjustvalue) * mrc1.Fields("boon_percent") / 100  '将保证此项中是最新的福利值,它将随着调整工资和百分比的改变而改变
                                    .TextMatrix(.Rows - 1, 8) = mrc2.Fields("boonvalue")
                                End With
                               
                           
                        Else                    '如果没有只显示项目有关的信息,值及id为空
                            With MSF2
                                .Rows = .Rows + 1
                                .TextMatrix(.Rows - 1, 0) = mrc1.Fields("boon_name")
                                .TextMatrix(.Rows - 1, 1) = ""
                                .TextMatrix(.Rows - 1, 2) = tempNumber   '当前员工编号保存在变量中tempNumber
                                .TextMatrix(.Rows - 1, 3) = mrc1.Fields("boon_id")
                                .TextMatrix(.Rows - 1, 4) = tempAdjustvalue  '调整工资值
                                .TextMatrix(.Rows - 1, 5) = IIf(mrc1.Fields("boon_type") = 1, "个人部分", "公司部分")   '福利类型
                                .TextMatrix(.Rows - 1, 6) = mrc1.Fields("boon_percent") '百分比
                                .TextMatrix(.Rows - 1, 7) = Val(tempAdjustvalue) * mrc1.Fields("boon_percent") / 100  '福利值等于该向福利的调整工资值乘以福利百分比
                                .TextMatrix(.Rows - 1, 8) = ""
                            End With
                        End If

                        mrc1.MoveNext
                    Loop
                End If
               
    
            Case "税收项目"
                fraThird.Visible = False
                fraBoon.Visible = False   '先隐藏福利下的框架
                fraRevenue.Visible = True
                
                '设置右边表格的样式
                With MSF3
                    .Rows = 0
                    .Cols = 3
                    .ColWidth(0) = 2000  '显示税收
                    .ColWidth(1) = 0    '显示id
                    .ColWidth(2) = 4200  '显示税收值
                
                    .ColAlignment(2) = flexAlignRightCenter
                End With
                
            
                '从数据表中取已经保存的税收值

'                txtsql2 = "select * from pb_employeesum where employeeid=" & "'" & tempNumber & "'"
'                If mrc2.State = adStateOpen Then mrc2.Close
'                mrc2.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
'                If mrc2.EOF = False Then
'                   mrc2.MoveFirst
'                   With MSF3
'                        .Rows = .Rows + 1
'                        .TextMatrix(.Rows - 1, 0) = "税收"
'                        .TextMatrix(.Rows - 1, 1) =mrc2.Fields("id")
'                        .TextMatrix(.Rows - 1, 2) =mrc2.Fields("sumRevenue")
'                   End With
'                End If
                               
               With MSF3
                    .Rows = .Rows + 1
                    .TextMatrix(.Rows - 1, 0) = "税收"
                    .TextMatrix(.Rows - 1, 2) = Sumrevenue(tempNumber)
                End With
                          
                    
        End Select
                                
    End If
    
    
    '如果点击的是员工则需要显示他的全部工资福利值信息
    If Left(tvwManage.SelectedItem.Key, 2) = "员工" Then
        tempNumber = Trim(Mid(tvwManage.SelectedItem.Key, 3))  '员工编号
        fraThird.Visible = False
        fraBoon.Visible = False   '先隐藏福利下的框架
        fraRevenue.Visible = True '和税收共用一个框架
        
        '显示数据
        With MSF3
            .Rows = 6
            .FixedRows = 0
            .Cols = 2
            .ColWidth(0) = 2000
            .ColWidth(1) = 4200  '显示值
            .TextMatrix(0, 0) = "收入总和"
            .TextMatrix(0, 1) = SumIncome(tempNumber)
            .TextMatrix(1, 0) = "支出总和"
            .TextMatrix(1, 1) = SumPayout(tempNumber)
            .TextMatrix(2, 0) = "个人福利总和"
            .TextMatrix(2, 1) = SumBoon1(tempNumber)
            .TextMatrix(3, 0) = "税收"
            .TextMatrix(3, 1) = Sumrevenue(tempNumber)
            .TextMatrix(4, 0) = "工资总和"
            .TextMatrix(4, 1) = sumPay(tempNumber)
            .TextMatrix(5, 0) = "公司福利总和"
            .TextMatrix(5, 1) = SumBoon2(tempNumber)
        End With
        
    End If
    
    '如果点击的节点是部门界面暂时什么都不显示
    If Left(tvwManage.SelectedItem.Key, 1) = "C" Then
        fraThird.Visible = False
        fraBoon.Visible = False   '先隐藏福利下的框架
        fraRevenue.Visible = True '和税收共用一个框架

        '先取出选中节点部门的id
        txtsql = "select id from 隶属部门  where 隶属部门=" & "'" & tvwManage.SelectedItem.Text & "'"
        If mrc1.State = adStateOpen Then mrc1.Close
        mrc1.Open txtsql, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
        
         '在从vwDepartmentSum数据表中取数据
        txtsql2 = "select * from vwDepartmentSum where 隶属部门=" & mrc1.Fields("id")
        If mrc2.State = adStateOpen Then mrc2.Close
        mrc2.Open txtsql2, adoConn, adOpenDynamic, adLockPessimistic, adCmdText
        If mrc2.EOF = False Then
            '显示数据
            With MSF3
                .Rows = 6
                .FixedRows = 0
                .Cols = 2
                .ColWidth(0) = 2000
                .ColWidth(1) = 4200  '显示值
                .TextMatrix(0, 0) = "收入总和"
                .TextMatrix(0, 1) = mrc2.Fields("sumIncome")
                .TextMatrix(1, 0) = "支出总和"
                .TextMatrix(1, 1) = mrc2.Fields("sumPayout")
                .TextMatrix(2, 0) = "个人福利总和"
                .TextMatrix(2, 1) = mrc2.Fields("sumBoon1")
                .TextMatrix(3, 0) = "税收"
                .TextMatrix(3, 1) = mrc2.Fields("sumPay")
                .TextMatrix(4, 0) = "工资总和"
                .TextMatrix(4, 1) = mrc2.Fields("sumBoon2")
                .TextMatrix(5, 0) = "公司福利总和"
                .TextMatrix(5, 1) = mrc2.Fields("sumRevenue")
            End With
        Else
            MSF3.Rows = 0
        End If
            
    End If
    
End Sub





⌨️ 快捷键说明

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