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

📄 formcond.cls

📁 金算盘软件代码
💻 CLS
📖 第 1 页 / 共 5 页
字号:
                    blnMulAccount = False
                End If
                If blnMulAccount = True Then
                    mstrSelected(mlngCurentline, 5) = "选择项目"
                    mstrSelected(mlngCurentline, 6) = strKeyCode
                    mstrSelected(mlngCurentline, 7) = strMulsel
                    Dim strKeyField As String
                    Select Case UCase(mstrSelected(mlngCurentline, 2))
                        Case "CLASS1", "CLASS2", "CURRENCYS", "CUSTOM0", "CUSTOM1", "CUSTOM2", "CUSTOM3", "CUSTOM4", "CUSTOM5"
                            strKeyField = Left(mstrSelected(mlngCurentline, 2), Len(mstrSelected(mlngCurentline, 2)) - 1)
                        Case Else
                            strKeyField = mstrSelected(mlngCurentline, 2)
                    End Select
                    If Len(strKeyCode) > 0 Then
                        Dim strTempFindID As String
                        strTempFindID = Trim(Filter.FindAllKeyID(Trim(mstrSelected(mlngCurentline, 2)), strMulsel))
                        strKeyCode = IIf(strTempFindID <> "", strKeyCode & "," & strTempFindID, strKeyCode)
                    End If
                    mstrSelected(mlngCurentline, 8) = Trim(mstrSelected(mlngCurentline, 4)) & ".lng" & Trim(strKeyField) & "ID IN (" & Trim(strKeyCode) & ")"
                    AddSelectedTag frmFilterSet
                    .MsgFilter.TextMatrix(mlngCurentline, 1) = strMulsel
                    AddMsgFilter frmFilterSet
                    
                    Dim strTemp As String
                    Dim strTempCode As String
                    strTemp = Trim(strMulsel)
                ElseIf Left(.tvwFilter.Nodes(mlngCurLineOfSelect).Tag, 1) = "*" Then
                    DelCurentline frmFilterSet
                    Exit Sub
                End If
            Else
                If mstrSelected(mlngCurentline, 1) = "单据类型" Or mstrSelected(mlngCurentline, 1) = "发出单据类型" Or mstrSelected(mlngCurentline, 1) = "收回单据类型" Then
                    Dim strDetail As String
                    Select Case mlngViewID
                        Case 4, 360, 500, 540, 633, 634, 1020, 1021, 1022
                            strDetail = "0"
                        Case 20, 22, 23, 50, 67, 126, 609, 610, 611, 212, 214, 746, 747, 638, 639, 668, 670, 359, 2, 1004, 1005, 1006, 1007, 1008, 1010, 1012, 1013, 1141, 1142, 1143, 1144, 1107, 1108
                            strDetail = "1"
                        Case 21
                            strDetail = "5"
                        Case 75
                            strDetail = "2"
                        Case 78
                            strDetail = "3"
                        Case 142
                            strDetail = "4"
                        Case 37, 49, 51, 66, 68, 73, 93, 104, 123, 148, 150, 152, 153
                            strDetail = "6"
                        Case 711, 712, 713
                            strDetail = "8"
                        Case 743, 744, 745
                            strDetail = "9"
                        Case 749, 750, 751, 752, 1145, 541, 571, 763, 764, 579, 570, 568, 580, 1106
                            strDetail = "A"
                        Case 567, 578
                            strDetail = "B"
                        Case 693, 694
                            strDetail = "C"
                        Case 699, 700
                            strDetail = "D"
                        Case 701, 702, 705, 706, 801, 802
                            strDetail = "E"
                        Case 707, 708, 461, 515, 719, 720, 770, 771, 772
                            strDetail = "F"
                        Case 727, 728, 731, 732, 803, 804
                            strDetail = "G"
                        Case 735, 736, 739, 740, 805, 806
                            strDetail = "H"
                    End Select
                End If
                If mstrSelected(mlngCurentline, 1) = "应收单据类型" Or mstrSelected(mlngCurentline, 1) = "应付单据类型" Or mstrSelected(mlngCurentline, 1) = "往来单据类型" Or mstrSelected(mlngCurentline, 1) = "核销单据类型" Then
                    FrmMultiSelect.AccountFilter "单据类型1", strKeyCode, True
                ElseIf mstrSelected(mlngCurentline, 1) = "凭证来源" Then
                    #If conVersionType = 16 Then
                        If Not (gclsBase.ControlAccount Or Not gclsBase.BaseNoControl) Then
                            FrmMultiSelect.AccountFilter "凭证来源1", strKeyCode, True
                        Else
                            FrmMultiSelect.AccountFilter "凭证来源", strKeyCode, True
                        End If
                    #Else
                        FrmMultiSelect.AccountFilter "凭证来源", strKeyCode, True
                    #End If
                Else
                    FrmMultiSelect.AccountFilter mstrSelected(mlngCurentline, 1) & strDetail, strKeyCode, True
                End If
                If FrmMultiSelect.mTagShow = True Then
                    FrmMultiSelect.Show vbModal
                End If
                strMulsel = FrmMultiSelect.strCodeTerm
                strKeyCode = FrmMultiSelect.strOK
                blnOK = FrmMultiSelect.mblnOk
                Set FrmMultiSelect = Nothing
                If blnOK = False Then
                    Exit Sub
                End If
                If Trim(strMulsel) <> "" Then
                    strTemp = Trim(strKeyCode)
                    mstrSelected(mlngCurentline, 5) = strKeyCode
                    mstrSelected(mlngCurentline, 6) = Trim(strMulsel)
                    mstrSelected(mlngCurentline, 8) = Trim(mstrSelected(mlngCurentline, 2)) & " IN (" & Trim(strMulsel) & ")"
                    If mstrSelected(mlngCurentline, 1) = "辅助核算" Then
                        Dim strMulCond As String
                        If InStr(strMulsel, "单位") > 0 Then
                            strMulCond = mstrSelected(mlngCurentline, 4) & ".blnIsCustomer=1 "
                        Else
                            strMulCond = " 2>1 "
                        End If
                        If InStr(strMulsel, "部门") > 0 Then
                            strMulCond = strMulCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsDepartment=1 "
                        End If
                        If InStr(strMulsel, "职员") > 0 Then
                            strMulCond = strMulCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsEmployee=1 "
                        End If
                        If InStr(strMulsel, "统计") > 0 Then
                            strMulCond = strMulCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsClass1=1 "
                        End If
                        If InStr(strMulsel, "项目") > 0 Then
                            strMulCond = strMulCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsClass2=1 "
                        End If
                        mstrSelected(mlngCurentline, 8) = strMulCond
                    End If
                    AddSelectedTag frmFilterSet
                    .MsgFilter.TextMatrix(mlngCurentline, 1) = strKeyCode
                    AddMsgFilter frmFilterSet
                ElseIf Left(.tvwFilter.Nodes(mlngCurLineOfSelect).Tag, 1) = "*" Then
                    DelCurentline frmFilterSet
                    Exit Sub
                End If
            End If
            
            strTemp = ReplaceString(strTemp, ",", " ")
            Index = InStr(strTemp, " ")
            Do While Index > 0
                strTempCode = Left(strTemp, Index - 1)
                strTemp = Trim(Right(strTemp, Len(strTemp) - Index))
                Index = InStr(strTemp, " ")
            Loop
        Exit Sub
        'NOT MulSel CodeClass Handle
        Case Else
            '把当前行加入已选数组
            '** IF 1 **
            If UCase(mCurstrTemp(3)) = "CODE" Or UCase(mCurstrTemp(3)) = "ENUM" Then
                 Modifyrefertext1 frmFilterSet
                 mstrSelected(mlngCurentline, 5) = .ReferText1.Text
                 .ReferText1.SelStart = 0
                 If UCase(mstrSelected(mlngCurentline, 3)) = "CODE" Then
                    If Trim(.ReferText1.TextMatrix(.ReferText1.ReferRow, 1)) <> "" Then
                      '  mstrSelected(mlngCurentline, 5) = Trim(ReferText1.TextMatrix(ReferText1.ReferRow, 2))
                        mstrSelected(mlngCurentline, 6) = .ReferText1.TextMatrix(.ReferText1.ReferRow, 1)
                        mstrSelected(mlngCurentline, 14) = "0"
                    Else
                        mstrSelected(mlngCurentline, 5) = Trim(.ReferText1.TextMatrix(.ReferText1.ReferRow, 3) & .ReferText1.TextMatrix(.ReferText1.ReferRow, 4))
                        mstrSelected(mlngCurentline, 6) = Trim(.ReferText1.TextMatrix(.ReferText1.ReferRow, 5))
                        mstrSelected(mlngCurentline, 8) = mstrSelected(mlngCurentline, 6) & " in (" & " '" & Trim(mstrSelected(mlngCurentline, 5)) & "'" & ")"
                        mstrSelected(mlngCurentline, 14) = "1"
                        GoTo NextHandle
                    End If
                    Select Case UCase(mstrSelected(mlngCurentline, 2))
                        Case "CLASS1", "CLASS2", "CURRENCYS", "CUSTOM0", "CUSTOM1", "CUSTOM2", "CUSTOM3", "CUSTOM4", "CUSTOM5"
                            strKeyField = Left(mstrSelected(mlngCurentline, 2), Len(mstrSelected(mlngCurentline, 2)) - 1)
                        Case Else
                            strKeyField = mstrSelected(mlngCurentline, 2)
                    End Select
                    '找末级ID号.
                    strTempFindID = Trim(Filter.FindAllKeyID(Trim(mstrSelected(mlngCurentline, 2)), Left(mstrSelected(mlngCurentline, 5), InStr(mstrSelected(mlngCurentline, 5), " ") - 1)))
                    strKeyCode = IIf(strTempFindID <> "", Trim(mstrSelected(mlngCurentline, 6)) & "," & strTempFindID, Trim(mstrSelected(mlngCurentline, 6)))
                    mstrSelected(mlngCurentline, 8) = Trim(mstrSelected(mlngCurentline, 4)) & ".lng" & Trim(strKeyField) & "ID" & " in (" & Trim(strKeyCode) & ")"
                 Else
                    mstrSelected(mlngCurentline, 6) = "'" & Trim(mstrSelected(mlngCurentline, 5)) & "'"
                    mstrSelected(mlngCurentline, 8) = mstrSelected(mlngCurentline, 2) & " in (" & Trim(mstrSelected(mlngCurentline, 6)) & ")"
                    If mstrSelected(mlngCurentline, 1) = "辅助核算" Then
                        Dim strSingleCond As String
                        If InStr(mstrSelected(mlngCurentline, 6), "单位") > 0 Then
                            strSingleCond = mstrSelected(mlngCurentline, 4) & ".blnIsCustomer=1 "
                        Else
                            strSingleCond = " 2>1 "
                        End If
                        If InStr(mstrSelected(mlngCurentline, 6), "部门") > 0 Then
                            strSingleCond = strSingleCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsDepartment=1 "
                        End If
                        If InStr(mstrSelected(mlngCurentline, 6), "职员") > 0 Then
                            strSingleCond = strSingleCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsEmployee=1 "
                        End If
                        If InStr(mstrSelected(mlngCurentline, 6), "统计") > 0 Then
                            strSingleCond = strSingleCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsClass1=1 "
                        End If
                        If InStr(mstrSelected(mlngCurentline, 6), "项目") > 0 Then
                            strSingleCond = strSingleCond & " And " & mstrSelected(mlngCurentline, 4) & ".blnIsClass2=1 "
                        End If
                        mstrSelected(mlngCurentline, 8) = strSingleCond
                    End If
                 End If
NextHandle:
                 AddSelectedTag frmFilterSet
                 .MsgFilter.TextMatrix(mlngCurentline, 1) = Trim(mstrSelected(mlngCurentline, 5))
                 AddMsgFilter frmFilterSet
                 Exit Sub
            Else
                .txtFrom.Visible = True
                .txtTo.Visible = False
                .txtFrom.SetFocus
            End If
     End Select
   End With
End Sub

Public Sub TxtFrom_KeyDown(frmFilterSet As Form, KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyReturn Then
      KeyCode = vbKeyClear
      If frmFilterSet.txtFrom.Text <> "" Then
        If frmFilterSet.txtTo.Visible = True Then
             frmFilterSet.txtTo.SetFocus
        Else
             frmFilterSet.tvwFilter.SetFocus
        End If
      End If
  End If
End Sub
Public Sub txtTo_Change(frmFilterSet As Form)
  With frmFilterSet
    If UCase(mCurstrTemp(3)) <> "STRING" Then
        If Not IsNumeric(.txtTo.Text) And Trim(.txtTo.Text) <> "" And Trim(.txtTo.Text) <> "-" Then
            .txtTo.Text = Left(.txtTo.Text, Len(.txtTo.Text) - 1)
            SendKeys "{ENd}", True
        End If
    End If
  End With
End Sub
Public Sub txtFrom_Change(frmFilterSet As Form)
 With frmFilterSet
  If UCase(mCurstrTemp(3)) = "LONG" Or UCase(mCurstrTemp(3)) = "DOUBLE" Or UCase(mCurstrTemp(3)) = "INTEGER" Then
      If Not IsNumeric(.txtFrom.Text) And Trim(.txtFrom.Text) <> "" And Trim(.txtFrom.Text) <> "-" Then
        .txtFrom.Text = Left(.txtFrom.Text, Len(.txtFrom.Text) - 1)
        SendKeys "{ENd}", True
      End If
  End If
 End With
End Sub

Public Sub txtfrom_LostFocus(frmFilterSet As Form)
 With frmFilterSet
  If mItemNotExit = True Then Exit Sub
  '** IF 1 **
  If Trim(.txtFrom.Text) <> "" Then
        .txtFrom.Text = Trim(.txtFrom.Text)
         '** IF 2 **
        If UCase(mCurstrTemp(3)) = "LONG" Or UCase(mCurstrTemp(3)) = "DOUBLE" Or UCase(mCurstrTemp(3)) = "INTEGER" Then
         '** IF 3 **
            If Not IsNumeric(.txtFrom.Text) Or Right(.txtFrom.Text, 1) = "-" Or InStr(.txtFrom.Text, ",") > 0 Then
                MsgBox "输入的不是数字"
                Exit Sub
            Else
               If UCase(mCurstrTemp(3)) = "INTEGER" Then
                  If InStr(.txtFrom.Text, ".") > 0 Then
                      MsgBox "请输入整数."
                      Exit Sub
                  End If
               End If
         '** IF 4 **
               If .ReferText1.Text = "介于" Then
                       If (Not IsNumeric(.txtTo.Text)) Or InStr(.txtTo.Text, ",") > 0 Then
                          Exit Sub
                       Else
                          If CDbl(.txtFrom.Text) > CDbl(.txtTo.Text) Then
                               MsgBox ("请输入一个小于截止值的值")
                               Exit Sub
                          End If
                       End If
                        If .ActiveControl.Name = "TxtTo" Or .ActiveControl.Name = "ReferText1" Then Exit Sub
                       '把当前行加入已选数组
                       Modifyrefertext1 frmFilterSet
                       mstrSelected(mlngCurentline, 5) = .ReferText1.Text
                       mstrSelected(mlngCurentline, 6) = .txtFrom.Text
                       mstrSelected(mlngCurentline, 7) = .txtTo.Text
                       mstrSelected(mlngCurentline, 8) = mstrSelected(mlngCurentline, 2) & " >= " & Trim(mstrSelected(mlngCurentline, 6)) & " and " & mstrSelected(mlngCurentline, 2) & " <= " & Trim(mstrSelected(mlngCurentline, 7))
                       AddSelectedTag frmFilterSet
                       .MsgFilter.TextMatrix(mlngCurentline, 1) = .ReferText1.Text & " (" & .txtFrom.Text & " , " & .txtTo.Text & ")"
                       AddMsgFilter frmFilterSet
                       Exit Sub
          '** Else Of If 4 **
               Else
                '把当前行加入已选数组
                 Modifyrefertext1 frmFilterSet
                 Select Case .ReferText1.Text
                   Case "等于"
                      mstrSelected(mlngCurentline, 5) = " = "
                   Case "不等于"
                      mstrSelected(mlngCurentline, 5) = " <> "
                   Case "大于"

⌨️ 快捷键说明

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