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

📄 frmerrtable.frm

📁 这是一个Web短信平台后台部分中的预付费管理系统,采用SQL Server数据库,主要是对短信服务的注册用户进得后台充值预付费管理。用到了第三方控件 VideoSoft Active Controls
💻 FRM
📖 第 1 页 / 共 5 页
字号:
                    .TextMatrix(.RowSel, 10) = "无效单"
                End With
                
                cnnConnection.CommitTrans
                
            '错单为无效单,更正单为有效单
            Else
            
                cnnConnection.BeginTrans
                
                '将原来的入费单置为错单
                Call SetOldTable
                
                '更正单用户的计费方式为包月
                If m_SelectFLtype = 0 Then
                
                    strQry = "update RFDconf set Status=0 ,UserID='" & txtUserID(1).Text & "',RFdate='" & dtpDate(1).Value & "',money=" & txtNmoney(1).Text & ",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!Cmoney = rstCustomers!Cmoney + Val(txtNmoney(1).Text)
                    
                    If rstCustomers!Cmoney > 0 Then
                    
                        If SelectRate = 0 Then
                        
                            rstCustomers!SendableNum = -1
                            rstCustomers!SendFlag = 0
                            rstCustomers.Update
                            
                        Else
                        
                            rstCustomers!SendableNum = Int(rstCustomers!Cmoney / SelectRate)
                            
                            If rstCustomers!SendableNum = 0 Then
                                rstCustomers!SendFlag = 1
                            Else
                                rstCustomers!SendFlag = 0
                            End If
                            
                            rstCustomers.Update
                            
                        End If
                        
                    Else
                    
                        rstCustomers!SendFlag = 1
                        rstCustomers!SendableNum = 0
                        rstCustomers.Update
                        
                    End If
                    
                    '插入入费单操作记录
                    strQry = "insert into RFDorig(UserID,RFdate,Money,OperID,Status,JFtype,ID,OperTime,FLname) values('" & txtUserID(1).Text & "','" & dtpDate(1).Value & "'," & txtNmoney(1).Text & ",'" & strOperatorID & "',0,0,'" & txtTableID(1).Text & "','" & Now & "','" & txtFL(1).Text & "')"
                    cnnConnection.Execute strQry
                    
                    With frmErrRep!Gridbrowser
                    
                        .TextMatrix(.RowSel, 6) = ""
                        .TextMatrix(.RowSel, 7) = ""
                        .TextMatrix(.RowSel, 8) = "0"
                        
                    End With
                    
                '更正单用户的计费方式为包月
                Else
                
                    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 & "',JFtype=1  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
                    
                End If
                
                With frmErrRep!Gridbrowser
                
                    .TextMatrix(.RowSel, 1) = txtUserID(1).Text
                    .TextMatrix(.RowSel, 2) = txtUserName(1).Text
                    .TextMatrix(.RowSel, 4) = dtpDate(1).Value
                    .TextMatrix(.RowSel, 5) = txtFL(1).Text
                    .TextMatrix(.RowSel, 3) = txtNmoney(1).Text
                    .TextMatrix(.RowSel, 9) = txtCmoney(1).Text
                    .TextMatrix(.RowSel, 11) = Trim(Str(Me.JFquan))
                    .TextMatrix(.RowSel, 12) = Trim(Str(Me.JFunit))
                    .TextMatrix(.RowSel, 10) = ""
                    
                End With
                
                Call SetRight(txtUserID(1).Text)
                
                cnnConnection.CommitTrans
                
            End If
           
        '错单与更正单的状态相同(有效单,无效单)
        Else
        
            If chkDel.Value = 0 Then
                
                cnnConnection.BeginTrans
                
                '将原来的入费单置为错单
                Call SetOldTable
                
                '更正单用户的计费方式为单条
                If m_SelectFLtype = 0 Then
                
                    strQry = "update RFDconf set UserID='" & txtUserID(1).Text & "',RFdate='" & dtpDate(1).Value & "',money=" & txtNmoney(1).Text & ",FLname='" & txtFL(1).Text & "' where ID='" & txtTableID(1).Text & "'"
                    cnnConnection.Execute strQry
                    
                    '恢复错单用户(单条用户)原来的计费设置
                    strQry = "select * from MsgJF where UserID='" & txtUserID(0).Text & "'"
                    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                    
                    rstCustomers!Cmoney = rstCustomers!Cmoney - Val(txtNmoney(0).Text)
                    
                    If rstCustomers!Cmoney > 0 Then
                    
                        If SelectRate = 0 Then
                        
                            rstCustomers!SendableNum = -1
                            rstCustomers!SendFlag = 0
                            rstCustomers.Update
                            
                        Else
                        
                            rstCustomers!SendableNum = Int(rstCustomers!Cmoney / SelectRate)
                            
                            If rstCustomers!SendableNum = 0 Then
                                rstCustomers!SendFlag = 1
                            Else
                                rstCustomers!SendFlag = 0
                            End If
                            
                            rstCustomers.Update
                            
                        End If
                        
                    Else
                    
                        rstCustomers!SendFlag = 1
                        rstCustomers!SendableNum = 0
                        rstCustomers.Update
                        
                    End If
                    
                    '设置更正单用户(单条用户)的计费设置
                    strQry = "select * from MsgJF where UserID='" & txtUserID(1).Text & "'"
                    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                    
                    rstCustomers!Cmoney = rstCustomers!Cmoney + Val(txtNmoney(1).Text)
                    
                    If rstCustomers!Cmoney > 0 Then
                    
                        If SelectRate = 0 Then
                        
                            rstCustomers!SendableNum = -1
                            rstCustomers!SendFlag = 0
                            rstCustomers.Update
                            
                        Else
                        
                            rstCustomers!SendableNum = Int(rstCustomers!Cmoney / SelectRate)
                            
                            If rstCustomers!SendableNum = 0 Then
                                rstCustomers!SendFlag = 1
                            Else
                                rstCustomers!SendFlag = 0
                            End If
                            
                            rstCustomers.Update
                            
                        End If
                        
                    Else
                    
                        rstCustomers!SendFlag = 1
                        rstCustomers!SendableNum = 0
                        rstCustomers.Update
                        
                    End If
                    
                    '插入入费单操作记录
                    strQry = "insert into RFDorig(UserID,RFdate,Money,OperID,Status,JFtype,ID,OperTime,FLname) values('" & txtUserID(1).Text & "','" & dtpDate(1).Value & "'," & txtNmoney(1).Text & ",'" & strOperatorID & "',0,0,'" & txtTableID(1).Text & "','" & Now & "','" & txtFL(1).Text & "')"
                    cnnConnection.Execute strQry
                    
                    With frmErrRep!Gridbrowser
                        .TextMatrix(.RowSel, 6) = ""
                        .TextMatrix(.RowSel, 7) = ""
                        .TextMatrix(.RowSel, 8) = "0"
                    End With
                    
                '更正单用户的计费方式为包月
                Else
                
                    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 & "',JFtype=1  where ID='" & txtTableID(0).Text & "'"
                    cnnConnection.Execute strQry
                    
                    '恢复错单用户(单条用户)原来的计费设置
                    strQry = "select * from MsgJF where UserID='" & txtUserID(0).Text & "'"
                    Set rstCustomers = GetRecordSet(cnnConnection, strQry)
                    
                    rstCustomers!Cmoney = rstCustomers!Cmoney - Val(txtNmoney(0).Text)
                    
                    If rstCustomers!Cmoney > 0 Then
                    
                        If SelectRate = 0 Then
                        
                            rstCustomers!SendableNum = -1
                            rstCustomers!SendFlag = 0
                            rstCustomers.Update
                            
                        Else
                        
                            rstCustomers!SendableNum = Int(rstCustomers!Cmoney / SelectRate)
                            
                            If rstCustomers!SendableNum = 0 Then
                                rstCustomers!SendFlag = 1
                            Else
                                rstCustomers!SendFlag = 0
                            End If
                            
                            rstCustomers.Update
                            
                        End If
                        
                    Else
                    
                        rstCustomers!SendFlag = 1
                        rstCustomers!SendableNum = 0
                        rstCustomers.Update
                        
                    End If
                    
                    '设置更正单用户(包月用户)的计费设置
                    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
                
                End If
                
                With frmErrRep!Gridbrowser
                
                    .TextMatrix(.RowSel, 1) = txtUserID(1).Text
                    .TextMatrix(.RowSel, 2) = txtUserName(1).Text
                    .TextMatrix(.RowSel, 4) = dtpDate(1).Value
                    .TextMatrix(.RowSel, 5) = txtFL(1).Text
                    .TextMatrix(.RowSel, 3) = txtNmoney(1).Text
                    .TextMatrix(.RowSel, 9) = txtCmoney(1).Text
                    .TextMatrix(.RowSel, 11) = Trim(Str(Me.JFquan))
                

⌨️ 快捷键说明

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