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

📄 单据查询条件.frm

📁 财务信息管理系统,适合做毕业论文的人使用
💻 FRM
📖 第 1 页 / 共 4 页
字号:
   Begin MSComctlLib.ImageList ilsTree 
      Left            =   450
      Top             =   3330
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "单据查询条件.frx":0058
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "单据查询条件.frx":04AA
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "单据查询条件.frx":08FC
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TreeView treStyle 
      Height          =   5330
      Left            =   0
      TabIndex        =   17
      Top             =   0
      Width           =   2490
      _ExtentX        =   4392
      _ExtentY        =   9393
      _Version        =   393217
      HideSelection   =   0   'False
      Indentation     =   529
      Style           =   5
      HotTracking     =   -1  'True
      ImageList       =   "ilsTree"
      Appearance      =   1
   End
End
Attribute VB_Name = "frmVchQueryFilter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_EO     As New U8FDEso.EntityObject
Public NodeKey   As Long
Public bVchInput As Boolean

Public Property Get EO() As U8FDEso.EntityObject
    Set EO = m_EO
End Property

Public Property Set EO(NewEO As U8FDEso.EntityObject)
    Set m_EO = NewEO
End Property

Private Sub accdef_code_CustKeyDown(ByVal key As EDITLib.KeyTypes)
    If key = KeyRet Then SendKeys "{TAB}"
End Sub

Private Sub accdef_code_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 113 Then 'F2
        RefCmd1.RunReference
    End If
End Sub

Private Sub bill_date_CustKeyDown(Index As Integer, ByVal key As EDITLib.KeyTypes)
    If key = KeyRet Then SendKeys "{TAB}"
End Sub

Private Sub bill_date_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
    If KeyCode = 113 Then 'F2
        DisplayCalendar bill_date(Index), Me.hWnd, Me.picView.left, Me.picView.top
        bill_date(Index).SetFocus
    End If
End Sub

Private Sub CmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    Dim objEO        As U8FDEso.EntityObject
    Dim objDataMgr   As New U8FDMgr.DataManager
    
    If IsDate(bill_date(0).Text) And IsDate(bill_date(1).Text) Then
        If DateDiff("d", bill_date(0).Text, bill_date(1).Text) < 0 Then
            MsgBox "制单日期应该从小到大!"
            Exit Sub
        End If
    End If
    If IsNumeric(code(0).Text) And IsNumeric(code(1).Text) Then
        If code(0).Text > code(1).Text Then
            MsgBox "业务编号应该从小到大!"
            Exit Sub
        End If
    End If
    If IsNumeric(money(0).Text) And IsNumeric(money(1).Text) Then
        If money(0).Text > money(1).Text Then
            MsgBox "金额应该从小到大!"
            Exit Sub
        End If
    End If
    If IsNumeric(naturalmoney(0).Text) And IsNumeric(naturalmoney(1).Text) Then
        If naturalmoney(0).Text > naturalmoney(1).Text Then
            MsgBox "本位币金额应该从小到大!"
            Exit Sub
        End If
    End If
    
    Set objEO = objDataMgr.LoadEOMetaData(g_sDataSourceName, NodeKey)
    
    Dim i As Integer, Index As Integer
    For i = 0 To lstItem.ListCount - 1
        If lstItem.Selected(i) = True Then
            Index = Index + 1
            objEO(mID(lstItem.List(i), InStrRev(lstItem.List(i), String(100, " ") & "&") + 101)).QryFldSqc = Index
        Else
            If cmbOrder(0).Text = lstItem.List(i) Or cmbOrder(1).Text = lstItem.List(i) Or cmbOrder(2).Text = lstItem.List(i) Then
                MsgBox "排序项目必须选择!", vbInformation, App.ProductName
                lstItem.Selected(i) = True
                Exit Sub
            End If
            objEO(mID(lstItem.List(i), InStrRev(lstItem.List(i), String(100, " ") & "&") + 101)).QryFldSqc = 0
        End If
        objEO(mID(lstItem.List(i), InStrRev(lstItem.List(i), String(100, " ") & "&") + 101)).RefFldSqc = 0
    Next
    If Index = 0 Then
        MsgBox "至少选择一个项目!", vbInformation, App.ProductName
        Exit Sub
    End If
    For i = 0 To 2
        objEO(mID(cmbOrder(i).Text, InStrRev(cmbOrder(i).Text, String(100, " ") & "&") + 101)).RefFldSqc = i + 1
    Next
    If cmbOrder(0).ListIndex = cmbOrder(1).ListIndex Or cmbOrder(0).ListIndex = cmbOrder(2).ListIndex Or cmbOrder(1).ListIndex = cmbOrder(2).ListIndex Then
        MsgBox "排序项目不能重复!", vbInformation, App.ProductName
        Exit Sub
    End If
    
    If Not objDataMgr.SaveEOMetaData(g_sDataSourceName, objEO, , False) Then
        MsgBox "保存不成功!", vbInformation, App.ProductName
    End If
    Set objDataMgr = Nothing
    
    Dim objfrmVchQueryResult As frmVchQueryResult
    Screen.MousePointer = vbHourglass
    For i = 0 To Forms.count - 1
        If Forms(i).Name = "frmVchQueryResult" Then
            Set objfrmVchQueryResult = Forms(i)
            Exit For
        End If
    Next
    
    Dim objVchQuerySQLBI As New U8FDBso.clsVchQuerySQLBI
    Dim SQL              As String
    
    objVchQuerySQLBI.DataSourceName = g_sDataSourceName
    objVchQuerySQLBI.NodeKey = NodeKey
    SQL = objVchQuerySQLBI.CreateSQL
    
    If IsDate(bill_date(0).Text) And IsDate(bill_date(1).Text) Then
        SQL = SQL & " and bill_date>='" & bill_date(0).Text & "' and bill_date<='" & bill_date(1).Text & "'"
    ElseIf IsDate(bill_date(0).Text) Then
        SQL = SQL & " and bill_date>='" & bill_date(0).Text & "'"
    ElseIf IsDate(bill_date(1).Text) Then
        SQL = SQL & " and bill_date<='" & bill_date(1).Text & "'"
    End If
    If code(0).Text <> "" And code(1).Text <> "" Then
        SQL = SQL & " and transactions_code>='" & right(String(10, "0") & code(0).Text, 10) & "' and transactions_code<='" & right(String(10, "0") & code(1).Text, 10) & "'"
    ElseIf code(0).Text <> "" Then
        SQL = SQL & " and transactions_code>='" & right(String(10, "0") & code(0).Text, 10) & "'"
    ElseIf code(1).Text <> "" Then
        SQL = SQL & " and transactions_code<='" & right(String(10, "0") & code(1).Text, 10) & "'"
    End If
    If accdef_code.Text <> "" Then
        If InStr(1, SQL, "fd_accdef.cAccID") > 0 Then
            SQL = SQL & " and fd_accdef.cAccID='" & accdef_code.Text & "'"
        Else
            SQL = SQL & " and tableTemp1.cAccID='" & accdef_code.Text & "'"
        End If
    End If
    If IsNumeric(money(0).Text) And IsNumeric(money(1).Text) Then
        SQL = SQL & " and sum_mny>=" & money(0).Text & " and sum_mny<=" & money(1).Text
    ElseIf IsNumeric(money(0).Text) Then
        SQL = SQL & " and sum_mny>=" & money(0).Text
    ElseIf IsNumeric(money(1).Text) Then
        SQL = SQL & " and sum_mny<=" & money(1).Text
    End If
    If IsNumeric(naturalmoney(0).Text) And IsNumeric(naturalmoney(1).Text) Then
        SQL = SQL & " and natural_mny>=" & naturalmoney(0).Text & " and natural_mny<=" & naturalmoney(1).Text
    ElseIf IsNumeric(naturalmoney(0).Text) Then
        SQL = SQL & " and natural_mny>=" & naturalmoney(0).Text
    ElseIf IsNumeric(naturalmoney(1).Text) Then
        SQL = SQL & " and natural_mny<=" & naturalmoney(1).Text
    End If
    If NodeKey <> 61 And objEO.DeriveBIType <> 61 And NodeKey <> 62 And objEO.DeriveBIType <> 62 And NodeKey <> 63 And objEO.DeriveBIType <> 63 And NodeKey <> 64 And objEO.DeriveBIType <> 64 Then
        If chkNotBook.Value = 1 Then
            'SQL = SQL & " and book_name is null"
        Else
            SQL = SQL & " and not book_name is null"
        End If
    End If
    SQL = SQL & " order by "
    For i = 1 To 3
        SQL = SQL & Trim(mID(cmbOrder(i - 1), 1, InStr(1, cmbOrder(i - 1), String(100, " ")))) & ","
    Next
    SQL = mID(SQL, 1, Len(SQL) - 1)
    
    Dim QueryStr As String
    If bVchInput Then
        Unload Me
        QueryStr = objDataMgr.MoveToBySQL(g_sDataSourceName, SQL)
        If QueryStr = 0 Then
            MsgBox "没有满足条件的记录!", vbInformation, App.ProductName
        Else
            frmVchInput.TransactionID = QueryStr
            frmVchInput.ShowFind
        End If
        Set objVchQuerySQLBI = Nothing
        Screen.MousePointer = vbDefault
        bVchInput = False
        Exit Sub
    End If
    
    If Not objfrmVchQueryResult Is Nothing Then
        BringWindowToTop objfrmVchQueryResult.hWnd
        objfrmVchQueryResult.SQL = SQL
        objfrmVchQueryResult.NodeKey = NodeKey
        Unload Me
        objfrmVchQueryResult.Adodc.RecordSource = objfrmVchQueryResult.SQL
        objfrmVchQueryResult.Adodc.Refresh
        objfrmVchQueryResult.RefreshMsFlexGrid
    Else
        frmVchQueryResult.SQL = SQL
        frmVchQueryResult.NodeKey = NodeKey
        Unload Me
        frmVchQueryResult.Show
    End If
    
    Set objVchQuerySQLBI = Nothing
    Screen.MousePointer = vbDefault
End Sub

Private Sub cmdOption_Click()
    Me.fraTerm.Visible = Not Me.fraTerm.Visible
    Me.fraSelect.Visible = Not Me.fraSelect.Visible
    
    If Me.fraTerm.Visible Then
        Me.cmdOption.Caption = "高级选项>>"
    Else
        Me.cmdOption.Caption = "<<普通选项"
    End If
End Sub

Private Sub cmdQueryFilter_Click(Index As Integer)
    If Index < 2 Then
        DisplayCalendar Me.bill_date(Index), Me.hWnd, Me.bill_date(Index).left, Me.bill_date(Index).top
        Me.bill_date(Index).SetFocus
    End If
End Sub

Private Sub cmdSelect_Click(Index As Integer)
    Dim i As Integer
    Select Case Index
        Case 0
            Dim lIndex As Integer
            lIndex = lstItem.ListIndex
            For i = 0 To lstItem.ListCount - 1
                lstItem.Selected(i) = True
            Next
            lstItem.ListIndex = lIndex
        Case 1
            If lstItem.ListCount > 0 Then
                If lstItem.ListIndex = -1 Then
                    lstItem.Selected(0) = True
                End If
                lstItem.Selected(lstItem.ListIndex) = True
            End If
        Case 2
            If lstItem.ListCount > 0 Then
                If lstItem.ListIndex = -1 Then
                    lstItem.Selected(0) = False
                End If
                lstItem.Selected(lstItem.ListIndex) = False
            End If
        Case 3
            For i = 0 To lstItem.ListCount - 1
                lstItem.Selected(i) = False
            Next
    End Select
End Sub

Private Sub cmdArrow_Click(Index As Integer)
    Dim l As String
    Dim i As Integer
    Dim b As Boolean
    Select Case Index
       Case 0
           If lstItem.ListIndex > 0 Then
               l = lstItem.List(lstItem.ListIndex)
               b = lstItem.Selected(lstItem.ListIndex)

⌨️ 快捷键说明

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