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

📄 clskmcheck.cls

📁 一个用VB写的财务软件源码
💻 CLS
📖 第 1 页 / 共 2 页
字号:
    k = i Mod 2
    i = i \ 2
    If k = 1 Then
        CheckUse = CheckUse + LoadResString(j) + "、"
    End If
    j = j + 1
Wend
If CheckUse <> "" Then CheckUse = "本科目已在以下子系统中使用:" + Left(CheckUse, Len(CheckUse) - 1)
End Function

Public Function SpecialCheck(ByVal kmdm As String) As Boolean
'关系检查 返回检查结果chechresult ,报警WarningInfo(),使用UsedFlag
    Dim testtemp1, testtemp2, testtemp3 As Boolean
    Dim i As Integer
    Call loadUsedFlag(kmdm)
    testtemp3 = True
    If ThisNodeInfo.iAppendModifyFlag = 0 Then
        'testtemp1 = IsXgbzCheck
         testtemp1 = True
        testtemp2 = IsQcyeCheck
        WarningInfo(1, 12) = IsFzhsCheck
    End If
    If ThisNodeInfo.iAppendModifyFlag = 1 Then
        If ThisNodeInfo.iSonNum > 0 Then
            SpecialCheck = True
            Exit Function
        End If
       ' testtemp1 = IsXgbzCheck
       testtemp1 = True
        testtemp2 = IsQcyeCheck
'        testtemp3 = True
    End If
    If ThisNodeInfo.iAppendModifyFlag = 2 Then
        testtemp1 = IsXgbzCheck
       'testtemp1 = True
        testtemp2 = IsQcyeCheck
    End If
    If ThisNodeInfo.sKmdm = "" Then
        SpecialCheck = True
        Exit Function
    End If
    If testtemp1 Then
        SpecialCheck = True
    Else
        WarningInfo(1, 11) = "已经参与凭证的记账!"

    End If
    If Not UsedFlag.bYhdzdUsed Then
         SpecialCheck = True
    Else
         WarningInfo(1, 13) = "设置了银行对账单!"

    End If

    If Not UsedFlag.bZpUsed Then
         SpecialCheck = True
    Else
         WarningInfo(1, 14) = "设置了支票!"

    End If


    WarningInfo(1, 15) = CheckUse
            
            If Not (testtemp2) Then
                If ThisNodeInfo.iSonNum = 0 Then
                    WarningInfo(2, 1) = "将要更改期初余额或余额方向?"
                    
                Else
                    WarningInfo(1, 15) = "不能更改期初余额或余额方向!"
                    SpecialCheck = False
                    Exit Function
                End If
            Else
                'WarningInfo(2, 1) = "将要更改期初余额或余额方向?"
            End If
                With UsedFlag
                    If .bFfdykm Then
                        WarningInfo(3, 1) = "被设置了非法科目?"
                    End If
                    If .bPzlb Then
                            If Not (ThisNodeInfo.sKmmc = NodeInputInfo.sKmmc And ThisNodeInfo.iAppendModifyFlag = 0) Then
'                                   WarningInfo(2, 2) = "设置了凭证类别?"
                            End If
                    End If
                    If .bPzmbUsed Then
                        If Not (ThisNodeInfo.sKmmc = NodeInputInfo.sKmmc And ThisNodeInfo.iAppendModifyFlag = 0) Then
                              WarningInfo(2, 3) = "设置了凭证模板?"
                        End If
                    End If
                    If .bPzUsed Then
                        If Not (ThisNodeInfo.sKmmc = NodeInputInfo.sKmmc And ThisNodeInfo.iAppendModifyFlag = 0) Then
                              WarningInfo(2, 4) = "设置了凭证?"
                        End If
                    End If
                    If .bThmbUsed Then
                         If Not (ThisNodeInfo.sKmmc = NodeInputInfo.sKmmc And ThisNodeInfo.iAppendModifyFlag = 0) Then
                              WarningInfo(2, 5) = "设置了调汇凭证?"
                         End If
                    End If
                    If .bZzpzmbUsed Then
                         If Not (ThisNodeInfo.sKmmc = NodeInputInfo.sKmmc And ThisNodeInfo.iAppendModifyFlag = 0) Then
                             WarningInfo(2, 6) = "设置了转账凭证模板?"
                         End If
                    End If
                End With
             For i = 11 To 15
                 If WarningInfo(1, i) <> "" Then SpecialCheck = False
             Next i
             For i = 1 To 30
                 If WarningInfo(2, i) <> "" Then SpecialCheck = False
             Next i
End Function
Public Sub WarningReport()
'报告报警信息,对所有报警信息编号
    Dim i As Integer
    Dim sTemp As String
    For i = 1 To 30
        If WarningInfo(1, i) <> "" Then
            sTemp = sTemp + WarningInfo(1, i) + chr(13) + chr(10)
        End If
    Next i
    If sTemp <> "" Then
        MsgBox sTemp & "不能添加/修改!", vbInformation
        ThisNodeInfo.bUniteAlow = False
        Exit Sub
    End If
        
    
    If WarningInfo(3, 2) <> "" Then
        MsgBox WarningInfo(3, 2) & "不能添加!", vbInformation
        ThisNodeInfo.bUniteAlow = False
        Exit Sub
    End If
    For i = 1 To 30
        If WarningInfo(2, i) <> "" Then
            sTemp = sTemp + WarningInfo(2, i) + chr(13) + chr(10)
        End If
    Next i
    
    If sTemp <> "" Then
        sTemp = sTemp + "是否继续更改相应设置?"
        If MsgBox(sTemp, vbYesNo) = vbYes Then
            ThisNodeInfo.bUniteAlow = True

            
        Else
            ThisNodeInfo.bUniteAlow = False
        
        End If
    End If
End Sub


Public Sub UniteUpdate() '联动修改tzw_balance(当方向改变的时候启用),tzw_type,tzw_templetdetail,tzw_pzsj,tzw_zzhdset,tzw_zzpzset
   Dim i As Integer
   Dim kmdm As String
   Dim sTemp As String
   Dim adoRstTemp As ADODB.Recordset
   Set adoRstTemp = New Recordset
   adoRstTemp.CursorLocation = adUseClient
   For i = 1 To 30
     If WarningInfo(2, i) <> "" Or i = 1 Then
    
      Select Case i
       Case 1
            If ThisNodeInfo.sYefx <> NodeInputInfo.sYefx And ThisNodeInfo.iXgbzFlag <= 1 Then
                Dim sTempNum, sTempSql As String
                Dim j As Integer
                For j = 0 To 12         '当要求只修改起始月份以前的期初余额时将12改为 val(glo.sBeginMonth) -1
                     sTempNum = Format$(j, "00")
                     If ThisNodeInfo.iAppendModifyFlag = 1 Then
                         glo.cnnMain.Execute "update tzw_balance" & glo.sOperateYear & " set yefx = '" & NodeInputInfo.sYefx & "',ljjsl" & sTempNum & " = ljjsl" & sTempNum & " - " & ThisNodeInfo.iQcyeSl & _
                                                                                  ",ljdsl" & sTempNum & " = ljdsl" & sTempNum & " - " & ThisNodeInfo.iQcyeSl & _
                                                                                  ",ljjwb" & sTempNum & " = ljjwb" & sTempNum & " - " & ThisNodeInfo.iQcyeWb & _
                                                                                  ",ljdwb" & sTempNum & " = ljdwb" & sTempNum & " - " & ThisNodeInfo.iQcyeWb & _
                                                                                  ",ljj" & sTempNum & " = ljj" & sTempNum & " - " & ThisNodeInfo.iQcyeXj & _
                                                                                  ",ljd" & sTempNum & " = ljd" & sTempNum & " - " & ThisNodeInfo.iQcyeXj & " where kmdm = '" & NodeInputInfo.sKmdm & "'"
                     Else
                         glo.cnnMain.Execute "update tzw_balance" & glo.sOperateYear & " set yefx = '" & NodeInputInfo.sYefx & "',ljjsl" & sTempNum & " = ljjsl" & sTempNum & " - " & ThisNodeInfo.iQcyeSl & _
                                                                                  ",ljdsl" & sTempNum & " = ljdsl" & sTempNum & " - " & ThisNodeInfo.iQcyeSl & _
                                                                                  ",ljjwb" & sTempNum & " = ljjwb" & sTempNum & " - " & ThisNodeInfo.iQcyeWb & _
                                                                                  ",ljdwb" & sTempNum & " = ljdwb" & sTempNum & " - " & ThisNodeInfo.iQcyeWb & _
                                                                                  ",ljj" & sTempNum & " = ljj" & sTempNum & " - " & ThisNodeInfo.iQcyeXj & _
                                                                                  ",ljd" & sTempNum & " = ljd" & sTempNum & " - " & ThisNodeInfo.iQcyeXj & " where kmdm = '" & ThisNodeInfo.sKmdm & "'"
                    End If
                Next j
              
            End If
       Case 2
         kmdm = ThisNodeInfo.sKmdm
         If ThisNodeInfo.iAppendModifyFlag = 1 Then

             adoRstTemp.Open "select * from tzw_type" & glo.sOperateYear & " order by signid" _
                  , glo.cnnMain, adOpenStatic, adLockOptimistic
             If Not (adoRstTemp.BOF And adoRstTemp.EOF) Then
               
             
                  Do Until adoRstTemp.EOF
                    If Not IsNull(adoRstTemp.Fields("jfbykm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("jfbykm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("jfbykm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("jfbykm").value = Trim$(sTemp)
                        End If
                    End If
                    If Not IsNull(adoRstTemp.Fields("jfbwkm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("jfbwkm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("jfbwkm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("jfbwkm").value = Trim$(sTemp)
                        End If
                    End If
                    If Not IsNull(adoRstTemp.Fields("dfbykm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("dfbykm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("dfbykm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("dfbykm").value = Trim$(sTemp)
                        End If
                    End If
                    If Not IsNull(adoRstTemp.Fields("dfbwkm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("dfbwkm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("dfbwkm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("dfbwkm").value = Trim$(sTemp)
                        End If
                    End If
                    If Not IsNull(adoRstTemp.Fields("pzbykm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("pzbykm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("pzbykm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("pzbykm").value = Trim$(sTemp)
                        End If
                    End If
                    If Not IsNull(adoRstTemp.Fields("pzbwkm").value) Then
                        If InStr(1, Trim$(adoRstTemp.Fields("pzbwkm").value), kmdm) > 0 Then
                            sTemp = Replace(adoRstTemp.Fields("pzbwkm").value, ThisNodeInfo.sKmdm, NodeInputInfo.sKmdm, 1)
                            adoRstTemp.Fields("pzbwkm").value = Trim$(sTemp)
                        End If
                    End If
                    adoRstTemp.Update
                    adoRstTemp.MoveNext
                 Loop
             End If
             adoRstTemp.Close
             Set adoRstTemp = Nothing
             
         End If
       Case 3
         If ThisNodeInfo.iAppendModifyFlag = 1 Then
             glo.cnnMain.Execute "update tzw_templetdetail" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             
         End If
         If ThisNodeInfo.iAppendModifyFlag = 0 Then
             glo.cnnMain.Execute "update tzw_templetdetail" & glo.sOperateYear & " set kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             
         End If
       Case 4
         If ThisNodeInfo.iAppendModifyFlag = 1 Then
             glo.cnnMain.Execute "update tzw_yhdzd" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update tzw_pzsj" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update TFZ_XMBMPZSJ" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update tYSYF_Pzsj" & glo.sOperateYear & " set ckmdm = '" & NodeInputInfo.sKmdm & "', ckmmc = '" & NodeInputInfo.sKmmc & _
                  "' where ckmdm ='" & ThisNodeInfo.sKmdm & "'"
            glo.cnnMain.Execute "update tusu_fz" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
            glo.cnnMain.Execute "update TFZ_KMXMFILTER" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
            glo.cnnMain.Execute "update tysyf_fz" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
          
         End If
         If ThisNodeInfo.iAppendModifyFlag = 0 Then
             glo.cnnMain.Execute "update tzw_pzsj" & glo.sOperateYear & " set kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update TFZ_XMBMPZSJ" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update tYSYF_Pzsj" & glo.sOperateYear & " set ckmdm = '" & NodeInputInfo.sKmdm & "', ckmmc = '" & NodeInputInfo.sKmmc & _
                  "' where ckmdm ='" & ThisNodeInfo.sKmdm & "'"
            glo.cnnMain.Execute "update TFZ_KMXMFILTER" & glo.sOperateYear & " set kmdm = '" & NodeInputInfo.sKmdm & "', kmmc = '" & NodeInputInfo.sKmmc & _
                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
         End If
       Case 5
         If ThisNodeInfo.iAppendModifyFlag = 1 Then
             glo.cnnMain.Execute "update tzw_zzhdset" & glo.sOperateYear & " set sykmdm = '" & NodeInputInfo.sKmdm & "', sykmmc = '" & NodeInputInfo.sKmmc & _
                  "' where sykmdm ='" & ThisNodeInfo.sKmdm & "'"
            glo.cnnMain.Execute "update tzw_zzhdset" & glo.sOperateYear & " set sskmdm = '" & NodeInputInfo.sKmdm & "', sskmmc = '" & NodeInputInfo.sKmmc & _
                  "' where sskmdm ='" & ThisNodeInfo.sKmdm & "'"

         End If
         If ThisNodeInfo.iAppendModifyFlag = 0 Then
             glo.cnnMain.Execute "update tzw_zzhdset" & glo.sOperateYear & " set sykmmc = '" & NodeInputInfo.sKmmc & _
                  "' where sykmdm ='" & ThisNodeInfo.sKmdm & "'"
             glo.cnnMain.Execute "update tzw_zzhdset" & glo.sOperateYear & " set sskmmc = '" & NodeInputInfo.sKmmc & _
                  "' where sskmdm ='" & ThisNodeInfo.sKmdm & "'"
         End If
       Case 6
         If ThisNodeInfo.iAppendModifyFlag = 1 Then
             glo.cnnMain.Execute "update tzw_zzpzset" & glo.sOperateYear & " set ckmdm = '" & NodeInputInfo.sKmdm & "" & _
                  "' where ckmdm ='" & ThisNodeInfo.sKmdm & "'"
         End If
         If ThisNodeInfo.iAppendModifyFlag = 0 Then
'             glo.cnnMain.Execute "update tzw_zzpzset" & glo.sOperateYear & " set kmmc = '" & NodeInputInfo.sKmmc & _
'                  "' where kmdm ='" & ThisNodeInfo.sKmdm & "'"
         End If
         
      End Select
     End If
   Next i
   ThisNodeInfo.bUniteUpdate = True
End Sub

⌨️ 快捷键说明

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