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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form Dev_ItemInfoForm 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "设备档案录入"
  7.    ClientHeight    =   6420
  8.    ClientLeft      =   1035
  9.    ClientTop       =   1155
  10.    ClientWidth     =   9960
  11.    HelpContextID   =   2503001
  12.    Icon            =   "设备档案_设备台帐.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6420
  17.    ScaleWidth      =   9960
  18.    StartUpPosition =   2  '屏幕中心
  19.    Begin VB.TextBox Label1 
  20.       BackColor       =   &H80000004&
  21.       BorderStyle     =   0  'None
  22.       Enabled         =   0   'False
  23.       Height          =   225
  24.       Left            =   1260
  25.       TabIndex        =   11
  26.       Text            =   "设备类别:"
  27.       Top             =   750
  28.       Width           =   825
  29.    End
  30.    Begin VB.CommandButton Command1 
  31.       Height          =   300
  32.       Left            =   3600
  33.       Picture         =   "设备档案_设备台帐.frx":1042
  34.       Style           =   1  'Graphical
  35.       TabIndex        =   10
  36.       TabStop         =   0   'False
  37.       Top             =   720
  38.       Width           =   300
  39.    End
  40.    Begin VB.TextBox Text1 
  41.       Height          =   285
  42.       Left            =   2070
  43.       Locked          =   -1  'True
  44.       TabIndex        =   9
  45.       Top             =   720
  46.       Width           =   1545
  47.    End
  48.    Begin TabDlg.SSTab SSTab1 
  49.       Height          =   5640
  50.       Left            =   60
  51.       TabIndex        =   1
  52.       Top             =   720
  53.       Width           =   9840
  54.       _ExtentX        =   17357
  55.       _ExtentY        =   9948
  56.       _Version        =   393216
  57.       Style           =   1
  58.       Tabs            =   1
  59.       TabsPerRow      =   4
  60.       TabHeight       =   520
  61.       MouseIcon       =   "设备档案_设备台帐.frx":13CC
  62.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  63.          Name            =   "宋体"
  64.          Size            =   9
  65.          Charset         =   134
  66.          Weight          =   400
  67.          Underline       =   0   'False
  68.          Italic          =   0   'False
  69.          Strikethrough   =   0   'False
  70.       EndProperty
  71.       TabCaption(0)   =   "基本信息&A"
  72.       TabPicture(0)   =   "设备档案_设备台帐.frx":13E8
  73.       Tab(0).ControlEnabled=   -1  'True
  74.       Tab(0).Control(0)=   "Picture1"
  75.       Tab(0).Control(0).Enabled=   0   'False
  76.       Tab(0).Control(1)=   "Command2(0)"
  77.       Tab(0).Control(1).Enabled=   0   'False
  78.       Tab(0).Control(2)=   "Command2(1)"
  79.       Tab(0).Control(2).Enabled=   0   'False
  80.       Tab(0).Control(3)=   "Command2(2)"
  81.       Tab(0).Control(3).Enabled=   0   'False
  82.       Tab(0).Control(4)=   "Command2(3)"
  83.       Tab(0).Control(4).Enabled=   0   'False
  84.       Tab(0).Control(5)=   "Command2(4)"
  85.       Tab(0).Control(5).Enabled=   0   'False
  86.       Tab(0).ControlCount=   6
  87.       Begin VB.CommandButton Command2 
  88.          Caption         =   "随机资料"
  89.          Height          =   300
  90.          Index           =   4
  91.          Left            =   8310
  92.          TabIndex        =   16
  93.          Top             =   0
  94.          Width           =   885
  95.       End
  96.       Begin VB.CommandButton Command2 
  97.          Caption         =   "易损件"
  98.          Height          =   300
  99.          Index           =   3
  100.          Left            =   7350
  101.          TabIndex        =   15
  102.          Top             =   0
  103.          Width           =   885
  104.       End
  105.       Begin VB.CommandButton Command2 
  106.          Caption         =   "备品备件"
  107.          Height          =   300
  108.          Index           =   2
  109.          Left            =   6390
  110.          TabIndex        =   14
  111.          Top             =   0
  112.          Width           =   885
  113.       End
  114.       Begin VB.CommandButton Command2 
  115.          Caption         =   "附属电机"
  116.          Height          =   300
  117.          Index           =   1
  118.          Left            =   5430
  119.          TabIndex        =   13
  120.          Top             =   0
  121.          Width           =   885
  122.       End
  123.       Begin VB.CommandButton Command2 
  124.          Caption         =   "配套件"
  125.          Height          =   300
  126.          Index           =   0
  127.          Left            =   4470
  128.          TabIndex        =   12
  129.          Top             =   0
  130.          Width           =   885
  131.       End
  132.       Begin VB.PictureBox Picture1 
  133.          Height          =   5023
  134.          Left            =   181
  135.          ScaleHeight     =   4965
  136.          ScaleWidth      =   9465
  137.          TabIndex        =   2
  138.          Top             =   452
  139.          Width           =   9524
  140.          Begin VB.VScrollBar VS_E 
  141.             Height          =   4965
  142.             LargeChange     =   20
  143.             Left            =   9163
  144.             SmallChange     =   200
  145.             TabIndex        =   6
  146.             Top             =   0
  147.             Width           =   286
  148.          End
  149.          Begin VB.PictureBox Pict 
  150.             BackColor       =   &H00E9F2F3&
  151.             BorderStyle     =   0  'None
  152.             Height          =   9042
  153.             Left            =   0
  154.             ScaleHeight     =   9045
  155.             ScaleMode       =   0  'User
  156.             ScaleWidth      =   9150
  157.             TabIndex        =   3
  158.             Top             =   0
  159.             Width           =   9148
  160.             Begin VB.CommandButton Comm_Info 
  161.                Height          =   300
  162.                Left            =   3690
  163.                Picture         =   "设备档案_设备台帐.frx":1404
  164.                Style           =   1  'Graphical
  165.                TabIndex        =   8
  166.                TabStop         =   0   'False
  167.                Top             =   1080
  168.                UseMaskColor    =   -1  'True
  169.                Visible         =   0   'False
  170.                Width           =   300
  171.             End
  172.             Begin VB.CommandButton Comm_Help 
  173.                Height          =   300
  174.                Index           =   0
  175.                Left            =   2520
  176.                Picture         =   "设备档案_设备台帐.frx":178E
  177.                Style           =   1  'Graphical
  178.                TabIndex        =   7
  179.                TabStop         =   0   'False
  180.                Top             =   769
  181.                Visible         =   0   'False
  182.                Width           =   300
  183.             End
  184.             Begin VB.TextBox Text_t 
  185.                BackColor       =   &H00FFFFFF&
  186.                BeginProperty DataFormat 
  187.                   Type            =   0
  188.                   Format          =   "tt hh:mm:ss"
  189.                   HaveTrueFalseNull=   0
  190.                   FirstDayOfWeek  =   0
  191.                   FirstWeekOfYear =   0
  192.                   LCID            =   2052
  193.                   SubFormatType   =   0
  194.                EndProperty
  195.                ForeColor       =   &H00000000&
  196.                Height          =   300
  197.                Index           =   0
  198.                Left            =   858
  199.                TabIndex        =   0
  200.                Top             =   769
  201.                Visible         =   0   'False
  202.                Width           =   1474
  203.             End
  204.             Begin VB.Label T_Label 
  205.                AutoSize        =   -1  'True
  206.                BackColor       =   &H00E9F2F3&
  207.                BackStyle       =   0  'Transparent
  208.                Caption         =   "编号"
  209.                Height          =   180
  210.                Index           =   0
  211.                Left            =   390
  212.                TabIndex        =   4
  213.                Top             =   840
  214.                Visible         =   0   'False
  215.                Width           =   360
  216.             End
  217.          End
  218.       End
  219.    End
  220.    Begin MSComctlLib.Toolbar SzToolbar 
  221.       Align           =   1  'Align Top
  222.       Height          =   570
  223.       Left            =   0
  224.       TabIndex        =   5
  225.       Top             =   0
  226.       Width           =   9960
  227.       _ExtentX        =   17568
  228.       _ExtentY        =   1005
  229.       ButtonWidth     =   820
  230.       ButtonHeight    =   953
  231.       Appearance      =   1
  232.       Style           =   1
  233.       ImageList       =   "ImageList1"
  234.       _Version        =   393216
  235.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  236.          NumButtons      =   14
  237.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  238.             Caption         =   "设置"
  239.             Key             =   "ymsz"
  240.             ImageIndex      =   1
  241.          EndProperty
  242.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  243.             Caption         =   "打印"
  244.             Key             =   "dy"
  245.             ImageIndex      =   2
  246.          EndProperty
  247.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  248.             Caption         =   "预览"
  249.             Key             =   "yl"
  250.             ImageIndex      =   3
  251.          EndProperty
  252.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  253.             Style           =   3
  254.          EndProperty
  255.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  256.             Caption         =   "保存"
  257.             Key             =   "Save"
  258.             ImageIndex      =   13
  259.          EndProperty
  260.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  261.             Enabled         =   0   'False
  262.             Object.Visible         =   0   'False
  263.             Style           =   3
  264.          EndProperty
  265.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  266.             Caption         =   "删除"
  267.             Key             =   "Del"
  268.             ImageIndex      =   6
  269.          EndProperty
  270.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  271.             Caption         =   "下个"
  272.             Key             =   "Below"
  273.             ImageIndex      =   14
  274.             Style           =   3
  275.          EndProperty
  276.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  277.             Enabled         =   0   'False
  278.             Caption         =   "刷新"
  279.             Key             =   "sx"
  280.             ImageIndex      =   7
  281.          EndProperty
  282.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  283.             Object.Visible         =   0   'False
  284.             Caption         =   "编辑"
  285.             Key             =   "Text"
  286.             ImageIndex      =   5
  287.          EndProperty
  288.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  289.             Caption         =   "放弃"
  290.             Key             =   "fq"
  291.             ImageIndex      =   15
  292.          EndProperty
  293.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  294.             Style           =   3
  295.          EndProperty
  296.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  297.             Caption         =   "帮助"
  298.             Key             =   "bz"
  299.             ImageIndex      =   8
  300.          EndProperty
  301.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  302.             Caption         =   "退出"
  303.             Key             =   "Exit"
  304.             ImageIndex      =   9
  305.          EndProperty
  306.       EndProperty
  307.       BorderStyle     =   1
  308.       Begin MSComctlLib.ImageList ImageList1 
  309.          Left            =   5760
  310.          Top             =   0
  311.          _ExtentX        =   1005
  312.          _ExtentY        =   1005
  313.          BackColor       =   -2147483643
  314.          ImageWidth      =   16
  315.          ImageHeight     =   16
  316.          MaskColor       =   12632256
  317.          _Version        =   393216
  318.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  319.             NumListImages   =   15
  320.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "设备档案_设备台帐.frx":1B18
  322.                Key             =   "sz"
  323.             EndProperty
  324.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "设备档案_设备台帐.frx":1EB2
  326.                Key             =   "dy"
  327.             EndProperty
  328.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "设备档案_设备台帐.frx":224C
  330.                Key             =   "yl"
  331.             EndProperty
  332.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "设备档案_设备台帐.frx":25E6
  334.                Key             =   "xz"
  335.             EndProperty
  336.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "设备档案_设备台帐.frx":2980
  338.                Key             =   "xg"
  339.             EndProperty
  340.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "设备档案_设备台帐.frx":2D1A
  342.                Key             =   "sc"
  343.             EndProperty
  344.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "设备档案_设备台帐.frx":30B4
  346.                Key             =   "sx"
  347.             EndProperty
  348.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "设备档案_设备台帐.frx":344E
  350.                Key             =   "bz"
  351.             EndProperty
  352.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "设备档案_设备台帐.frx":37E8
  354.                Key             =   "tc"
  355.             EndProperty
  356.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "设备档案_设备台帐.frx":3B82
  358.                Key             =   "bcgs"
  359.             EndProperty
  360.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "设备档案_设备台帐.frx":3F1C
  362.                Key             =   "mrlk"
  363.             EndProperty
  364.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "设备档案_设备台帐.frx":42B6
  366.                Key             =   "xsxm"
  367.             EndProperty
  368.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "设备档案_设备台帐.frx":4650
  370.                Key             =   "bc"
  371.             EndProperty
  372.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "设备档案_设备台帐.frx":49EA
  374.                Key             =   "xyg"
  375.             EndProperty
  376.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "设备档案_设备台帐.frx":4D84
  378.                Key             =   "fq"
  379.             EndProperty
  380.          EndProperty
  381.       End
  382.    End
  383. End
  384. Attribute VB_Name = "Dev_ItemInfoForm"
  385. Attribute VB_GlobalNameSpace = False
  386. Attribute VB_Creatable = False
  387. Attribute VB_PredeclaredId = True
  388. Attribute VB_Exposed = False
  389. Option Explicit
  390. Dim tf As Boolean
  391. Dim VS_int As Integer     ' 上一次滚动的值
  392. Dim RecoRows_int As Integer
  393. Dim Ssql_str As String
  394. Dim add_item As New ADODB.Recordset
  395. Dim VsE_TF As Boolean      '滚动条是否有效
  396. Dim H_MoveInt As Integer   '当前鼠标所处的位置
  397. Dim Com_ListIndexTF As Boolean
  398. '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  399. Dim Text_YNcode(): Dim Com_YNcode(): Dim Text_YNRoot(): Dim Error_TF As Boolean
  400. '<<<<<<<<<<<<<<<<<<<<<<<<<<<
  401. Dim FileName As String
  402. '<<<<<<<<<<<<<<<<<<<<<<<<<<<
  403. Dim Employee_ID As Integer  'ID:
  404. Dim Save_TF As Boolean '检测是否成功
  405. Dim TF_Save As Boolean
  406. Private Sub Comm_Help_Click(Index As Integer)    '基本信息输入调用帮助
  407.     If Mid(Text_t(Help_Str(Comm_Help(Index).Tag, True)).Tag, 1, 1) = 2 Then
  408.        XT_calendar.Show 1
  409.        If Xtfhcs <> "" Then
  410.        Text_t(Help_Str(Comm_Help(Index).Tag, True)).Text = Xtfhcs
  411.        Xtfhcs = ""
  412.        End If
  413.        Text_t(Help_Str(Comm_Help(Index).Tag, True)).SetFocus
  414.        Exit Sub
  415.     End If
  416.     '---------------------
  417.     YesNo_str = Text_t(Help_Str(Comm_Help(Index).Tag, True)).Text
  418.     SsqlHelp = Help_Str(Comm_Help(Index).Tag, False)
  419.     Dev_HelpItem.Show 1
  420.     '---------------------
  421.     If P_Name <> "" Then
  422.        Text_t(Help_Str(Comm_Help(Index).Tag, True)).Text = P_Name
  423.        Text_YNcode(2, Help_Str(Comm_Help(Index).Tag, True)) = P_Code
  424.        P_Name = ""
  425.        P_Code = ""
  426.     End If
  427.     '---------------------
  428.     Text_t(Help_Str(Comm_Help(Index).Tag, True)).SetFocus
  429. End Sub
  430. Private Sub Comm_Help_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  431.     H_MoveInt = Index
  432. End Sub
  433. Private Sub Comm_Info_Click()
  434.     SsqlHelp = "记录信息"
  435.     YesNo_str = Text_t(1).Text
  436.     Dev_HelpItem.Show 1
  437.     '---------------------
  438.     If Trim(P_Code) <> "" Then
  439.        Text_t(1).Text = P_Code
  440.        Dim i As Integer
  441.        For i = 2 To Text_t.Count - 1
  442.           Text_t(i).Text = ""
  443.        Next i
  444.        Text_T_KeyDown 1, 13, 0
  445.     End If
  446. End Sub
  447. Private Sub Command1_Click()
  448.     Dev_ItemDEVSort.Show 1
  449.     If Trim(Dev_ItemDEVSort.Combo1.Tag) <> "" Then
  450.     '------------
  451.         Comm_Info.Visible = False
  452.         Command1.Tag = Dev_ItemDEVSort.Combo1.ItemData(Dev_ItemDEVSort.Combo1.ListIndex)
  453.         Text1.Text = Dev_ItemDEVSort.Combo1.Text
  454.         '------------------
  455.         Employee_ID = 0: Error_TF = True
  456.         Refurbish
  457.         List
  458.     '------------------
  459.     End If
  460. End Sub
  461. Private Sub Command2_Click(Index As Integer)
  462.     Dim i As Integer
  463.     Select Case Index
  464.         Case 0
  465.             If T_Label.Count < 2 Then
  466.                 MsgBox "没有项目! ", vbInformation, "百利/ERP5.0-设备管理"
  467.                 Exit Sub
  468.             End If
  469.             For i = 1 To T_Label.Count - 1
  470.                 If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  471.                     If Text_t(i).Text = "" Then
  472.                         YesNo_str = MsgBox("请先录入设备卡片! ", 32 + vbYes, "百利/ERP5.0-设备管理")
  473.                         If YesNo_str = vbNo Then Exit Sub
  474.                         Exit Sub
  475.                     Else
  476.                         StrTemp = Text_t(i).Text
  477.                         If AddExit_TF = True Then
  478.                             TF_Save = False
  479.                             YesNo_Judge
  480.                             If TF_Save = False Then
  481.                                 Exit Sub
  482.                             End If
  483.                         End If
  484.                             Exit For
  485.                             TF_Save = False
  486.                     End If
  487.                 End If
  488.             Next i
  489.             Dev_LayOutForm.Show 1
  490.         Case 1
  491.             If T_Label.Count < 2 Then
  492.                 MsgBox "没有项目! ", vbInformation, "百利/ERP5.0-设备管理"
  493.                 Exit Sub
  494.             End If
  495.             For i = 1 To T_Label.Count - 1
  496.                 If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  497.                     If Text_t(i).Text = "" Then
  498.                         YesNo_str = MsgBox("请先录入设备卡片! ", 32 + vbYes, "百利/ERP5.0-设备管理")
  499.                         If YesNo_str = vbNo Then Exit Sub
  500.                         Exit Sub
  501.                     Else
  502.                         StrTemp = Text_t(i).Text
  503.                         If AddExit_TF = True Then
  504.                             TF_Save = False
  505.                             YesNo_Judge
  506.                             If TF_Save = False Then
  507.                                 Exit Sub
  508.                             End If
  509.                         End If
  510.                             Exit For
  511.                             TF_Save = False
  512.                     End If
  513.                 End If
  514.             Next i
  515.             Dev_AmplidyneForm.Show 1
  516.         
  517.         Case 2
  518.             If T_Label.Count < 2 Then
  519.                 MsgBox "没有项目! ", vbInformation, "百利/ERP5.0-设备管理"
  520.                 Exit Sub
  521.             End If
  522.             For i = 1 To T_Label.Count - 1
  523.                 If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  524.                     If Text_t(i).Text = "" Then
  525.                         YesNo_str = MsgBox("请先录入设备卡片! ", 32 + vbYes, "百利/ERP5.0-设备管理")
  526.                         If YesNo_str = vbNo Then Exit Sub
  527.                         Exit Sub
  528.                     Else
  529.                         StrTemp = Text_t(i).Text
  530.                         If AddExit_TF = True Then
  531.                             TF_Save = False
  532.                             YesNo_Judge
  533.                             If TF_Save = False Then
  534.                                 Exit Sub
  535.                             End If
  536.                         End If
  537.                             Exit For
  538.                             TF_Save = False
  539.                     End If
  540.                 End If
  541.             Next i
  542.             Dev_SparePartForm.Show 1
  543.         
  544.         
  545.         Case 3
  546.             If T_Label.Count < 2 Then
  547.                 MsgBox "没有项目! ", vbInformation, "百利/ERP5.0-设备管理"
  548.                 Exit Sub
  549.             End If
  550.             For i = 1 To T_Label.Count - 1
  551.                 If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  552.                     If Text_t(i).Text = "" Then
  553.                         YesNo_str = MsgBox("请先录入设备卡片! ", 32 + vbYes, "百利/ERP5.0-设备管理")
  554.                         If YesNo_str = vbNo Then Exit Sub
  555.                         Exit Sub
  556.                     Else
  557.                         StrTemp = Text_t(i).Text
  558.                         If AddExit_TF = True Then
  559.                             TF_Save = False
  560.                             YesNo_Judge
  561.                             If TF_Save = False Then
  562.                                 Exit Sub
  563.                             End If
  564.                         End If
  565.                             Exit For
  566.                             TF_Save = False
  567.                     End If
  568.                 End If
  569.             Next i
  570.             Dev_DamagForm.Show 1
  571.         
  572.         Case 4
  573.             If T_Label.Count < 2 Then
  574.                 MsgBox "没有项目! ", vbInformation, "百利/ERP5.0-设备管理"
  575.                 Exit Sub
  576.             End If
  577.             For i = 1 To T_Label.Count - 1
  578.                 If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  579.                     If Text_t(i).Text = "" Then
  580.                         YesNo_str = MsgBox("请先录入设备卡片! ", 32 + vbYes, "百利/ERP5.0-设备管理")
  581.                         If YesNo_str = vbNo Then Exit Sub
  582.                         Exit Sub
  583.                     Else
  584.                         StrTemp = Text_t(i).Text
  585.                         If AddExit_TF = True Then
  586.                             TF_Save = False
  587.                             YesNo_Judge
  588.                             If TF_Save = False Then
  589.                                 Exit Sub
  590.                             End If
  591.                         End If
  592.                             Exit For
  593.                             TF_Save = False
  594.                     End If
  595.                 End If
  596.             Next i
  597.             Dev_FileForm.Show 1
  598.         
  599.     End Select
  600.     
  601. End Sub
  602. Public Sub Form_Load()
  603.     XtReportCode = "Dev_maincard"
  604.     Employee_ID = 0: Error_TF = True
  605.     Refurbish
  606.     List
  607. End Sub
  608. Public Sub List()          '显示项目
  609.     '--------------
  610.     VsE_TF = False
  611.     Pict.Top = 0: Pict.Left = 0: VS_E.Value = 0
  612.     VsE_TF = True
  613.     '----------------
  614.     '卸载界面控件
  615.     Dim B As Integer
  616.     For B = 1 To Text_t.Count - 1
  617.        Unload Text_t(B): Unload T_Label(B)
  618.     Next B
  619.     For B = 1 To Comm_Help.Count - 1
  620.        Unload Comm_Help(B)
  621.     Next B
  622.     '<<<<<<<<<<<<<<<<<<<<<<<<<<<
  623.     Dim i As Integer:  Dim c As Integer
  624.     i = 1: c = 1
  625.     If Trim(Command1.Tag) = "" Then Exit Sub
  626.     VS_E.Max = 500: VS_int = 0
  627.     Set add_item = Cw_DataEnvi.DataConnect.Execute("select * from DEV_V_Itemlist where ISID=" & Val(Command1.Tag) & "and YNShow='1' order by tab")
  628.         RecoRows_int = add_item.RecordCount
  629.         Do While Not add_item.EOF
  630.         '---------------------------
  631.           If add_item!HelpType = "0" Or Trim(add_item!ItmeCorrelation) = "" Then                    'add_item!ItemFieldType <> "2" And
  632.            '创建文本框
  633.                 Load T_Label(i): Load Text_t(i)
  634.                 T_Label(i).Left = Val(add_item!itemleft & "")
  635.                 T_Label(i).Top = Val(add_item!itemtop & "")
  636.                 T_Label(i).Tag = add_item!ItemFieldName & Val("" & add_item!YNJudge)
  637.                 T_Label(i).Caption = add_item!ItemChineseName
  638.                 ReDim Preserve Text_YNcode(2, i + 1)
  639.                 Text_YNcode(1, i) = add_item!yncode
  640.                 ReDim Preserve Text_YNRoot(i + 1)
  641.                 Text_YNRoot(i) = add_item!YNRoot
  642.                 '------------------------
  643.                 Text_t(i).Left = T_Label(i).Left + T_Label(i).Width + 100
  644.                 Text_t(i).Top = T_Label(i).Top - 50
  645.                 Text_t(i).TabIndex = "" & add_item!Tab - 1
  646.                 Text_t(i).Tag = add_item!ItemFieldType
  647.                 Text_t(i).Width = add_item!ItmeFieldLength * 105
  648.                 Text_t(i).MaxLength = add_item!ItmeFieldLength
  649.                 '----------- 修改时
  650.                 If AddExit_TF = False Then Text_t(i).Enabled = False
  651.                 If AddExit_TF = False And add_item!ItemChineseName = "设备编号" Then
  652.                     Comm_Info.Top = Text_t(i).Top
  653.                     Comm_Info.Left = Text_t(i).Width + Text_t(i).Left
  654.                     Comm_Info.Visible = True
  655.                     Text_t(i).Enabled = True
  656.                 End If
  657.                 '------------
  658.                 If Trim(add_item!ItmeCorrelation) <> "" Or add_item!ItemFieldType = 2 Then
  659.                    '创建帮助按键
  660.                     Load Comm_Help(c)
  661.                     Comm_Help(c).Left = Text_t(i).Left + Text_t(i).Width
  662.                     Comm_Help(c).Top = Text_t(i).Top
  663.                     Comm_Help(c).Tag = i & "." & add_item!ItemCode
  664.                     Comm_Help(c).Visible = True
  665.                     '----------- 修改时
  666.                     If AddExit_TF = False Then Comm_Help(c).Enabled = False
  667.                     '-----------
  668.                     Text_t(i).Tag = Text_t(i).Tag & "." & c
  669.                     c = c + 1
  670.                 End If
  671.                 '--------------
  672.                 Text_t(i).Visible = True
  673.                 T_Label(i).Visible = True
  674.                 i = i + 1
  675.            End If
  676.            '<<<<<<<<<<<<<<<<<<<<<
  677.            '<<<<<<<<<<<<<<<<<<<<<
  678.            If Trim("" & add_item!ItmeCorrelation) <> "" _
  679.               And add_item!HelpType = 1 Then
  680.               '创建下拉列表框
  681.               MsgBox "创建下拉列表框! ", 48
  682.             End If
  683.             '------------
  684.             add_item.MoveNext
  685.         Loop
  686.         add_item.Close
  687. End Sub
  688. Private Sub Pict_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  689.     H_MoveInt = 0
  690. End Sub
  691. Private Sub Text_T_GotFocus(Index As Integer)
  692.     Pi_mvoe Text_t(Index)
  693. End Sub
  694. Public Sub Text_T_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
  695.  '焦点移动
  696.     If KeyCode = 113 And Help_Str(Text_t(Index).Tag, False) <> 0 Then
  697.         H_MoveInt = Help_Str(Text_t(Index).Tag, False)
  698.         Comm_Help_Click (Help_Str(Text_t(Index).Tag, False))
  699.     End If
  700.     H_MoveInt = 0
  701.     '-----------
  702.     If KeyCode = 13 Then
  703.         If AddExit_TF = False And Mid(T_Label(Index).Tag, 1, Len(T_Label(Index).Tag) - 1) = "DEVID" And Comm_Info.Enabled = True Then
  704.             If Fun_IfSearch() Then
  705.                 Edit_Refurbish Text_t(Index).Text, Index, False
  706.                 Exit Sub
  707.             End If
  708.         End If
  709.         SendKeys "{Tab}", True
  710.     End If
  711. End Sub
  712. '*****Added by qiaojin at 2001-5-16**************
  713. Private Function Fun_IfSearch() As Boolean
  714.     Dim i As Integer
  715.     Fun_IfSearch = True
  716.     For i = 2 To Me.Text_t.Count - 1
  717.         If Len(Text_t(i)) <> 0 Then
  718.             Fun_IfSearch = False
  719.             Exit Function
  720.          End If
  721.     Next i
  722.     
  723. End Function
  724. '**********************************************
  725. Private Sub Text_T_KeyPress(Index As Integer, KeyAscii As Integer)
  726.     '判断输入的有效性
  727.     If KeyAscii = 39 Then KeyAscii = 0
  728.     Select Case Mid(Text_t(Index).Tag, 1, 1)
  729.            Case 2
  730.                Call InputFieldLimit(Text_t(Index), 7, KeyAscii)
  731.            Case 1
  732.                Call InputFieldLimit(Text_t(Index), 6, KeyAscii)
  733.     End Select
  734. End Sub
  735. Private Sub Text_T_LostFocus(Index As Integer)       '有效判断
  736. '-------------------
  737. If Help_Str(Text_t(Index).Tag, False) <> H_MoveInt Then
  738.     If Mid(Text_t(Index).Tag, 1, 1) = 2 And Trim(Text_t(Index).Text) <> "" Then
  739.         '-------------------
  740.         If IsDate(Text_t(Index)) = False Then
  741.             MsgBox "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")", 16
  742.             Text_t(Index).SetFocus
  743.             Error_TF = False
  744.             Exit Sub
  745.         Else
  746.             '-----------
  747.             If Text_t(Index).Text > "1950-01-01" And Text_t(Index).Text < "2100-01-01" Then
  748.                 Text_t(Index).Text = Format(Trim(Text_t(Index).Text), "yyyy-mm-dd")
  749.             Else
  750.                 MsgBox "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")", 16
  751.                 Text_t(Index).SetFocus
  752.                 Error_TF = False
  753.                 Exit Sub
  754.             End If
  755.             '-----------
  756.         End If
  757.         '-------------------
  758.     End If
  759.     '----------------------
  760.     If Mid(T_Label(Index).Tag, Len(T_Label(Index).Tag), Len(T_Label(Index).Tag)) = 1 Then
  761.         '------------------- 是否要有效性判断
  762.         If Mid(Text_t(Index).Tag, 1, 1) <> 2 And _
  763.            Help_Str(Text_t(Index).Tag, False) <> "0" _
  764.            And Trim(Text_t(Index).Text) <> "" Then
  765.            '----------------
  766.             If Rows_int(Help_Str(Comm_Help(Help_Str(Text_t(Index).Tag, False)).Tag, False), Trim(Text_t(Index).Text)) > 0 Then
  767.                 Text_t(Index).Text = Trim(P_Name)
  768.                 Text_YNcode(2, Index) = Trim(P_Code)
  769.             Else
  770.                 MsgBox "没有此" & T_Label(Index).Caption, 48, "百利/ERP5.0-设备管理"
  771.                 Error_TF = False
  772.                 Text_t(Index).SetFocus
  773.             End If
  774.             '------------------
  775.         End If
  776.      End If
  777.      '---------------------
  778.  End If
  779.  
  780. End Sub
  781. Private Sub VS_E_Change()     '滚动条
  782.     If VsE_TF = True Then
  783.         If VS_int < VS_E.Value Then
  784.             Pict.Top = Pict.Top - (VS_E.Value * 8 - VS_int)
  785.         Else
  786.             If VS_int <> VS_E.Value Then
  787.               Pict.Top = Pict.Top + (VS_int - VS_E.Value * 8)
  788.             End If
  789.         End If
  790.         VS_int = VS_E.Value * 8
  791.     End If
  792. End Sub
  793. Private Sub Pi_mvoe(ob As Object)   '屏幕滚动
  794.     If ob.Top > 5000 + VS_E.Value * 8 Then     '向下滚动
  795.        VS_E.Value = (ob.Top - 4580)  8
  796.     End If
  797.     '------------------------------
  798.     If 5000 + VS_E.Value - ob.Top > 5000 Then  '向上滚动
  799.        If ob.Top < 5000 Then
  800.           VS_E.Value = 0
  801.          Else
  802.           VS_E.Value = (ob.Top - 4580)  8
  803.        End If
  804.     End If
  805. End Sub
  806. '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  807. '<<<<<<<<<<<<<<<<<<
  808. '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  809. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  810. Select Case Button.Key
  811.        Case "ymsz"
  812. '            If T_Label.Count < 2 Then Exit Sub
  813.             DY_Dyymsz.Show 1
  814.        Case "dy"
  815.             DY_DytsFrm.Show 1
  816.        Case "yl"
  817.             Call Print_DevInfo
  818.        Case "Save"
  819.             Save_TF = True
  820.             YesNo_Judge
  821.        Case "Below"
  822.             YesNo_str = MsgBox("当前数据是否要保存? ", 32 + vbYesNo, "百利/ERP5.0-设备管理")
  823.             If YesNo_str = vbNo Then
  824.                 Save_TF = True
  825.             Else
  826.                 YesNo_Judge
  827.             End If
  828.             '-----------
  829.             If Save_TF = True Then
  830.                 Employee_ID = 0
  831.                 Refurbish
  832.             End If
  833.             Save_TF = False
  834.        Case "sx"
  835.             Refurbish
  836.             Edit_Refurbish "sx", 1, True
  837.        Case "Text"
  838.             AddExit_TF = False
  839.             '---------------------
  840.             Employee_ID = 0: Error_TF = True
  841.             Refurbish
  842.             List
  843.             '--------------------
  844.             SzToolbar.Buttons(10).Enabled = False
  845.             SzToolbar.Buttons(11).Enabled = True
  846.             Me.Caption = "修改"
  847.             Text_t(0).Locked = True
  848.        Case "fq"
  849.             Save_TF = True
  850.             If Save_TF = True Then
  851.                 Employee_ID = 0
  852.                 Refurbish
  853.             End If
  854.             Save_TF = False
  855.        Case "bz"
  856.             Call F1bz
  857.        Case "Del"
  858.             YesNo_str = MsgBox("你是否真的要删除此档案? ", 32 + vbYesNo, "百利/ERP5.0-设备管理")
  859.             If YesNo_str = vbNo Then Exit Sub
  860.             On Error GoTo Err_Del
  861.                 Cw_DataEnvi.DataConnect.BeginTrans
  862.                 '<<<<<<<<<<<<<<<<<<<<< '自定义
  863.                 Cw_DataEnvi.DataConnect.Execute "DELETE DEV_RootInfo WHERE ID=" & Employee_ID
  864.                 Cw_DataEnvi.DataConnect.Execute "DELETE DEV_main WHERE ID=" & Employee_ID
  865.                 '<<<<<<<<<<<<<<<<<<<<<
  866.                 Cw_DataEnvi.DataConnect.CommitTrans
  867.                 Employee_ID = 0
  868.                 Refurbish
  869.                 Exit Sub
  870. Err_Del:
  871.                 Cw_DataEnvi.DataConnect.RollbackTrans
  872.                 MsgBox "删除失败!  ", 16
  873.                 
  874.        Case "Exit"
  875.             Unload Me
  876. End Select
  877. End Sub
  878. Private Sub YesNo_Judge()  '有效性判定
  879.     Dim i As Integer
  880.     '文本框有效性判定
  881.     For i = 1 To Text_t.Count - 1
  882.         If Mid(T_Label(i).Tag, Len(T_Label(i).Tag), Len(T_Label(i).Tag)) = 1 Then
  883.             If Text_t(i).Text = "" Then
  884.                MsgBox T_Label(i).Caption & "不能为空! ", 48, "百利/ERP5.0-设备管理"
  885.                Text_t(i).SetFocus: Exit Sub
  886.             End If
  887.                Text_T_LostFocus i
  888.                If Error_TF = False Then Text_t(i).SetFocus: Error_TF = True: Exit Sub
  889.         End If
  890.     Next i
  891.     Save_EmployeeIndo
  892. End Sub
  893. Private Sub Save_EmployeeIndo() '保存
  894. Dim i As Integer: Dim EmployeeNu As String '职工号
  895. Dim Ssql1 As String: Dim Ssql2 As String: Dim Ssql3 As String: Dim Ssql4 As String
  896. Dim aDo_Eid As New Recordset: Dim MAXID_Z As Integer
  897.     If T_Label.Count < 2 Then MsgBox "没有项目! ", 16: Exit Sub
  898.     For i = 1 To T_Label.Count - 1
  899.         If Text_YNRoot(i) = 1 Then
  900.             With T_Label(i)
  901.                 '------------------
  902.                 If Employee_ID = 0 Then
  903.                     Ssql3 = Ssql3 & Mid(.Tag, 1, Len(.Tag) - 1) & ","
  904.                     If Text_YNcode(1, i) = 1 Then
  905.                         Ssql4 = Ssql4 & "'" & Text_YNcode(2, i) & "',"
  906.                     Else
  907.                         Ssql4 = Ssql4 & "'" & Trim(Text_t(i).Text) & "',"
  908.                     End If
  909.                 Else
  910.                     If Text_YNcode(1, i) = 1 Then
  911.                         Ssql3 = Ssql3 & Mid(.Tag, 1, Len(.Tag) - 1) & "='" & Text_YNcode(2, i) & "',"
  912.                     Else
  913.                         Ssql3 = Ssql3 & Mid(.Tag, 1, Len(.Tag) - 1) & "='" & Trim(Text_t(i).Text) & "',"
  914.                     End If
  915.                 End If
  916.                 '------------------
  917.                 If Mid(.Tag, 1, Len(.Tag) - 1) = "DEVID" Then EmployeeNu = Trim(Text_t(i).Text)
  918.             End With
  919.         End If
  920.     Next i
  921.     '<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  922.     For i = 1 To T_Label.Count - 1
  923.         If Text_YNRoot(i) <> 1 Then
  924.             With T_Label(i)
  925.                 '------------------
  926.                 If Employee_ID = 0 Then
  927.                     Ssql1 = Ssql1 & Mid(.Tag, 1, Len(.Tag) - 1) & ","
  928.                     If Text_YNcode(1, i) = 1 Then
  929.                         Ssql2 = Ssql2 & "'" & Text_YNcode(2, i) & "',"
  930.                     Else
  931.                         Ssql2 = Ssql2 & "'" & Trim(Text_t(i).Text) & "',"
  932.                     End If
  933.                 Else
  934.                     If Text_YNcode(1, i) = 1 Then
  935.                         Ssql1 = Ssql1 & Mid(.Tag, 1, Len(.Tag) - 1) & "='" & Text_YNcode(2, i) & "',"
  936.                     Else
  937.                         Ssql1 = Ssql1 & Mid(.Tag, 1, Len(.Tag) - 1) & "='" & Trim(Text_t(i).Text) & "',"
  938.                     End If
  939.                 End If
  940.                 '------------------
  941.             End With
  942.         End If
  943.     Next i
  944. On Error GoTo Quit_Err
  945.     If Employee_ID = 0 Then
  946.        Set aDo_Eid = Cw_DataEnvi.DataConnect.Execute("select * from DEV_MAIN where DEVID='" & EmployeeNu & "'")
  947.     Else
  948.        Set aDo_Eid = Cw_DataEnvi.DataConnect.Execute("select * from DEV_MAIN where DEVID='" & EmployeeNu & "' and ID<>" & Employee_ID)
  949.     End If
  950.     If aDo_Eid.RecordCount > 0 Then MsgBox "设备编号重复!  ", 48, "百利/ERP5.0-设备管理": aDo_Eid.Close: Exit Sub
  951.     aDo_Eid.Close
  952.     '-----------------------------
  953.     If Employee_ID = 0 Then
  954.         '新增记录
  955.         Set aDo_Eid = Cw_DataEnvi.DataConnect.Execute("select MAXID=MAX(ID) from DEV_MAIN")
  956.         MAXID_Z = Val("" & aDo_Eid!MAXID) + 1
  957.         If Trim(Ssql1) <> "" Then
  958.             Ssql1 = "insert into DEV_RootInfo( ID," & Mid(Ssql1, 1, Len(Ssql1) - 1) & ") values( " & Val("" & aDo_Eid!MAXID) + 1 & "," & Mid(Ssql2, 1, Len(Ssql2) - 1) & ")"
  959.         Else
  960.             Ssql1 = "insert into DEV_RootInfo( ID) values( " & Val("" & aDo_Eid!MAXID) + 1 & ")"
  961.         End If
  962.         Ssql3 = "insert into DEV_main( ID,DEVSort," & Mid(Ssql3, 1, Len(Ssql3) - 1) & ") values( " & Val("" & aDo_Eid!MAXID) + 1 & "," & Val(Command1.Tag) & "," & Mid(Ssql4, 1, Len(Ssql4) - 1) & ")"
  963.         aDo_Eid.Close
  964.         '----------
  965.     Else
  966.         '修改记录
  967.         If Trim(Ssql1) <> "" Then
  968.             Ssql1 = "update DEV_RootInfo SET " & Mid(Ssql1, 1, Len(Ssql1) - 1) & " where ID=" & Employee_ID
  969.         End If
  970.         Ssql3 = "update DEV_main SET " & Mid(Ssql3, 1, Len(Ssql3) - 1) & " where ID=" & Employee_ID
  971.     End If
  972.     
  973.     Cw_DataEnvi.DataConnect.Execute Ssql3
  974.     If Trim(Ssql1) <> "" Then Cw_DataEnvi.DataConnect.Execute Ssql1
  975.     MsgBox "保存成功!   ", 48, "百利/ERP5.0-设备管理"
  976.     Refurbish
  977.     Save_TF = True
  978.     TF_Save = True
  979. Exit Sub
  980. Quit_Err:
  981. TF_Save = False
  982. Save_TF = False
  983. MsgBox "保存失败!   ", 16, "百利/ERP5.0-设备管理"
  984. End Sub
  985. Private Sub Edit_Refurbish(EN As String, Index As Integer, Refu_TF As Boolean)
  986. On Error Resume Next
  987. Dim aDo_Info As New Recordset: Dim aDo_F As New Recordset
  988. Dim i As Integer: Dim Ssql As String
  989. If Refu_TF = False Then
  990.     Employee_ID = 0
  991.     Ssql = Item_Info & " where b.DEVID='" & EN & "' and b.id=a.id"
  992.     aDo_Info.Open Ssql, Cw_DataEnvi.DataConnect, adOpenStatic, adLockOptimistic
  993.     If aDo_Info.RecordCount < 1 Then MsgBox "无效设备位号!  ", 48, "百利/ERP5.0-设备管理": aDo_Info.Close: Text_t(Index).SetFocus: Exit Sub
  994. Else
  995.     Ssql = Item_Info & " where b.id=" & Employee_ID & " and b.id=a.id"
  996.     aDo_Info.Open Ssql, Cw_DataEnvi.DataConnect, adOpenStatic, adLockOptimistic
  997. End If
  998. If Not aDo_Info.EOF Then
  999. '-----------
  1000.     Command1.Tag = aDo_Info!Lcode
  1001.     Text1.Text = aDo_Info!N_Lcode
  1002.     '------------------
  1003.     Employee_ID = 0: Error_TF = True
  1004.     Refurbish
  1005.     List
  1006.     '---------------------
  1007.     For i = 1 To T_Label.Count - 1
  1008.         With T_Label(i)
  1009.             If Text_YNcode(1, i) = 1 Then
  1010.                 Text_t(i).Text = "" & aDo_Info("N_" & Mid(.Tag, 1, Len(.Tag) - 1))
  1011.                 Text_YNcode(2, i) = "" & aDo_Info(Trim(Mid(.Tag, 1, Len(.Tag) - 1)))
  1012.             Else
  1013.                 Text_t(i).Text = "" & aDo_Info(Mid(.Tag, 1, Len(.Tag) - 1))
  1014.             End If
  1015.             Text_t(i).Enabled = True
  1016.             '---------
  1017.             If Mid(.Tag, 1, Len(.Tag) - 1) = "DEVID" Then
  1018.                 Text_t(i).Enabled = False
  1019.                 Comm_Info.Enabled = False
  1020.             End If
  1021.             '---------
  1022.         End With
  1023.     Next
  1024.     Employee_ID = aDo_Info!Id
  1025.     '--------------------------
  1026.     For i = 1 To Comm_Help.Count - 1
  1027.        Comm_Help(i).Enabled = True
  1028.     Next i
  1029. '----------------
  1030. End If
  1031. aDo_Info.Close
  1032. SzToolbar.Buttons(5).Enabled = True: SzToolbar.Buttons(7).Enabled = True
  1033. SzToolbar.Buttons(8).Enabled = True: SzToolbar.Buttons(9).Enabled = True
  1034. End Sub
  1035. Private Sub Refurbish()
  1036. On Error Resume Next
  1037.     Dim i As Integer
  1038.     Me.SetFocus
  1039.     If AddExit_TF = False Then
  1040.         '修改时界面状态
  1041.         Comm_Info.Enabled = True
  1042.         SzToolbar.Buttons(5).Enabled = False: SzToolbar.Buttons(7).Enabled = False
  1043.         SzToolbar.Buttons(8).Enabled = False: SzToolbar.Buttons(9).Enabled = False
  1044.         For i = 1 To Comm_Help.Count - 1
  1045.            Comm_Help(i).Enabled = False
  1046.         Next i
  1047.     End If
  1048.     '-------------------
  1049.     '文本框编辑状态
  1050.     For i = 1 To Text_t.Count - 1
  1051.         Text_t(i).Text = ""
  1052.         If AddExit_TF = False Then
  1053.             Text_t(i).Enabled = False
  1054.         End If
  1055.         '定义
  1056.         If Mid(T_Label(i).Tag, 1, Len(T_Label(i).Tag) - 1) = "DEVID" Then
  1057.             Text_t(i).Enabled = True
  1058.             Text_t(i).SetFocus
  1059.         
  1060.         End If
  1061.     Next i
  1062. End Sub
  1063. Public Function Help_Str(Str As String, tf As Boolean) As String  '截点前、点后
  1064.     Dim i As Integer
  1065.     Str = Trim(Str)
  1066.     For i = 1 To Len(Str)
  1067.         If Mid(Str, i, 1) = "." Then Exit For
  1068.     Next i
  1069.     If tf = True Then
  1070.         Help_Str = Mid(Str, 1, i - 1)
  1071.         Else
  1072.         If i = Len(Str) + 1 Then
  1073.             Help_Str = "0"
  1074.         Else
  1075.             Help_Str = Mid(Str, i + 1, Len(Str))
  1076.         End If
  1077.     End If
  1078. End Function
  1079. Public Function Rows_int(Str As String, StrText As String)   '查找记录的条数
  1080.     Dim aDo_Rec As New Recordset
  1081.     Dim Ssql As String
  1082.     '----------------------------
  1083.     Dim aDo_Item As New Recordset
  1084.     Set aDo_Item = Cw_DataEnvi.DataConnect.Execute("select * from DEV_Item where itemCode=" & Str)
  1085.     If Trim(aDo_Item!TableName) = "CorrelationList" Then
  1086.         Ssql = "select * from DEV_CorrelationSort A,DEV_CorrelationList B where " _
  1087.                & "A.SortCode=b.SortCode and A.SortName='" & Trim(aDo_Item!ItmeCorrelation) & "' and listname='" & Trim(StrText) & "'"
  1088.     Else
  1089.         Ssql = "select * from " & aDo_Item!TableName & " where " & aDo_Item!CloumnName2 & "='" & Trim(StrText) & "'"
  1090.        
  1091.     End If
  1092.     '-----------------------------
  1093.     Set aDo_Rec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  1094.     Rows_int = aDo_Rec.RecordCount
  1095.     '--------------------------------
  1096.     If Rows_int < 1 Then
  1097.         If Trim(aDo_Item!TableName) = "CorrelationList" Then
  1098.             Ssql = "select * from DEV_CorrelationSort A,DEV_CorrelationList B where " _
  1099.                 & "A.SortCode=b.SortCode and A.SortName='" & Trim(aDo_Item!ItmeCorrelation) & "' and listCode='" & Trim(StrText) & "'"
  1100.         Else
  1101.             Ssql = "select * from " & aDo_Item!TableName & " where " & aDo_Item!CloumnName1 & "='" & Trim(StrText) & "'"
  1102.         End If
  1103.         Set aDo_Rec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  1104.         Rows_int = aDo_Rec.RecordCount
  1105.     End If
  1106.     
  1107.     If Rows_int > 0 Then
  1108.         If Trim(aDo_Item!TableName) = "CorrelationList" Then
  1109.             P_Name = aDo_Rec!Listname
  1110.             P_Code = aDo_Rec!ListCode
  1111.         Else
  1112.             P_Name = Trim(aDo_Rec(Trim(aDo_Item!CloumnName2)))
  1113.             P_Code = aDo_Rec(Trim(aDo_Item!CloumnName1))
  1114.         End If
  1115.     End If
  1116.     
  1117.     If aDo_Item.State = 1 Then
  1118.         aDo_Item.Close
  1119.         Set aDo_Item = Nothing
  1120.     End If
  1121.     
  1122.     aDo_Rec.Close
  1123. End Function