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

📄 frmrate.frm

📁 主要功能如题
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmRate 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "费率表"
   ClientHeight    =   5505
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6600
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   9
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmRate.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5505
   ScaleWidth      =   6600
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   5985
      Top             =   270
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   29
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":000C
            Key             =   "sz"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":03A6
            Key             =   "dy"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":0740
            Key             =   "yl"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":0ADA
            Key             =   "xg"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":0E74
            Key             =   "zh"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":120E
            Key             =   "sh"
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":15A8
            Key             =   "bc"
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":1942
            Key             =   "fq"
         EndProperty
         BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":1CDC
            Key             =   "bz"
         EndProperty
         BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":2076
            Key             =   "tc"
         EndProperty
         BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":2410
            Key             =   "bcgs"
         EndProperty
         BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":27AA
            Key             =   "mrlk"
         EndProperty
         BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":2B44
            Key             =   "xsxm"
         EndProperty
         BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":2EDE
            Key             =   "first"
         EndProperty
         BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":3278
            Key             =   "prev"
         EndProperty
         BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":3612
            Key             =   "next"
         EndProperty
         BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":39AC
            Key             =   "last"
         EndProperty
         BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":3D46
            Key             =   "xx"
         EndProperty
         BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":40E0
            Key             =   "define"
         EndProperty
         BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":447A
            Key             =   "exec"
         EndProperty
         BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":4814
            Key             =   "xz"
         EndProperty
         BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":4BAE
            Key             =   "sc"
         EndProperty
         BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":4F48
            Key             =   "sx"
         EndProperty
         BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":52E2
            Key             =   "cx"
         EndProperty
         BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":567C
            Key             =   "zd"
         EndProperty
         BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":5A16
            Key             =   "dz"
         EndProperty
         BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":5DB0
            Key             =   "ph"
         EndProperty
         BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":614A
            Key             =   "fz"
         EndProperty
         BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmRate.frx":64E4
            Key             =   "dw"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar SzToolbar 
      Align           =   1  'Align Top
      Height          =   555
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6600
      _ExtentX        =   11642
      _ExtentY        =   979
      ButtonWidth     =   820
      ButtonHeight    =   926
      AllowCustomize  =   0   'False
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "新增"
            Key             =   "add"
            Object.ToolTipText     =   "新增费率"
            ImageIndex      =   21
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "修改"
            Key             =   "modify"
            Object.ToolTipText     =   "修改费率"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "删除"
            Key             =   "del"
            Object.ToolTipText     =   "删除费率"
            ImageIndex      =   22
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   4
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "关闭"
            Key             =   "close"
            Object.ToolTipText     =   "关闭"
            ImageKey        =   "tc"
         EndProperty
      EndProperty
      BorderStyle     =   1
   End
   Begin VB.PictureBox Gridbrowser 
      BackColor       =   &H80000005&
      FillStyle       =   0  'Solid
      ForeColor       =   &H80000008&
      Height          =   4830
      Left            =   45
      ScaleHeight     =   4770
      ScaleWidth      =   6450
      TabIndex        =   1
      Top             =   630
      Width           =   6510
   End
End
Attribute VB_Name = "frmRate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'*    模 块 名 称 :计费费率管理
'*    功 能 描 述 :
'*    程序员姓名  :谭怀志
'*    最后修改人  :谭怀志
'*    最后修改时间:2003/6/26
'*    备        注:
'*******************************************************

Private Sub Form_Load()
    
    On Error GoTo VBError
    
    '初始化网格
    With Gridbrowser
     
        .RowHeight(0) = 350
        .ColAlignment(0) = flexAlignLeftCenter
        .Cols = 6
        .FixedRows = 1
        .SelectionMode = flexSelectionListBox
        .AllowUserResizing = flexResizeColumns
        .ExplorerBar = flexExSort
        
        .ColWidth(0) = 800
        .ColWidth(1) = 1500
        .ColWidth(2) = 1200
        .ColWidth(3) = 1200
        .ColWidth(4) = 1200
        
        .TextMatrix(0, 0) = "ID"
        .TextMatrix(0, 1) = "费率名称"
        .TextMatrix(0, 2) = "计费单位"
        .TextMatrix(0, 3) = "费额"
        .TextMatrix(0, 4) = "状态"
        .TextMatrix(0, 5) = ""
        
        .ColHidden(5) = True
        .Rows = .FixedRows
        .Redraw = False
        
        On Error GoTo ADOError
        
        '列出所有费率
        strQry = "Select * from FLlist"
        Set rstCustomers = GetRecordSet(cnnConnection, strQry)
        
        While Not rstCustomers.EOF
            
            With Gridbrowser
            
                .AddItem ""
                .RowHeight(Rows - 1) = 350
                .TextMatrix(.Rows - 1, 0) = rstCustomers!FLid
                .TextMatrix(.Rows - 1, 1) = rstCustomers!FLname
                .TextMatrix(.Rows - 1, 2) = rstCustomers!JFunit
                .TextMatrix(.Rows - 1, 3) = Format(rstCustomers!JFquan, "########0.00")
                .TextMatrix(.Rows - 1, 4) = IIf(rstCustomers!Status = 1, "默认费率", "")
                .TextMatrix(.Rows - 1, 5) = Trim(Str(rstCustomers!JFtype))
                
            End With
            
            rstCustomers.MoveNext
            
        Wend
        
        .Redraw = True
        
    End With
    
    Exit Sub
    
VBError:
    DisplayVBError
    Exit Sub
ADOError:
    DisplayADOError cnnConnection
    
End Sub

Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)

    On Error GoTo VBError
    
    Select Case Button.Key
    Case "add"      '新增费率
    
        Load frmFLedit
        frmFLedit.WhichFunction = "New"
            
        frmFLedit.Show vbModal
            
    Case "modify"   '修改费率
            
        With Gridbrowser
            
            If .TextMatrix(.RowSel, 0) <> "" And .RowSel > 0 Then
                Load frmFLedit
                frmFLedit!txtFLid.Text = .TextMatrix(.RowSel, 0)
                frmFLedit!cboJFtype.ListIndex = Val(.TextMatrix(.RowSel, 5))
                frmFLedit!txtQuan.Text = .TextMatrix(.RowSel, 3)
                frmFLedit!txtFLname.Text = .TextMatrix(.RowSel, 1)
                frmFLedit.WhichFunction = "Modify"
                frmFLedit.Show vbModal
            End If
                
        End With
            
    Case "del"      '删除费率
    
        If Gridbrowser.TextMatrix(Gridbrowser.RowSel, 0) = "" And Gridbrowser.RowSel < 1 Then
            Exit Sub
        End If
            
        If MsgBox("确定删除所选的费率吗?", vbOKCancel + vbDefaultButton2, systemcaption) = vbNo Then
            Exit Sub
        End If
                
        For i = Gridbrowser.Rows - 1 To 1 Step -1
                    
            If Gridbrowser.IsSelected(i) Then
                        
                On Error GoTo ADOError
                            
                strQry = "select UserID from JFsetting where FLid=" & Gridbrowser.TextMatrix(i, 0)
                Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                                
                If rstCustomers.RecordCount <> 0 Then
                
                    '正在使用的费率不能删除
                    MsgBox "费率 “" & Gridbrowser.TextMatrix(i, 1) & "” 正在使用,不能删除!", vbInformation, TIPCAPTION
                Else
                    cnnConnection.Execute ("delete from FLlist where FLid=" & Gridbrowser.TextMatrix(i, 0))
                    Gridbrowser.RemoveItem i
                End If
                            
            End If
                        
        Next i
        
    Case "close"
        
            Unload Me
        
    End Select
        
    Exit Sub
        
VBError:
    DisplayVBError
    Exit Sub
ADOError:
    DisplayADOError cnnConnection
         
End Sub

⌨️ 快捷键说明

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