上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:29k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form Dev_ItemQFilt 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "过滤"
  6.    ClientHeight    =   4875
  7.    ClientLeft      =   3210
  8.    ClientTop       =   1680
  9.    ClientWidth     =   5685
  10.    HelpContextID   =   2503002
  11.    Icon            =   "表_查询条件.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4875
  16.    ScaleWidth      =   5685
  17.    Begin TabDlg.SSTab SSTab1 
  18.       Height          =   4725
  19.       Left            =   75
  20.       TabIndex        =   0
  21.       Top             =   75
  22.       Width           =   5535
  23.       _ExtentX        =   9763
  24.       _ExtentY        =   8334
  25.       _Version        =   393216
  26.       Style           =   1
  27.       Tabs            =   2
  28.       TabsPerRow      =   2
  29.       TabHeight       =   520
  30.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  31.          Name            =   "宋体"
  32.          Size            =   9
  33.          Charset         =   134
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       TabCaption(0)   =   "一般过滤"
  40.       TabPicture(0)   =   "表_查询条件.frx":1042
  41.       Tab(0).ControlEnabled=   -1  'True
  42.       Tab(0).Control(0)=   "Label_C(0)"
  43.       Tab(0).Control(0).Enabled=   0   'False
  44.       Tab(0).Control(1)=   "Label1"
  45.       Tab(0).Control(1).Enabled=   0   'False
  46.       Tab(0).Control(2)=   "UnloadCheck"
  47.       Tab(0).Control(2).Enabled=   0   'False
  48.       Tab(0).Control(3)=   "Command1"
  49.       Tab(0).Control(3).Enabled=   0   'False
  50.       Tab(0).Control(4)=   "Command2"
  51.       Tab(0).Control(4).Enabled=   0   'False
  52.       Tab(0).Control(5)=   "Command6"
  53.       Tab(0).Control(5).Enabled=   0   'False
  54.       Tab(0).Control(6)=   "Combo_I(0)"
  55.       Tab(0).Control(6).Enabled=   0   'False
  56.       Tab(0).Control(7)=   "Combo1"
  57.       Tab(0).Control(7).Enabled=   0   'False
  58.       Tab(0).ControlCount=   8
  59.       TabCaption(1)   =   "条件过滤"
  60.       TabPicture(1)   =   "表_查询条件.frx":105E
  61.       Tab(1).ControlEnabled=   0   'False
  62.       Tab(1).Control(0)=   "Command5"
  63.       Tab(1).Control(1)=   "Command4"
  64.       Tab(1).Control(2)=   "Command3"
  65.       Tab(1).Control(3)=   "Combo5(3)"
  66.       Tab(1).Control(4)=   "Combo5(2)"
  67.       Tab(1).Control(5)=   "Combo5(1)"
  68.       Tab(1).Control(6)=   "Combo5(0)"
  69.       Tab(1).Control(7)=   "Combo4(3)"
  70.       Tab(1).Control(8)=   "Combo4(2)"
  71.       Tab(1).Control(9)=   "Combo4(1)"
  72.       Tab(1).Control(10)=   "Combo4(0)"
  73.       Tab(1).Control(11)=   "Combo3(3)"
  74.       Tab(1).Control(12)=   "Combo3(2)"
  75.       Tab(1).Control(13)=   "Combo3(1)"
  76.       Tab(1).Control(14)=   "Combo3(0)"
  77.       Tab(1).Control(15)=   "Combo2(3)"
  78.       Tab(1).Control(16)=   "Combo2(2)"
  79.       Tab(1).Control(17)=   "Combo2(1)"
  80.       Tab(1).Control(18)=   "Combo2(0)"
  81.       Tab(1).Control(19)=   "Label2(3)"
  82.       Tab(1).Control(20)=   "Label2(2)"
  83.       Tab(1).Control(21)=   "Label2(1)"
  84.       Tab(1).Control(22)=   "Label2(0)"
  85.       Tab(1).ControlCount=   23
  86.       Begin VB.ComboBox Combo1 
  87.          Height          =   300
  88.          Left            =   1400
  89.          Style           =   2  'Dropdown List
  90.          TabIndex        =   30
  91.          Top             =   840
  92.          Width           =   2775
  93.       End
  94.       Begin VB.ComboBox Combo_I 
  95.          ForeColor       =   &H00000000&
  96.          Height          =   300
  97.          Index           =   0
  98.          ItemData        =   "表_查询条件.frx":107A
  99.          Left            =   1380
  100.          List            =   "表_查询条件.frx":107C
  101.          TabIndex        =   27
  102.          Top             =   1890
  103.          Visible         =   0   'False
  104.          Width           =   3105
  105.       End
  106.       Begin VB.CommandButton Command6 
  107.          Caption         =   "设置(&S)"
  108.          Height          =   300
  109.          Left            =   90
  110.          TabIndex        =   26
  111.          Top             =   4320
  112.          Width           =   1120
  113.       End
  114.       Begin VB.CommandButton Command2 
  115.          Caption         =   "取消(&C)"
  116.          Height          =   300
  117.          Left            =   4230
  118.          TabIndex        =   18
  119.          Top             =   4320
  120.          Width           =   1120
  121.       End
  122.       Begin VB.CommandButton Command1 
  123.          Caption         =   "确定(&O)"
  124.          Height          =   300
  125.          Left            =   3030
  126.          TabIndex        =   17
  127.          Top             =   4320
  128.          Width           =   1120
  129.       End
  130.       Begin VB.CommandButton Command5 
  131.          Caption         =   "取消(&C)"
  132.          Height          =   300
  133.          Left            =   -70740
  134.          TabIndex        =   21
  135.          Top             =   4290
  136.          Width           =   1120
  137.       End
  138.       Begin VB.CommandButton Command4 
  139.          Caption         =   "查询(&D)"
  140.          Height          =   300
  141.          Left            =   -71940
  142.          TabIndex        =   20
  143.          Top             =   4290
  144.          Width           =   1120
  145.       End
  146.       Begin VB.CommandButton Command3 
  147.          Caption         =   "全清(&L)"
  148.          Height          =   300
  149.          Left            =   -74910
  150.          TabIndex        =   19
  151.          Top             =   4290
  152.          Width           =   1120
  153.       End
  154.       Begin VB.ComboBox Combo5 
  155.          Enabled         =   0   'False
  156.          Height          =   300
  157.          Index           =   3
  158.          ItemData        =   "表_查询条件.frx":107E
  159.          Left            =   -70410
  160.          List            =   "表_查询条件.frx":108B
  161.          Style           =   2  'Dropdown List
  162.          TabIndex        =   16
  163.          Top             =   2190
  164.          Width           =   795
  165.       End
  166.       Begin VB.ComboBox Combo5 
  167.          Height          =   300
  168.          Index           =   2
  169.          ItemData        =   "表_查询条件.frx":109D
  170.          Left            =   -70410
  171.          List            =   "表_查询条件.frx":10AA
  172.          Style           =   2  'Dropdown List
  173.          TabIndex        =   15
  174.          Top             =   1770
  175.          Width           =   795
  176.       End
  177.       Begin VB.ComboBox Combo5 
  178.          Height          =   300
  179.          Index           =   1
  180.          ItemData        =   "表_查询条件.frx":10BC
  181.          Left            =   -70410
  182.          List            =   "表_查询条件.frx":10C9
  183.          Style           =   2  'Dropdown List
  184.          TabIndex        =   14
  185.          Top             =   1320
  186.          Width           =   795
  187.       End
  188.       Begin VB.ComboBox Combo5 
  189.          Height          =   300
  190.          Index           =   0
  191.          ItemData        =   "表_查询条件.frx":10DB
  192.          Left            =   -70410
  193.          List            =   "表_查询条件.frx":10E8
  194.          Style           =   2  'Dropdown List
  195.          TabIndex        =   13
  196.          Top             =   840
  197.          Width           =   795
  198.       End
  199.       Begin VB.ComboBox Combo4 
  200.          Height          =   300
  201.          Index           =   3
  202.          Left            =   -72210
  203.          TabIndex        =   12
  204.          Top             =   2190
  205.          Width           =   1755
  206.       End
  207.       Begin VB.ComboBox Combo4 
  208.          Height          =   300
  209.          Index           =   2
  210.          Left            =   -72210
  211.          TabIndex        =   11
  212.          Top             =   1770
  213.          Width           =   1755
  214.       End
  215.       Begin VB.ComboBox Combo4 
  216.          Height          =   300
  217.          Index           =   1
  218.          Left            =   -72210
  219.          TabIndex        =   10
  220.          Top             =   1320
  221.          Width           =   1755
  222.       End
  223.       Begin VB.ComboBox Combo4 
  224.          Height          =   300
  225.          Index           =   0
  226.          Left            =   -72210
  227.          TabIndex        =   9
  228.          Top             =   840
  229.          Width           =   1755
  230.       End
  231.       Begin VB.ComboBox Combo3 
  232.          Height          =   300
  233.          Index           =   3
  234.          ItemData        =   "表_查询条件.frx":10FA
  235.          Left            =   -73230
  236.          List            =   "表_查询条件.frx":1116
  237.          Style           =   2  'Dropdown List
  238.          TabIndex        =   8
  239.          Top             =   2190
  240.          Width           =   975
  241.       End
  242.       Begin VB.ComboBox Combo3 
  243.          Height          =   300
  244.          Index           =   2
  245.          ItemData        =   "表_查询条件.frx":1150
  246.          Left            =   -73230
  247.          List            =   "表_查询条件.frx":116C
  248.          Style           =   2  'Dropdown List
  249.          TabIndex        =   7
  250.          Top             =   1770
  251.          Width           =   975
  252.       End
  253.       Begin VB.ComboBox Combo3 
  254.          Height          =   300
  255.          Index           =   1
  256.          ItemData        =   "表_查询条件.frx":11A6
  257.          Left            =   -73230
  258.          List            =   "表_查询条件.frx":11C2
  259.          Style           =   2  'Dropdown List
  260.          TabIndex        =   6
  261.          Top             =   1320
  262.          Width           =   975
  263.       End
  264.       Begin VB.ComboBox Combo3 
  265.          Height          =   300
  266.          Index           =   0
  267.          ItemData        =   "表_查询条件.frx":11FC
  268.          Left            =   -73230
  269.          List            =   "表_查询条件.frx":1218
  270.          Style           =   2  'Dropdown List
  271.          TabIndex        =   5
  272.          Top             =   840
  273.          Width           =   975
  274.       End
  275.       Begin VB.ComboBox Combo2 
  276.          Height          =   300
  277.          Index           =   3
  278.          ItemData        =   "表_查询条件.frx":1252
  279.          Left            =   -74790
  280.          List            =   "表_查询条件.frx":1259
  281.          Style           =   2  'Dropdown List
  282.          TabIndex        =   4
  283.          Top             =   2190
  284.          Width           =   1515
  285.       End
  286.       Begin VB.ComboBox Combo2 
  287.          Height          =   300
  288.          Index           =   2
  289.          ItemData        =   "表_查询条件.frx":1260
  290.          Left            =   -74790
  291.          List            =   "表_查询条件.frx":1267
  292.          Style           =   2  'Dropdown List
  293.          TabIndex        =   3
  294.          Top             =   1770
  295.          Width           =   1515
  296.       End
  297.       Begin VB.ComboBox Combo2 
  298.          Height          =   300
  299.          Index           =   1
  300.          ItemData        =   "表_查询条件.frx":126E
  301.          Left            =   -74790
  302.          List            =   "表_查询条件.frx":1275
  303.          Style           =   2  'Dropdown List
  304.          TabIndex        =   2
  305.          Top             =   1320
  306.          Width           =   1515
  307.       End
  308.       Begin VB.ComboBox Combo2 
  309.          Height          =   300
  310.          Index           =   0
  311.          ItemData        =   "表_查询条件.frx":127C
  312.          Left            =   -74790
  313.          List            =   "表_查询条件.frx":1283
  314.          Style           =   2  'Dropdown List
  315.          TabIndex        =   1
  316.          Top             =   840
  317.          Width           =   1515
  318.       End
  319.       Begin VB.CheckBox UnloadCheck 
  320.          Caption         =   "UnloadCheck"
  321.          Height          =   255
  322.          Left            =   480
  323.          TabIndex        =   31
  324.          Top             =   3960
  325.          Visible         =   0   'False
  326.          Width           =   1455
  327.       End
  328.       Begin VB.Label Label1 
  329.          AutoSize        =   -1  'True
  330.          Caption         =   "设备类别"
  331.          Height          =   180
  332.          Left            =   570
  333.          TabIndex        =   29
  334.          Top             =   870
  335.          Width           =   720
  336.       End
  337.       Begin VB.Label Label_C 
  338.          AutoSize        =   -1  'True
  339.          BackStyle       =   0  'Transparent
  340.          Caption         =   "性别"
  341.          Height          =   180
  342.          Index           =   0
  343.          Left            =   360
  344.          TabIndex        =   28
  345.          Top             =   1920
  346.          Visible         =   0   'False
  347.          Width           =   360
  348.       End
  349.       Begin VB.Label Label2 
  350.          AutoSize        =   -1  'True
  351.          Caption         =   "关系:"
  352.          Height          =   180
  353.          Index           =   3
  354.          Left            =   -70410
  355.          TabIndex        =   25
  356.          Top             =   600
  357.          Width           =   450
  358.       End
  359.       Begin VB.Label Label2 
  360.          AutoSize        =   -1  'True
  361.          Caption         =   "内容:"
  362.          Height          =   180
  363.          Index           =   2
  364.          Left            =   -72210
  365.          TabIndex        =   24
  366.          Top             =   600
  367.          Width           =   450
  368.       End
  369.       Begin VB.Label Label2 
  370.          AutoSize        =   -1  'True
  371.          Caption         =   "关系:"
  372.          Height          =   180
  373.          Index           =   1
  374.          Left            =   -73230
  375.          TabIndex        =   23
  376.          Top             =   600
  377.          Width           =   450
  378.       End
  379.       Begin VB.Label Label2 
  380.          AutoSize        =   -1  'True
  381.          Caption         =   "项目:"
  382.          Height          =   180
  383.          Index           =   0
  384.          Left            =   -74820
  385.          TabIndex        =   22
  386.          Top             =   600
  387.          Width           =   450
  388.       End
  389.    End
  390. End
  391. Attribute VB_Name = "Dev_ItemQFilt"
  392. Attribute VB_GlobalNameSpace = False
  393. Attribute VB_Creatable = False
  394. Attribute VB_PredeclaredId = True
  395. Attribute VB_Exposed = False
  396. Option Explicit
  397. Dim FieldName()
  398. Dim ItmeCorrelation() As String
  399. Dim Item_Code()
  400. Dim Item_Root()
  401. Dim Combo_ICode()
  402. Dim Combo4_Code()
  403. Private Sub Combo2_Click(Index As Integer)
  404.     On Error Resume Next
  405.     If Combo2(Index).Text <> "" Then
  406.        ComBo_AddList Combo4(Index), ItmeCorrelation(Combo2(Index).ListIndex), Index, True
  407.     Else
  408.        Combo4(Index).Clear
  409.     End If
  410. End Sub
  411. Private Sub Command1_Click()   '一般过滤
  412.     Dim aDo_Einfo As New Recordset
  413.     Dim i As Integer
  414.     Dim Ssql As String
  415.     Dim D As String
  416.     D = 1
  417.     For i = 1 To Combo_I.Count - 1
  418.         If Combo_I(i).Text <> "" Then
  419.             If D = 1 Then
  420.                 If Val(Combo_I(i).Tag) = 1 And Combo_I(i).ListIndex >= 0 Then
  421.                     Ssql = "b." & Label_C(i).Tag & "='" & Combo_ICode(i, Combo_I(i).ListIndex) & "'"
  422.                 Else
  423.                     Ssql = Label_C(i).Tag & "='" & Combo_I(i).Text & "'"
  424.                 End If
  425.                 '--------------
  426.             Else
  427.                 If Val(Combo_I(i).Tag) = 1 And Combo_I(i).ListIndex >= 0 Then
  428.                     Ssql = Ssql & " and " & " b." & Label_C(i).Tag & "='" & Combo_ICode(i, Combo_I(i).ListIndex) & "'"
  429.                 Else
  430.                     Ssql = Ssql & " and " & "b." & Label_C(i).Tag & "='" & Combo_I(i).Text & "'"
  431.                 End If
  432.                 '---------
  433.             End If
  434.             D = D + 1
  435.         End If
  436.     Next i
  437.     
  438.     '-----------------
  439.     If Trim(Ssql) = "" Then
  440.         Ssql = "b.DEVSort='" & Combo1.ItemData(Combo1.ListIndex) & "'"
  441.     Else
  442.         Ssql = Ssql & " and b.DEVSort='" & Combo1.ItemData(Combo1.ListIndex) & "'"
  443.     End If
  444.     P_Ssql = Ssql
  445.     Enployeeinfo_Query Ssql
  446.     '-----------------
  447.     Me.Hide
  448. End Sub
  449. Private Sub Command2_Click()
  450. Unload Me
  451. End Sub
  452. Private Sub Command3_Click()
  453.     Dim c As Integer
  454.     For c = 0 To 3
  455.        Combo2(c).ListIndex = 0
  456.        Combo3(c).ListIndex = 0
  457.        Combo4(c).Text = ""
  458.        Combo4(c).Clear
  459.        Combo5(c).ListIndex = 0
  460.     Next c
  461. End Sub
  462. Private Sub Command4_Click() '条件过滤
  463. Dim Footing
  464. Dim Footing1
  465. Dim r As Integer
  466. Dim Ssql As String
  467. Footing = Array("", "=", "<>", "Like", ">", "<", ">=", "<=")
  468. Footing1 = Array("", "AND", "OR")
  469. '-------------------
  470. For r = 0 To 3
  471. If Trim(Combo2(r).Text) = "" Then MsgBox "项目错误!  ", 48, "过滤": Combo2(r).SetFocus: Exit Sub
  472. If Trim(Combo3(r).Text) = "" Then MsgBox "关系错误!  ", 48, "过滤": Combo3(r).SetFocus: Exit Sub
  473. '--------------------
  474.  If Combo2(r).ItemData(Combo2(r).ListIndex) = 2 Then
  475.     If IsDate(Combo4(r)) = False And Trim(Combo4(r)) <> "" Then
  476.        MsgBox "非法日期格式!" & Format(Date, "yyyy-mm-dd"), 16
  477.        Combo4(r).SetFocus
  478.        Exit Sub
  479.     Else
  480.        Combo4(r).Text = Format(Trim(Combo4(r).Text), "yyyy-mm-dd")
  481.     End If
  482.  End If
  483. '------------------------
  484.     If Combo5(r).Text = "" Then
  485.         '-----------------
  486.        If Combo3(r).ListIndex <> 3 Then
  487.             If Item_Code(Combo2(r).ListIndex) = 1 And Combo4(r).ListIndex >= 0 Then
  488.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  489.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "'"
  490.                   Else
  491.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "'"
  492.                End If
  493.              Else
  494.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  495.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "'"
  496.                   Else
  497.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "'"
  498.                End If
  499.             End If
  500.             '--------------
  501.           Else
  502.            If Item_Code(Combo2(r).ListIndex) = 1 And Combo4(r).ListIndex >= 0 Then
  503.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  504.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "%'"
  505.                   Else
  506.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "%'"
  507.                End If
  508.               Else
  509.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  510.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "%'"
  511.                   Else
  512.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "%'"
  513.                End If
  514.            End If
  515.             '--------------
  516.        End If
  517.        Exit For
  518.        '-------------------
  519.      Else
  520.        '------------------
  521.        If Combo3(r).ListIndex <> 3 Then
  522.           If Item_Code(Combo2(r).ListIndex) = 1 And Combo4(r).ListIndex >= 0 Then
  523.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  524.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "'" & " " & Footing1(Combo5(r).ListIndex) & " "
  525.                   Else
  526.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "'" & " " & Footing1(Combo5(r).ListIndex) & " "
  527.                End If
  528.              Else
  529.                If Item_Root(Combo2(r).ListIndex) = "1" Then
  530.                    Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "'" & " " & Footing1(Combo5(r).ListIndex) & " "
  531.                   Else
  532.                    Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "'" & " " & Footing1(Combo5(r).ListIndex) & " "
  533.                End If
  534.           End If
  535.           '--------------
  536.         Else
  537.           If Item_Code(Combo2(r).ListIndex) = 1 And Combo4(r).ListIndex >= 0 Then
  538.               If Item_Root(Combo2(r).ListIndex) = "1" Then
  539.                   Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "%'" & " " & Footing1(Combo5(r).ListIndex) & " "
  540.                  Else
  541.                   Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Combo4_Code(r, Combo4(r).ListIndex) & "%'" & " " & Footing1(Combo5(r).ListIndex) & " "
  542.               End If
  543.              Else
  544.               If Item_Root(Combo2(r).ListIndex) = "1" Then
  545.                   Ssql = Ssql & "b." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "%'" & " " & Footing1(Combo5(r).ListIndex) & " "
  546.                  Else
  547.                   Ssql = Ssql & "a." & FieldName(Combo2(r).ListIndex) & " " & Footing(Combo3(r).ListIndex) & " '" & Trim(Combo4(r).Text) & "%'" & " " & Footing1(Combo5(r).ListIndex) & " "
  548.               End If
  549.           End If
  550.        End If
  551.        '------------------
  552.     End If
  553.     '--------------------
  554.     
  555. Next
  556. Enployeeinfo_Query Ssql
  557. '---------------
  558. Me.Hide
  559. End Sub
  560. Private Sub Command5_Click()
  561.   Unload Me
  562. End Sub
  563. Private Sub Command6_Click()
  564.   Dev_ItemQueryItem.Show 1
  565. End Sub
  566. Private Sub Form_Load()
  567.     Dim aDo_Item As New Recordset
  568.     Dim i As Integer
  569.     List
  570.     
  571.     Set aDo_Item = Cw_DataEnvi.DataConnect.Execute("select * from dev_item ")
  572.     With aDo_Item
  573.         i = 1
  574.         ReDim FieldName(aDo_Item.RecordCount + 1)
  575.         ReDim Item_Code(aDo_Item.RecordCount + 1)
  576.         ReDim ItmeCorrelation(aDo_Item.RecordCount + 1)
  577.         ReDim Item_Root(aDo_Item.RecordCount + 1)
  578.         Do While Not .EOF
  579.            Combo2(0).AddItem !ItemChineseName
  580.            Combo2(0).ItemData(i) = !ItemFieldType
  581.            Combo2(1).AddItem !ItemChineseName
  582.            Combo2(1).ItemData(i) = !ItemFieldType
  583.            Combo2(2).AddItem !ItemChineseName
  584.            Combo2(2).ItemData(i) = !ItemFieldType
  585.            Combo2(3).AddItem !ItemChineseName
  586.            FieldName(i) = !ItemFieldName
  587.            Item_Code(i) = !yncode
  588.            Item_Root(i) = !YNRoot
  589.            ItmeCorrelation(i) = "" & !ItmeCorrelation
  590.            i = i + 1
  591.            .MoveNext
  592.         Loop
  593.         
  594.         '-------------------
  595.         Dim ado_Itemtf As New Recordset
  596.         Dim aDo_Com As New Recordset
  597.          
  598.         Set aDo_Com = Cw_DataEnvi.DataConnect.Execute("select * from DEV_ItemSort")
  599.          i = 0
  600.         Combo1.Clear
  601.         Do While Not aDo_Com.EOF
  602.             Combo1.AddItem Trim(aDo_Com!ISName)
  603.             Combo1.ItemData(i) = aDo_Com!ISId
  604.             i = i + 1
  605.             aDo_Com.MoveNext
  606.         Loop
  607.         Combo1.ListIndex = 0
  608.         aDo_Com.Close
  609.         
  610.         '--------------------
  611.     
  612.     End With
  613. End Sub
  614. '------------------------------
  615. Public Sub List()          '显示项目
  616.     Dim B As Integer, TopInt As Integer
  617.     Dim D As Integer
  618.     Dim add_item As New Recordset
  619.     For B = 1 To Combo_I.Count - 1
  620.        Unload Combo_I(B): Unload Label_C(B)
  621.     Next B
  622.     '------------------------
  623.     
  624.      D = 1: TopInt = 1300
  625.     Set add_item = Cw_DataEnvi.DataConnect.Execute("select * from dev_item where YNquery='1'")
  626.         ReDim Combo_ICode(add_item.RecordCount, 0)
  627.         ReDim Combo4_Code(4, 0)
  628.         Do While Not add_item.EOF
  629.         '---------------------------
  630.     
  631.            '创建下拉列表框
  632.                
  633.             Load Combo_I(D)
  634.             Load Label_C(D)
  635.             Label_C(D).Top = TopInt
  636.             Label_C(D).Caption = add_item!ItemChineseName
  637.             Label_C(D).Left = 1400 - Label_C(D).Width - 100
  638.             
  639.             Label_C(D).Tag = "" & add_item!ItemFieldName
  640.             
  641.             Combo_I(D).Left = 1400
  642.             Combo_I(D).Top = Label_C(D).Top - 50
  643.             If add_item!ItmeFieldLength * 105 > Me.Width - 1500 Then
  644.                Combo_I(D).Width = 3500
  645.                Else
  646.                Combo_I(D).Width = add_item!ItmeFieldLength * 105
  647.             End If
  648.             Combo_I(D).Tag = "" & add_item!yncode
  649.             
  650.             ComBo_AddList Combo_I(D), "" & add_item!ItmeCorrelation, D, False
  651.             
  652.            '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  653.             Dim aDo_Com As New Recordset
  654.             Dim i As Integer
  655.             Dim Ssql As String
  656.             If Trim(add_item!TableName) <> "" Then
  657.                     If Trim(add_item!TableName) = "CorrelationList" Then
  658.                        Ssql = "select * from DEV_CorrelationSort A,DEV_CorrelationList B where " _
  659.                             & "A.SortCode=b.SortCode and A.SortName='" & Trim(add_item!ItmeCorrelation) & "' order by B.ListCode"
  660.                        Else
  661.                        Ssql = "select * from " & add_item!TableName
  662.                     End If
  663.                 
  664.                     Set aDo_Com = Cw_DataEnvi.DataConnect.Execute(Ssql)
  665.                     
  666.                     i = 1
  667.                     
  668.                     Combo_I(D).Clear
  669.                     Combo_I(D).AddItem ""
  670.                     Combo_I(D).ItemData(0) = 0
  671.                     
  672.                     Do While Not aDo_Com.EOF
  673.                         If Trim(add_item!TableName) <> "CorrelationList" Then
  674.                            Combo_I(D).AddItem Trim(aDo_Com(Trim(add_item!CloumnName2)))
  675.                            Combo_I(D).ItemData(i) = aDo_Com(Trim(add_item!CloumnName1))
  676.                         Else
  677.                            Combo_I(D).AddItem Trim(aDo_Com!Listname)
  678.                            Combo_I(D).ItemData(i) = aDo_Com!ListCode
  679.                         End If
  680.                         i = i + 1
  681.                         aDo_Com.MoveNext
  682.                     Loop
  683.                     aDo_Com.Close
  684.                     
  685.             End If
  686.            '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  687.            
  688.             Combo_I(D).Visible = True
  689.             Label_C(D).Visible = True
  690.             D = D + 1
  691.             TopInt = TopInt + 400
  692.         '--------------------------------
  693.         add_item.MoveNext
  694.         Loop
  695.         add_item.Close
  696. End Sub
  697. Private Sub Form_Unload(Cancel As Integer)
  698.     If Not UnloadCheck.Value = 1 Then
  699.         Me.Hide
  700.     End If
  701. End Sub
  702. Public Sub Enployeeinfo_Query(Ssql_2 As String) '条件过滤
  703.     Dim aDo_Reco As New Recordset
  704.     Dim aDo_Item As New Recordset
  705.     Dim h As Integer: Dim c As Integer
  706.     Dim Str_Field As String
  707.     Dim ssql_1 As String
  708.     ssql_1 = Ssql_2
  709.     If ssql_1 = "" Then
  710.         ssql_1 = Item_Info & " where a.id=b.id"
  711.     Else
  712.         ssql_1 = Item_Info & " where a.id=b.id and " & ssql_1
  713.     End If
  714.     
  715.     Set aDo_Reco = Cw_DataEnvi.DataConnect.Execute(ssql_1)
  716.     Set aDo_Item = Cw_DataEnvi.DataConnect.Execute("select * from dev_Item a,DEV_ItemSortList b where a.ItemCode=b.ItemCode and b.isid=" & Dev_ItemQFilt.Combo1.ItemData(Dev_ItemQFilt.Combo1.ListIndex) & " order by tab")
  717.     With Dev_ItemQInfoForm.vsFlexGrid1
  718.         Dev_ItemQInfoForm.Tag = Dev_ItemQFilt.Combo1.ItemData(Dev_ItemQFilt.Combo1.ListIndex)
  719.         Dev_ItemQInfoForm.vsFlexGrid1.Tag = Dev_ItemQFilt.Combo1.Text
  720.         c = 1: h = 1
  721.         .Rows = aDo_Reco.RecordCount + 1
  722.         
  723.         Do While Not aDo_Item.EOF
  724.             Str_Field = Str_Field & "^" & aDo_Item!ItemChineseName & "|"
  725.             aDo_Item.MoveNext
  726.         Loop
  727.         .Clear
  728.         .FormatString = "<ID  |" & Str_Field
  729.         .Cols = aDo_Item.RecordCount + 1
  730.         aDo_Item.MoveFirst
  731.         
  732.         
  733.         Do While Not aDo_Reco.EOF
  734.             Do While Not aDo_Item.EOF
  735.                 If aDo_Item!yncode = 1 Then
  736.                     .TextMatrix(h, c) = Trim("" & aDo_Reco("N_" & Trim(aDo_Item!ItemFieldName)))
  737.                 Else
  738.                     .TextMatrix(h, c) = Trim("" & aDo_Reco(Trim(aDo_Item!ItemFieldName)))
  739.                 End If
  740.                 c = c + 1
  741.                 aDo_Item.MoveNext
  742.             Loop
  743.             .TextMatrix(h, 0) = h
  744.             aDo_Item.MoveFirst
  745.             c = 1
  746.             h = h + 1
  747.             aDo_Reco.MoveNext
  748.         Loop
  749.         aDo_Item.MoveFirst
  750.         c = 1
  751.         Do While Not aDo_Item.EOF
  752.             If Val("" & aDo_Item!Width) < 1 Then
  753.                 .ColWidth(c) = 800
  754.             Else
  755.                 .ColWidth(c) = Val("" & aDo_Item!Width)
  756.             End If
  757.             aDo_Item.MoveNext
  758.             c = c + 1
  759.         Loop
  760.     
  761.            
  762.     End With
  763.     aDo_Reco.Close
  764.     aDo_Item.Close
  765. End Sub
  766. Public Sub ComBo_AddList(Com As ComboBox, Str As String, r As Integer, tf As Boolean)  '添加Combox
  767.     Dim aDo_Com As New Recordset
  768.     Dim i As Integer
  769.     Dim Ssql As String
  770.     Ssql = "select * from DEV_CorrelationSort A,DEV_CorrelationList B where " _
  771.          & "A.SortCode=b.SortCode and A.SortName='" & Trim(Str) & "' order by B.ListCode"
  772.     Set aDo_Com = Cw_DataEnvi.DataConnect.Execute(Ssql)
  773.     '-----------
  774.     If tf = False Then
  775.         If aDo_Com.RecordCount > UBound(Combo_ICode, 2) Then
  776.             ReDim Preserve Combo_ICode(UBound(Combo_ICode, 1), aDo_Com.RecordCount)
  777.         End If
  778.         i = 1
  779.     Else
  780.         If aDo_Com.RecordCount > UBound(Combo4_Code, 2) Then
  781.             ReDim Preserve Combo4_Code(UBound(Combo4_Code, 1), aDo_Com.RecordCount)
  782.         End If
  783.         i = 0
  784.     End If
  785.     Com.Clear
  786.     '----------
  787.     Do While Not aDo_Com.EOF
  788.         Com.AddItem Trim(aDo_Com!Listname)
  789.         If tf = False Then
  790.             Combo_ICode(r, i) = aDo_Com!ListCode
  791.         Else
  792.             Combo4_Code(r, i) = aDo_Com!ListCode
  793.         End If
  794.         i = i + 1
  795.         aDo_Com.MoveNext
  796.     Loop
  797.     aDo_Com.Close
  798. End Sub