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

📄 frmerrtable.frm

📁 这是一个Web短信平台后台部分中的预付费管理系统,采用SQL Server数据库,主要是对短信服务的注册用户进得后台充值预付费管理。用到了第三方控件 VideoSoft Active Controls
💻 FRM
📖 第 1 页 / 共 5 页
字号:
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   3285
         TabIndex        =   27
         Top             =   1215
         Width           =   915
      End
      Begin VB.Label Label6 
         Caption         =   "用户ID:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   195
         Index           =   0
         Left            =   135
         TabIndex        =   26
         Top             =   1575
         Width           =   825
      End
      Begin VB.Label Label7 
         Caption         =   "用户名称:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   3285
         TabIndex        =   25
         Top             =   1575
         Width           =   915
      End
      Begin VB.Label Label8 
         Caption         =   "当前余额:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   135
         TabIndex        =   24
         Top             =   2160
         Width           =   915
      End
      Begin VB.Label Label9 
         Caption         =   "本次入费:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   3285
         TabIndex        =   23
         Top             =   2160
         Width           =   915
      End
   End
End
Attribute VB_Name = "frmErrTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*******************************************************
'*    模 块 名 称 :错单重单更正
'*    功 能 描 述 :
'*    程序员姓名  :谭怀志
'*    最后修改人  :谭怀志
'*    最后修改时间:2003/6/26
'*    备        注:
'*******************************************************

Private m_FLtype As Integer
Private m_RFDstatus As Integer
Private blnPoint As Boolean
Private m_SelectUid As String
Private m_SelectFLtype As Integer
Private SelectRate As Single
Private lngOldRate As Single
Private m_JFquan As Single
Private m_JFunit As Single

'更正单用户的费额
Public Property Let JFquan(ByVal NewValue As Single)

    m_JFquan = NewValue

End Property

'更正单用户的计费单位
Public Property Let JFunit(ByVal NewValue As Single)

    m_JFunit = NewValue

End Property

Public Property Get JFquan() As Single

    JFquan = m_JFquan

End Property

Public Property Get JFunit() As Single

    JFunit = m_JFunit

End Property

'更正单用户的计费方式
Public Property Let SelectFLtype(ByVal NewValue As Integer)

    m_SelectFLtype = NewValue

End Property

'更正单用户的用户ID
Public Property Let SelectUid(ByVal NewValue As String)

    m_SelectUid = NewValue

End Property

'错单用户的计费方式
Public Property Let FLtype(ByVal NewValue As Integer)

     m_FLtype = NewValue
     
End Property

'错单的状态
Public Property Let RFDstatus(ByVal NewValue As Integer)

    m_RFDstatus = NewValue
    
End Property

Private Sub chkDel_Click()
    
    If chkDel.Value = 1 Then
    
        txtNmoney(1).Locked = True
        cmdSelect.Enabled = False
        dtpStart(1).Enabled = False
        dtpEnd(1).Enabled = False
        dtpDate(1).Enabled = False
        
    Else
    
        If m_SelectFLtype = 1 Then
            dtpStart(1).Enabled = True
            dtpEnd(1).Enabled = True
            txtNmoney(1).Locked = True
        Else
            dtpStart(1).Enabled = False
            dtpEnd(1).Enabled = False
            txtNmoney(1).Locked = False
        End If
        
        cmdSelect.Enabled = True
        dtpDate(1).Enabled = True
        
    End If
            
End Sub

Private Sub cmdCancel_Click()

    Unload Me
    
End Sub

Private Sub cmdOK_Click()
    
    On Error GoTo ADOError

    Dim tmprstCustomers As ADODB.Recordset
    
    Set tmprstCustomers = New Recordset
    
    '错单用户的计费方式为包月
    If m_FLtype = 1 Then
        
        '错单与更正单的状态不相同(有效单,无效单)
        If m_RFDstatus <> chkDel.Value Then
            
            '错单为有效,更正单为无效
            If chkDel.Value = 1 Then
            
                cnnConnection.BeginTrans
                
                '将原来的入费单置为错单
                Call SetOldTable
                
                strQry = "update RFDconf set Status=1 where ID='" & txtTableID(0).Text & "'"
                cnnConnection.Execute strQry
                
                strQry = "select TotalMoney,SendableNum,SendFlag from MsgJF Where UserID='" & txtUserID(0).Text & "'"
                Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                
                '将错单用户(包月用户)的计费恢复到上次入费的设置
                strQry = "select top 1 * from RFDconf where UserID='" & txtUserID(0).Text & "' and status=0 order by EndDate DESC"
                Set tmprstCustomers = GetRecordSet(cnnConnection, strQry)
                
                rstCustomers!TotalMoney = rstCustomers!TotalMoney - Val(txtNmoney(0).Text)
                
                If tmprstCustomers.RecordCount <> 0 Then
                
                    strQry = "update JFsetting set StartDate='" & tmprstCustomers!StartDate & "',EndDate='" & tmprstCustomers!EndDate & "' where UserID='" & txtUserID(0).Text & "'"
                    cnnConnection.Execute strQry
                    
                    If DateValue(Now) >= tmprstCustomers!StartDate And DateValue(Now) <= tmprstCustomers!EndDate Then
                        rstCustomers!SendableNum = -1
                        rstCustomers!SendFlag = 0
                    Else
                        rstCustomers!SendableNum = 0
                        rstCustomers!SendFlag = 1
                    End If
                    
                Else
                    
                    rstCustomers!SendableNum = 0
                    rstCustomers!SendFlag = 1
                    strQry = "update JFsetting set StartDate=Null,EndDate=Null where UserID='" & txtUserID(0).Text & "'"
                    cnnConnection.Execute strQry
                    
                End If
                
                rstCustomers.Update
                
                '插入入费单操作记录
                strQry = "insert into RFDorig(UserID,RFdate,Money,OperID,Status,JFtype,ID,OperTime,StartDate,EndDate,FLname) values('" & txtUserID(0).Text & "','" & dtpDate(0).Value & "'," & txtNmoney(0).Text & ",'" & strOperatorID & "',2,1,'" & txtTableID(1).Text & "','" & Now & "','" & dtpStart(0).Value & "','" & dtpEnd(0).Value & "','" & txtFL(0).Text & "' )"
                cnnConnection.Execute strQry
                
                With frmErrRep!Gridbrowser
                    .TextMatrix(.RowSel, 10) = "无效单"
                End With
                
                cnnConnection.CommitTrans
                
            '错单为无效单,更正单为有效单
            Else
            
                cnnConnection.BeginTrans
                
                '将原来的入费单置为错单
                Call SetOldTable
                
                '更正单用户的计费方式为包月
                If m_SelectFLtype = 1 Then
                
                    strQry = "update RFDconf set Status=0 ,UserID='" & txtUserID(1).Text & "',RFdate='" & dtpDate(1).Value & "',money=" & txtNmoney(1).Text & ",StartDate='" & dtpStart(1).Value & "',EndDate='" & dtpEnd(1).Value & "',FLname='" & txtFL(1).Text & "'  where ID='" & txtTableID(0).Text & "'"
                    cnnConnection.Execute strQry
                    
                    '设置更正单用户(包月方式)的计费
                    strQry = "select * from MsgJF where UserID='" & txtUserID(1).Text & "'"
                    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                    
                    rstCustomers!TotalMoney = rstCustomers!TotalMoney + Val(txtNmoney(1).Text)
                    
                    If DateValue(Now) >= dtpStart(1).Value And DateValue(Now) <= dtpEnd(1).Value Then
                        rstCustomers!SendableNum = -1
                        rstCustomers!SendFlag = 0
                    Else
                        rstCustomers!SendableNum = 0
                        rstCustomers!SendFlag = 1
                    End If
                    
                    rstCustomers.Update
                    
                    strQry = "update JFsetting set StartDate='" & dtpStart(1).Value & "',EndDate='" & dtpEnd(1).Value & "' where UserID='" & txtUserID(1).Text & "'"
                    cnnConnection.Execute strQry
                    
                    strQry = "insert into RFDorig(UserID,RFdate,Money,OperID,Status,JFtype,ID,OperTime,StartDate,EndDate,FLname) values('" & txtUserID(1).Text & "','" & dtpDate(1).Value & "'," & txtNmoney(1).Text & ",'" & strOperatorID & "',0,1,'" & txtTableID(1).Text & "','" & Now & "','" & dtpStart(1).Value & "','" & dtpEnd(1).Value & "','" & txtFL(1).Text & "')"
                    cnnConnection.Execute strQry
                    
                    With frmErrRep!Gridbrowser
                    
                        .TextMatrix(.RowSel, 6) = dtpStart(1).Value
                        .TextMatrix(.RowSel, 7) = dtpEnd(1).Value
                        .TextMatrix(.RowSel, 8) = "1"
                        
                    End With
                    
                Else
                    
                    '更正单用户的计费方式为单条
                    strQry = "update RFDconf set Status=0 ,UserID='" & txtUserID(1).Text & "',RFdate='" & dtpDate(1).Value & "',money=" & txtNmoney(1).Text & ",StartDate=Null,EndDate=Null,FLname='" & txtFL(1).Text & "',JFtype=0  where ID='" & txtTableID(0).Text & "'"
                    cnnConnection.Execute strQry
                    
                    '设置更正单用户的计费
                    strQry = "select * from MsgJF where UserID='" & txtUserID(1).Text & "'"

⌨️ 快捷键说明

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