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

📄 tax.frm

📁 人力资源管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmTax 
   Caption         =   "个人所得税设置"
   ClientHeight    =   7125
   ClientLeft      =   3525
   ClientTop       =   1845
   ClientWidth     =   6465
   LinkTopic       =   "Form2"
   ScaleHeight     =   7125
   ScaleWidth      =   6465
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   3735
      Left            =   0
      TabIndex        =   13
      Top             =   3000
      Width           =   6375
      _ExtentX        =   11245
      _ExtentY        =   6588
      _Version        =   393216
      SelectionMode   =   1
   End
   Begin VB.Frame Frame1 
      Caption         =   "基本信息"
      Height          =   2295
      Left            =   0
      TabIndex        =   1
      Top             =   600
      Width           =   6375
      Begin VB.TextBox txtTaxKou 
         Enabled         =   0   'False
         Height          =   270
         Left            =   2400
         TabIndex        =   12
         Top             =   1800
         Width           =   2895
      End
      Begin VB.TextBox txtTaxL 
         Enabled         =   0   'False
         Height          =   270
         Left            =   2400
         TabIndex        =   9
         Top             =   1440
         Width           =   2535
      End
      Begin VB.TextBox txtTaxShang 
         Enabled         =   0   'False
         Height          =   270
         Left            =   2400
         TabIndex        =   7
         Top             =   1080
         Width           =   2895
      End
      Begin VB.TextBox txtTaxXia 
         Enabled         =   0   'False
         Height          =   270
         Left            =   2400
         TabIndex        =   5
         Top             =   720
         Width           =   2895
      End
      Begin VB.TextBox txtTaxNum 
         Enabled         =   0   'False
         Height          =   270
         Left            =   2400
         TabIndex        =   3
         Top             =   360
         Width           =   2895
      End
      Begin VB.Label Label6 
         Caption         =   "速  算  扣  除  数:"
         Height          =   255
         Left            =   360
         TabIndex        =   11
         Top             =   1800
         Width           =   1815
      End
      Begin VB.Label Label5 
         Caption         =   "% "
         Height          =   375
         Left            =   5160
         TabIndex        =   10
         Top             =   1440
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "税              率:"
         Height          =   255
         Left            =   360
         TabIndex        =   8
         Top             =   1440
         Width           =   1815
      End
      Begin VB.Label Label3 
         Caption         =   "应纳税所得金额上限:"
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   1080
         Width           =   2055
      End
      Begin VB.Label Label2 
         Caption         =   "应纳税所得金额下限:"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   720
         Width           =   1935
      End
      Begin VB.Label Label1 
         Caption         =   "级      别      号:"
         Height          =   255
         Left            =   360
         TabIndex        =   2
         Top             =   360
         Width           =   1815
      End
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   570
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6465
      _ExtentX        =   11404
      _ExtentY        =   1005
      ButtonWidth     =   820
      ButtonHeight    =   953
      Appearance      =   1
      Style           =   1
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   8
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "添加"
            Key             =   "Add"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "Update"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "Delete"
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
            Caption         =   "保存"
            Key             =   "Save"
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Enabled         =   0   'False
            Caption         =   "取消"
            Key             =   "Cancel"
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "退出"
            Key             =   "Back"
         EndProperty
      EndProperty
      BorderStyle     =   1
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   14
      Top             =   6750
      Width           =   6465
      _ExtentX        =   11404
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   1589
            MinWidth        =   1589
            Text            =   "总数量:"
            TextSave        =   "总数量:"
            Key             =   "bar1"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   2
            Object.Width           =   882
            MinWidth        =   882
            Text            =   "4"
            TextSave        =   "4"
            Key             =   "barNum"
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmTax"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub MyRefresh()
    Dim strTitle As String
    Dim adors As New Recordset
    Dim strSQL As String
    Dim i As Integer
    
    adors.ActiveConnection = ADOcn
    
    MSFlexGrid1.Clear
    
    MSFlexGrid1.Rows = 1
    MSFlexGrid1.Cols = 5
    MSFlexGrid1.FixedRows = 0  '不锁定第一行
    '加表的标题
    strTitle = "级别号" + vbTab + "应纳税所得金额下限" + vbTab + "应纳税所得金额上限" + vbTab + "税率" + vbTab + "速算扣除数"
  
    MSFlexGrid1.AddItem strTitle, 0
    MSFlexGrid1.FixedRows = 1    ' 锁定第一行
        
    strSQL = "Select * From 个人所得税表 order by 级别号"
    adors.Open strSQL
    i = 1
    Do While Not adors.EOF
       strTitle = adors("级别号") + vbTab + Trim(adors("应纳税所得金额下限")) + vbTab + LTrim(adors("应纳税所得金额上限")) + vbTab + LTrim(adors("税率")) + vbTab + LTrim(adors("速算扣除数"))
        MSFlexGrid1.AddItem strTitle, i
        adors.MoveNext
        i = i + 1
   Loop
   
Dim colWidth As Integer
colWidth = MSFlexGrid1.Width / 5
MSFlexGrid1.colWidth(1) = colWidth * 1.5
MSFlexGrid1.colWidth(2) = colWidth * 1.5
MSFlexGrid1.colWidth(4) = colWidth * 0.8

End Sub

Private Sub Form_Load()
MyRefresh
End Sub

Private Sub MSFlexGrid1_Click()
    Dim mystr As String
    MSFlexGrid1.Col = 0
    mystr = MSFlexGrid1.Text
    
    Dim adors As New Recordset
    Dim strSQL As String
    Set adors.ActiveConnection = ADOcn
    strSQL = "Select * From 个人所得税表 Where 级别号='" + mystr + "'"
    adors.Open strSQL
       If Not adors.EOF Then
       txtTaxNum = adors("级别号")
       txtTaxXia = LTrim(adors("应纳税所得金额下限"))
       txtTaxShang = LTrim(adors("应纳税所得金额上限"))
       txtTaxL = LTrim(adors("税率"))
       txtTaxKou = LTrim(adors("速算扣除数"))
       End If
End Sub
Private Sub Newnumber() '生成编号

    Dim adors As New Recordset
    Dim strSQL As String
    
    '与数据库连接
    Set adors.ActiveConnection = ADOcn
    
   '查找最大的编号
    '先查找全部的编号
    strSQL = "Select distinct 级别号 from 个人所得税表 order by 级别号"
    adors.Open strSQL
    
    If adors.EOF Then
       txtNum.Text = "0001"
    Else
      Do While Not adors.EOF
        '查找最大的编号
        txtTaxNum.Text = adors.Fields("级别号") + 1       '结果加1成功
        adors.MoveNext
      Loop
    End If
     adors.Close
End Sub
Private Sub Delete()
Dim strSQL As String
     Dim mystr As String
     
     MSFlexGrid1.Col = 0
     mystr = MSFlexGrid1.Text
     
    If MsgBox("你真的要删除它吗?", vbInformation + vbYesNo) = vbYes Then
        strSQL = "Delete From 个人所得税表 Where 级别号='" + mystr + "'"
        ADOcn.Execute strSQL
    End If
    MyRefresh
End Sub
Private Sub Save()
    Dim adors As New Recordset
    Dim strSQL As String
    adors.ActiveConnection = ADOcn
    
    strSQL = "Select 级别号 From 个人所得税表"
    strSQL = strSQL + " Where 级别号='" + txtTaxNum + "'"
    adors.Open strSQL
    
    If Not adors.EOF Then
        MsgBox "级别号已存在,请重新输入!", vbCritical + vbOKOnly, "信息提示"
        txtTaxNum.SetFocus
    ElseIf txtTaxNum = "" Or txtTaxXia = "" Or txtTaxShang = "" Or txtTaxL = "" Or txtTaxKou = "" Then
        MsgBox "请输入完整信息”!", vbCritical + vbOKOnly, "信息提示"
    Else
        strSQL = "Insert Into 个人所得税表(级别号,应纳税所得金额下限,应纳税所得金额上限,税率,速算扣除数) "
        strSQL = strSQL + " Values('" + txtTaxNum + "'," + txtTaxXia + "," + txtTaxShang + "," + txtTaxL + "," + txtTaxKou + ")"
        ADOcn.Execute strSQL
        MyRefresh
    End If
End Sub
Private Sub Update()
txtTaxNum.Locked = True
If txtTaxNum = "" Or txtTaxXia = "" Or txtTaxShang = "" Or txtTaxL = "" Or txtTaxKou = "" Then
        MsgBox "请输入完整信息”!", vbCritical + vbOKOnly, "信息提示"
Else  '否则将界面上输入的数据增加到数据库中去
    Dim strSQL As String
    strSQL = "Update 个人所得税表 Set 应纳税所得金额下限= " + txtTaxXia + ",应纳税所得金额上限=" + txtTaxShang
    strSQL = strSQL + ",税率=" + txtTaxL + ",速算扣除数=" + txtTaxKou + " Where 级别号='" + txtTaxNum + "'"
End If
ADOcn.Execute strSQL
MyRefresh
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
 On Error Resume Next
    Select Case Button.Key
        Case "Add"
            Flag = 0
            txtTaxNum.Enabled = True
            txtTaxXia.Enabled = True
            txtTaxShang.Enabled = True
            txtTaxL.Enabled = True
            txtTaxKou.Enabled = True
            Toolbar1.Buttons(5).Enabled = True
            Toolbar1.Buttons(6).Enabled = True
            Newnumber
            txtTaxXia = ""
            txtTaxShang = ""
            txtTaxL = ""
            txtTaxKou = ""
        Case "Update"
            Flag = 1
            txtTaxNum.Enabled = True
            txtTaxXia.Enabled = True
            txtTaxShang.Enabled = True
            txtTaxL.Enabled = True
            txtTaxKou.Enabled = True
            Toolbar1.Buttons(5).Enabled = True
            Toolbar1.Buttons(6).Enabled = True
        Case "Delete"
            Delete
        Case "Save"
            If Flag = 0 Then
            Save
            ElseIf Flag = 1 Then
            Update
            End If
            txtTaxNum.Enabled = False
            txtTaxXia.Enabled = False
            txtTaxShang.Enabled = False
            txtTaxL.Enabled = False
            txtTaxKou.Enabled = False
            Toolbar1.Buttons(5).Enabled = False
            Toolbar1.Buttons(6).Enabled = False
        Case "Cancel"
            txtTaxNum.Enabled = False
            txtTaxXia.Enabled = False
            txtTaxShang.Enabled = False
            txtTaxL.Enabled = False
            txtTaxKou.Enabled = False
            Toolbar1.Buttons(5).Enabled = False
            Toolbar1.Buttons(6).Enabled = False
        Case "Back"
            Unload Me
    End Select
End Sub

⌨️ 快捷键说明

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