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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "vslight6.OCX"
  3. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  4. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  5. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  6. Begin VB.Form Khgl_GauList 
  7.    BorderStyle     =   1  'Fixed Single
  8.    Caption         =   "量化规则明细设置"
  9.    ClientHeight    =   7110
  10.    ClientLeft      =   45
  11.    ClientTop       =   330
  12.    ClientWidth     =   9375
  13.    HelpContextID   =   2312003
  14.    Icon            =   "量化规则明细设置.frx":0000
  15.    KeyPreview      =   -1  'True
  16.    LinkTopic       =   "Form2"
  17.    MaxButton       =   0   'False
  18.    ScaleHeight     =   7110
  19.    ScaleWidth      =   9375
  20.    StartUpPosition =   2  '屏幕中心
  21.    Begin VB.Frame Frame2 
  22.       Height          =   615
  23.       Left            =   60
  24.       TabIndex        =   16
  25.       Top             =   600
  26.       Width           =   4300
  27.       Begin MSComctlLib.ImageCombo Imgcbo_Check 
  28.          Height          =   315
  29.          Left            =   1140
  30.          TabIndex        =   18
  31.          Top             =   180
  32.          Width           =   3000
  33.          _ExtentX        =   5292
  34.          _ExtentY        =   556
  35.          _Version        =   393216
  36.          ForeColor       =   -2147483640
  37.          BackColor       =   -2147483643
  38.       End
  39.       Begin VB.Label Lbl_CheckCode 
  40.          Caption         =   "量化规则:"
  41.          Height          =   195
  42.          Left            =   180
  43.          TabIndex        =   17
  44.          Top             =   240
  45.          Width           =   975
  46.       End
  47.    End
  48.    Begin TabDlg.SSTab StTab 
  49.       Height          =   5805
  50.       Left            =   60
  51.       TabIndex        =   7
  52.       Top             =   1260
  53.       Width           =   9270
  54.       _ExtentX        =   16351
  55.       _ExtentY        =   10239
  56.       _Version        =   393216
  57.       Style           =   1
  58.       Tabs            =   2
  59.       TabHeight       =   520
  60.       TabCaption(0)   =   "列表视图"
  61.       TabPicture(0)   =   "量化规则明细设置.frx":1042
  62.       Tab(0).ControlEnabled=   -1  'True
  63.       Tab(0).Control(0)=   "CzxsGrid"
  64.       Tab(0).Control(0).Enabled=   0   'False
  65.       Tab(0).ControlCount=   1
  66.       TabCaption(1)   =   "单张视图"
  67.       TabPicture(1)   =   "量化规则明细设置.frx":105E
  68.       Tab(1).ControlEnabled=   0   'False
  69.       Tab(1).Control(0)=   "Frame1"
  70.       Tab(1).ControlCount=   1
  71.       Begin VB.Frame Frame1 
  72.          Height          =   5295
  73.          Left            =   -74910
  74.          TabIndex        =   8
  75.          Top             =   390
  76.          Width           =   9075
  77.          Begin VB.TextBox LrText 
  78.             Height          =   900
  79.             Index           =   3
  80.             Left            =   1830
  81.             MultiLine       =   -1  'True
  82.             ScrollBars      =   2  'Vertical
  83.             TabIndex        =   4
  84.             Text            =   "量化规则明细设置.frx":107A
  85.             Top             =   1470
  86.             Width           =   4875
  87.          End
  88.          Begin VB.TextBox LrText 
  89.             Height          =   300
  90.             Index           =   2
  91.             Left            =   1830
  92.             TabIndex        =   3
  93.             Text            =   "2"
  94.             Top             =   1080
  95.             Width           =   4875
  96.          End
  97.          Begin VB.CommandButton BcCommand 
  98.             Caption         =   "保存(&S)"
  99.             Height          =   300
  100.             Left            =   4380
  101.             TabIndex        =   5
  102.             Top             =   2610
  103.             Width           =   1120
  104.          End
  105.          Begin VB.CommandButton QxCommand 
  106.             Cancel          =   -1  'True
  107.             Caption         =   "取消(&C)"
  108.             Height          =   300
  109.             Left            =   5580
  110.             TabIndex        =   6
  111.             Top             =   2610
  112.             Width           =   1120
  113.          End
  114.          Begin VB.CommandButton Ydcommand1 
  115.             Height          =   300
  116.             Index           =   0
  117.             Left            =   6480
  118.             Picture         =   "量化规则明细设置.frx":107C
  119.             Style           =   1  'Graphical
  120.             TabIndex        =   9
  121.             Top             =   240
  122.             Visible         =   0   'False
  123.             Width           =   300
  124.          End
  125.          Begin VB.TextBox LrText 
  126.             Height          =   300
  127.             Index           =   1
  128.             Left            =   1830
  129.             TabIndex        =   2
  130.             Text            =   "1"
  131.             Top             =   690
  132.             Width           =   4875
  133.          End
  134.          Begin VB.TextBox LrText 
  135.             Height          =   300
  136.             Index           =   0
  137.             Left            =   1830
  138.             TabIndex        =   1
  139.             Text            =   "0"
  140.             Top             =   300
  141.             Width           =   1618
  142.          End
  143.          Begin VB.Label TsLabel 
  144.             AutoSize        =   -1  'True
  145.             Caption         =   "规则明细内容:"
  146.             Height          =   180
  147.             Index           =   3
  148.             Left            =   540
  149.             TabIndex        =   15
  150.             Top             =   1530
  151.             Width           =   1170
  152.          End
  153.          Begin VB.Label TsLabel 
  154.             AutoSize        =   -1  'True
  155.             Caption         =   "对应分值:"
  156.             Height          =   180
  157.             Index           =   2
  158.             Left            =   540
  159.             TabIndex        =   12
  160.             Top             =   1140
  161.             Width           =   810
  162.          End
  163.          Begin VB.Label TsLabel 
  164.             AutoSize        =   -1  'True
  165.             Caption         =   "规则明细名称:"
  166.             Height          =   180
  167.             Index           =   1
  168.             Left            =   555
  169.             TabIndex        =   11
  170.             Top             =   750
  171.             Width           =   1170
  172.          End
  173.          Begin VB.Label TsLabel 
  174.             AutoSize        =   -1  'True
  175.             Caption         =   "规则明细编码:"
  176.             Height          =   180
  177.             Index           =   0
  178.             Left            =   555
  179.             TabIndex        =   10
  180.             Top             =   360
  181.             Width           =   1170
  182.          End
  183.       End
  184.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  185.          Height          =   5295
  186.          Left            =   90
  187.          TabIndex        =   0
  188.          Top             =   390
  189.          Width           =   9075
  190.          _ExtentX        =   16007
  191.          _ExtentY        =   9340
  192.          Appearance      =   1
  193.          BorderStyle     =   1
  194.          Enabled         =   -1  'True
  195.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  196.             Name            =   "宋体"
  197.             Size            =   9
  198.             Charset         =   134
  199.             Weight          =   400
  200.             Underline       =   0   'False
  201.             Italic          =   0   'False
  202.             Strikethrough   =   0   'False
  203.          EndProperty
  204.          MousePointer    =   0
  205.          BackColor       =   -2147483643
  206.          ForeColor       =   -2147483640
  207.          BackColorFixed  =   -2147483633
  208.          ForeColorFixed  =   -2147483630
  209.          BackColorSel    =   -2147483635
  210.          ForeColorSel    =   -2147483634
  211.          BackColorBkg    =   8421504
  212.          BackColorAlternate=   -2147483643
  213.          GridColor       =   -2147483633
  214.          GridColorFixed  =   -2147483632
  215.          TreeColor       =   -2147483632
  216.          FloodColor      =   192
  217.          SheetBorder     =   -2147483642
  218.          FocusRect       =   1
  219.          HighLight       =   1
  220.          AllowSelection  =   -1  'True
  221.          AllowBigSelection=   -1  'True
  222.          AllowUserResizing=   0
  223.          SelectionMode   =   0
  224.          GridLines       =   1
  225.          GridLinesFixed  =   2
  226.          GridLineWidth   =   1
  227.          Rows            =   5000
  228.          Cols            =   10
  229.          FixedRows       =   1
  230.          FixedCols       =   0
  231.          RowHeightMin    =   0
  232.          RowHeightMax    =   0
  233.          ColWidthMin     =   0
  234.          ColWidthMax     =   0
  235.          ExtendLastCol   =   0   'False
  236.          FormatString    =   ""
  237.          ScrollTrack     =   0   'False
  238.          ScrollBars      =   3
  239.          ScrollTips      =   0   'False
  240.          MergeCells      =   0
  241.          MergeCompare    =   0
  242.          AutoResize      =   -1  'True
  243.          AutoSizeMode    =   0
  244.          AutoSearch      =   0
  245.          MultiTotals     =   -1  'True
  246.          SubtotalPosition=   1
  247.          OutlineBar      =   0
  248.          OutlineCol      =   0
  249.          Ellipsis        =   0
  250.          ExplorerBar     =   0
  251.          PicturesOver    =   0   'False
  252.          FillStyle       =   0
  253.          RightToLeft     =   0   'False
  254.          PictureType     =   0
  255.          TabBehavior     =   0
  256.          OwnerDraw       =   0
  257.          Editable        =   0   'False
  258.          ShowComboButton =   -1  'True
  259.          WordWrap        =   0   'False
  260.          TextStyle       =   0
  261.          TextStyleFixed  =   0
  262.          OleDragMode     =   0
  263.          OleDropMode     =   0
  264.          DataMode        =   0
  265.          VirtualData     =   -1  'True
  266.       End
  267.    End
  268.    Begin MSComctlLib.ImageList ImageList1 
  269.       Left            =   0
  270.       Top             =   420
  271.       _ExtentX        =   1005
  272.       _ExtentY        =   1005
  273.       BackColor       =   -2147483643
  274.       ImageWidth      =   16
  275.       ImageHeight     =   16
  276.       MaskColor       =   12632256
  277.       _Version        =   393216
  278.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  279.          NumListImages   =   29
  280.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  281.             Picture         =   "量化规则明细设置.frx":1406
  282.             Key             =   "sz"
  283.          EndProperty
  284.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  285.             Picture         =   "量化规则明细设置.frx":17A0
  286.             Key             =   "dy"
  287.          EndProperty
  288.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  289.             Picture         =   "量化规则明细设置.frx":1B3A
  290.             Key             =   "yl"
  291.          EndProperty
  292.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  293.             Picture         =   "量化规则明细设置.frx":1ED4
  294.             Key             =   "xg"
  295.          EndProperty
  296.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  297.             Picture         =   "量化规则明细设置.frx":226E
  298.             Key             =   "zh"
  299.          EndProperty
  300.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  301.             Picture         =   "量化规则明细设置.frx":2608
  302.             Key             =   "sh"
  303.          EndProperty
  304.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.             Picture         =   "量化规则明细设置.frx":29A2
  306.             Key             =   "bc"
  307.          EndProperty
  308.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.             Picture         =   "量化规则明细设置.frx":2D3C
  310.             Key             =   "fq"
  311.          EndProperty
  312.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.             Picture         =   "量化规则明细设置.frx":30D6
  314.             Key             =   "bz"
  315.          EndProperty
  316.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.             Picture         =   "量化规则明细设置.frx":3470
  318.             Key             =   "tc"
  319.          EndProperty
  320.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.             Picture         =   "量化规则明细设置.frx":380A
  322.             Key             =   "bcgs"
  323.          EndProperty
  324.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.             Picture         =   "量化规则明细设置.frx":3BA4
  326.             Key             =   "mrlk"
  327.          EndProperty
  328.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.             Picture         =   "量化规则明细设置.frx":3F3E
  330.             Key             =   "xsxm"
  331.          EndProperty
  332.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.             Picture         =   "量化规则明细设置.frx":42D8
  334.             Key             =   "first"
  335.          EndProperty
  336.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.             Picture         =   "量化规则明细设置.frx":4672
  338.             Key             =   "prev"
  339.          EndProperty
  340.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.             Picture         =   "量化规则明细设置.frx":4A0C
  342.             Key             =   "next"
  343.          EndProperty
  344.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.             Picture         =   "量化规则明细设置.frx":4DA6
  346.             Key             =   "last"
  347.          EndProperty
  348.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.             Picture         =   "量化规则明细设置.frx":5140
  350.             Key             =   "xx"
  351.          EndProperty
  352.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.             Picture         =   "量化规则明细设置.frx":54DA
  354.             Key             =   "define"
  355.          EndProperty
  356.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.             Picture         =   "量化规则明细设置.frx":5874
  358.             Key             =   "exec"
  359.          EndProperty
  360.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.             Picture         =   "量化规则明细设置.frx":5C0E
  362.             Key             =   "xz"
  363.          EndProperty
  364.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.             Picture         =   "量化规则明细设置.frx":5FA8
  366.             Key             =   "sc"
  367.          EndProperty
  368.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.             Picture         =   "量化规则明细设置.frx":6342
  370.             Key             =   "sx"
  371.          EndProperty
  372.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.             Picture         =   "量化规则明细设置.frx":66DC
  374.             Key             =   "cx"
  375.          EndProperty
  376.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.             Picture         =   "量化规则明细设置.frx":6A76
  378.             Key             =   "zd"
  379.          EndProperty
  380.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.             Picture         =   "量化规则明细设置.frx":6E10
  382.             Key             =   "dz"
  383.          EndProperty
  384.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.             Picture         =   "量化规则明细设置.frx":71AA
  386.             Key             =   "ph"
  387.          EndProperty
  388.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.             Picture         =   "量化规则明细设置.frx":7544
  390.             Key             =   "fz"
  391.          EndProperty
  392.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.             Picture         =   "量化规则明细设置.frx":78DE
  394.             Key             =   "dw"
  395.          EndProperty
  396.       EndProperty
  397.    End
  398.    Begin MSComctlLib.Toolbar SzToolbar 
  399.       Align           =   1  'Align Top
  400.       Height          =   570
  401.       Left            =   0
  402.       TabIndex        =   13
  403.       Top             =   0
  404.       Width           =   9375
  405.       _ExtentX        =   16536
  406.       _ExtentY        =   1005
  407.       ButtonWidth     =   820
  408.       ButtonHeight    =   953
  409.       AllowCustomize  =   0   'False
  410.       Appearance      =   1
  411.       Style           =   1
  412.       ImageList       =   "ImageList1"
  413.       _Version        =   393216
  414.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  415.          NumButtons      =   12
  416.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  417.             Caption         =   "设置"
  418.             Key             =   "ymsz"
  419.             ImageKey        =   "sz"
  420.          EndProperty
  421.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  422.             Caption         =   "打印"
  423.             Key             =   "dy"
  424.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  425.             ImageKey        =   "dy"
  426.          EndProperty
  427.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  428.             Caption         =   "预览"
  429.             Key             =   "yl"
  430.             ImageKey        =   "yl"
  431.          EndProperty
  432.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  433.             Style           =   3
  434.          EndProperty
  435.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  436.             Caption         =   "增加"
  437.             Key             =   "zj"
  438.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  439.             ImageKey        =   "xz"
  440.          EndProperty
  441.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  442.             Caption         =   "修改"
  443.             Key             =   "xg"
  444.             ImageKey        =   "xg"
  445.          EndProperty
  446.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  447.             Caption         =   "删除"
  448.             Key             =   "sc"
  449.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  450.             ImageKey        =   "sc"
  451.          EndProperty
  452.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  453.             Style           =   3
  454.          EndProperty
  455.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  456.             Caption         =   "刷新"
  457.             Key             =   "sx"
  458.             ImageKey        =   "sx"
  459.          EndProperty
  460.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  461.             Style           =   3
  462.          EndProperty
  463.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  464.             Caption         =   "帮助"
  465.             Key             =   "bz"
  466.             ImageKey        =   "bz"
  467.          EndProperty
  468.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  469.             Caption         =   "退出"
  470.             Key             =   "fh"
  471.             ImageKey        =   "tc"
  472.          EndProperty
  473.       EndProperty
  474.       BorderStyle     =   1
  475.       Begin MSComctlLib.Toolbar GsToolbar 
  476.          Height          =   540
  477.          Left            =   6870
  478.          TabIndex        =   14
  479.          Top             =   0
  480.          Width           =   2475
  481.          _ExtentX        =   4366
  482.          _ExtentY        =   953
  483.          ButtonWidth     =   1455
  484.          ButtonHeight    =   953
  485.          AllowCustomize  =   0   'False
  486.          Appearance      =   1
  487.          Style           =   1
  488.          ImageList       =   "ImageList1"
  489.          _Version        =   393216
  490.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  491.             NumButtons      =   3
  492.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  493.                Caption         =   "保存格式"
  494.                Key             =   "bcgs"
  495.                ImageKey        =   "bcgs"
  496.             EndProperty
  497.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  498.                Caption         =   "默认列宽"
  499.                Key             =   "hfmrgs"
  500.                ImageKey        =   "mrlk"
  501.             EndProperty
  502.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  503.                Caption         =   "显示项目"
  504.                Key             =   "szxsxm"
  505.                ImageKey        =   "xsxm"
  506.             EndProperty
  507.          EndProperty
  508.       End
  509.    End
  510. End
  511. Attribute VB_Name = "Khgl_GauList"
  512. Attribute VB_GlobalNameSpace = False
  513. Attribute VB_Creatable = False
  514. Attribute VB_PredeclaredId = True
  515. Attribute VB_Exposed = False
  516. '**********************************************************
  517. '*    模 块 名 称 :量化规则明细设置
  518. '*    功 能 描 述 :设置量化规则具体内容
  519. '*    程序员姓名  :张洪军
  520. '*    最后修改人  :张洪军
  521. '*    最后修改时间:2001/12/07
  522. '*    备        注:封版(*所有自定义部分程序均用[>> <<]括起)
  523. '**********************************************************
  524. Dim str_CheckCode As String          '量化规则编码
  525.                
  526. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  527. Dim jdzygs As Integer                    '控件焦点转移个数
  528. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  529. Dim ReportTitle As String                '报表主标题
  530.   
  531. '以下为固定使用变量(网格)
  532. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  533. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  534. Dim GridCode As String                   '显示网格网格代码
  535. Dim GridInf() As Variant                 '整个网格设置信息
  536. Dim Tsxx As String                       '系统提示信息
  537. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  538. Dim Sjhgd As Double                      '网格数据行高度
  539. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  540. Dim GridStr()  As String                 '网格列信息(字符型)
  541. Dim GridInt() As Integer                 '网格列信息(整型)
  542. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  543. '以下为固定使用变量(文本框)
  544. Dim Textvar() As Variant                 '存储变体型文本框信息
  545. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  546. Dim Textint() As Integer                 '存储整型文本框信息
  547. Dim Textstr() As String                  '存储字符型文本框信息
  548. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  549. Dim TextGroupCode As String              '文本框录入分组编码
  550. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  551. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  552. Dim CurTextIndex As Integer              '当前文本框索引值
  553. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  554. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  555. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  556.     jdzygs = 10
  557.     
  558.     Select Case KeyAscii
  559.         Case vbKeyReturn
  560.             If Kjjdzy(jdzygs) Then
  561.                 KeyAscii = 0
  562.             End If
  563.         Case 39           '屏蔽"'"
  564.             KeyAscii = 0
  565.     End Select
  566.    
  567. End Sub
  568. Private Sub Form_Load()
  569.   
  570.     
  571.     '打印报表标题信息
  572.     ReportTitle = "量化规则明细"
  573.      
  574.     '调入打印页面设置窗体
  575.     XtReportCode = "Khgl_GauList"
  576.     Load Dyymctbl
  577.       
  578.     
  579.     '以下为文本框处理程序(读入文本框录入信息)
  580.     TextGroupCode = "Khgl_GauList"
  581.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  582.     Call Wbkcsh
  583.     
  584.     '调入网格设置信息
  585.     GridCode = "Khgl_GauList"
  586.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  587.     Qslz = GridInf(1)
  588.     Sjhgd = GridInf(2)
  589.     Szzls = CzxsGrid.Cols - 1
  590.     
  591.     '填充量化规则列表框
  592.     FillImageCombo Imgcbo_Check, "Khgl_Check0", 1
  593.     str_CheckCode = GetComboKey(Imgcbo_Check, 0)
  594.         
  595.     '填 充 网 格
  596.     Call Cxnrtcwg
  597.        
  598.     '初始化ToolBar,Tab卡状态
  599.     StTab.Tab = 0
  600.     StTab.TabEnabled(1) = False
  601.     Frame1.Enabled = False
  602.     
  603.     '设置为非录入状态
  604.     Lrzt = 0
  605.     
  606.     
  607.  End Sub
  608.  
  609. Private Sub Cxnrtcwg()                               '查询内容填充网格
  610.     Dim Sqlstr As String              '查询连接串
  611.     Dim Jsqte As Long                 '查询临时使用变量
  612.   
  613.     '为加快显示速度,将网格刷新动作冻结
  614.     CzxsGrid.Redraw = False
  615.   
  616.     '[>>查询连接串
  617.     Sqlstr = "SELECT Kh_GauList.* FROM Kh_GauList where  CheckCode='" + str_CheckCode + "'  Order By GauListCode"
  618.     '<<]
  619.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  620.     
  621.     With Cxnrrec
  622.         CzxsGrid.Rows = CzxsGrid.FixedRows
  623.         If .EOF And .BOF Then
  624.             CzxsGrid.Redraw = True
  625.             Exit Sub
  626.         End If
  627.         Jsqte = CzxsGrid.FixedRows
  628.         Do While Not .EOF
  629.             CzxsGrid.AddItem ""
  630.             Call Jltcwg(Cxnrrec, Jsqte)                              '调入填充网格子过程
  631.             CzxsGrid.RowHeight(Jsqte) = Sjhgd                        '设置网格高度
  632.             .MoveNext
  633.             Jsqte = Jsqte + 1
  634.         Loop
  635.     End With
  636.   
  637.     '将网格刷新动作解冻
  638.     CzxsGrid.Redraw = True
  639.     
  640. End Sub
  641. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  642.     '[>>以下为自定义部分
  643.     With Jlbrec
  644.        
  645.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("GauListCode") & "")     '规则明细编码
  646.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("GauListName") & "")     '规则明细名称
  647.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("GauListMark") & "")     '对应分值
  648.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("GauListContent") & "")  '规则明细内容
  649.        
  650.     End With
  651.     '以上为自定义部分<<]
  652.     
  653. End Sub
  654. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  655.     Set Cxnrrec = Nothing
  656.     Set Rec_CodeSet = Nothing
  657.     Unload Dyymctbl
  658.    
  659. End Sub
  660. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  661.     Dim Jsqte As Integer
  662.   
  663.     '对文本框录入内容进行为零和为空判断(固定不变)
  664.     With Rec_CodeSet
  665.         For Jsqte = 0 To Max_Text_Index
  666.             If Textint(Jsqte, 8) = 1 Then     '字段不能为空
  667.                 If Len(Trim(LrText(Jsqte).Text)) = 0 Then
  668.                     Tsxx = Textstr(Jsqte, 7) & "不能为空!"
  669.                     Call Xtxxts(Tsxx, 0, 1)
  670.                     LrText(Jsqte).SetFocus
  671.                     Bclrsj = False
  672.                     Exit Function
  673.                 End If
  674.             Else
  675.                 If Textint(Jsqte, 8) = 2 Then   '字段不能为零
  676.                     If Val(Trim(LrText(Jsqte).Text)) = 0 Then
  677.                         Tsxx = Textstr(Jsqte, 7) & "不能为零!"
  678.                         Call Xtxxts(Tsxx, 0, 1)
  679.                         LrText(Jsqte).SetFocus
  680.                         Bclrsj = False
  681.                         Exit Function
  682.                     End If
  683.                 End If
  684.             End If
  685.         Next Jsqte
  686.     
  687.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  688.         For Jsqte = 0 To Max_Text_Index
  689.             If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
  690.                 If Not TextYxxpd(Jsqte) Then
  691.                     Exit Function
  692.                 End If
  693.             End If
  694.         Next Jsqte
  695.    
  696.    
  697.         If Lrzt = 1 Then  '增 加
  698.         
  699.             '[>>判断编码是否重复
  700.             If .State = 1 Then .Close
  701.             .Open "SELECT * FROM Kh_GauList WHERE GauListCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  702.             
  703.             If Not .EOF Then
  704.                 Tsxx = "规则明细编码重复!"
  705.                 Call Xtxxts(Tsxx, 0, 1)
  706.                 LrText(0).SetFocus
  707.                 Bclrsj = False
  708.                 Exit Function
  709.             End If
  710.            
  711.             '判断名称是否重复
  712.             If .State = 1 Then .Close
  713.             .Open "SELECT * FROM Kh_GauList WHERE GauListName= '" + Trim(LrText(1).Text) + "' and CheckCode='" + str_CheckCode & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  714.             
  715.             If Not .EOF Then
  716.                 Tsxx = "规则明细名称重复!"
  717.                 Call Xtxxts(Tsxx, 0, 1)
  718.                 LrText(1).SetFocus
  719.                 
  720.                 Bclrsj = False
  721.                 Exit Function
  722.             End If
  723.     
  724.     
  725.             '判断记录内容无误后,将记录内容写入数据表
  726.             On Error GoTo Swcwcl
  727.     
  728.             Cw_DataEnvi.DataConnect.BeginTrans
  729.    
  730.             .AddNew
  731.                 .Fields("GauListCode") = Trim(LrText(0).Text)       '规则明细编码
  732.                 .Fields("GauListName") = Trim(LrText(1).Text)       '规则明细名称
  733.                 .Fields("GauListMark") = Trim(LrText(2).Text)       '对应分值
  734.                 .Fields("GauListContent") = Trim(LrText(3).Text)    '规则明细内容
  735.                 .Fields("CheckCode") = str_CheckCode                '量化规则编码
  736.             .Update
  737.             
  738.             Cw_DataEnvi.DataConnect.CommitTrans
  739.    
  740.             '将记录加入网格
  741.             Sqlstr = "SELECT * FROM Kh_GauList WHERE GauListCode= '" + Trim(LrText(0).Text) + "'"
  742.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  743.             
  744.             With CzxsGrid
  745.                 .AddItem ""
  746.                 .RowHeight(.Rows - 1) = Sjhgd
  747.                 .Select .Rows - 1, Qslz
  748.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  749.             End With
  750.    
  751.             Tsxx = "保存完毕!"
  752.             Call Xtxxts(Tsxx, 0, 4)
  753.             
  754.             Call Cshlrxx(1)
  755.             LrText(0).SetFocus
  756.    
  757.             '将网格按编码排序
  758.             With CzxsGrid
  759.                 .Col = Sydz("001", GridStr(), Szzls)
  760.                 CzxsGrid.Sort = flexSortStringAscending
  761.             End With
  762.             '<<]
  763.     
  764.         Else  '否则为修改记录
  765.  
  766.             If .State = 1 Then .Close
  767.             .Open "SELECT * FROM Kh_GauList WHERE GauListName= '" + Trim(LrText(1).Text) + "' and CheckCode='" + str_CheckCode + "' and GauListCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  768.         
  769.             If Not .EOF Then
  770.                 Tsxx = "规则明细名称重复!"
  771.                 Call Xtxxts(Tsxx, 0, 1)
  772.                 LrText(1).SetFocus
  773.                 Bclrsj = False
  774.                 Exit Function
  775.             End If
  776.         
  777.             On Error GoTo Swcwcl
  778.         
  779.             Cw_DataEnvi.DataConnect.BeginTrans
  780.          
  781.             If .State = 1 Then .Close
  782.             .Open "SELECT * FROM Kh_GauList WHERE GauListCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  783.              
  784.             If Not .EOF Then
  785.                 .Fields("GauListName") = Trim(LrText(1).Text)       '规则明细名称
  786.                 .Fields("GauListMark") = Trim(LrText(2).Text)       '对应分值
  787.                 .Fields("GauListContent") = Trim(LrText(3).Text)    '规则明细内容
  788.                 .Fields("CheckCode") = str_CheckCode                '量化规则编码
  789.                 .Update
  790.             End If
  791.             
  792.             Cw_DataEnvi.DataConnect.CommitTrans
  793.             
  794.             '刷新当前网格
  795.             Sqlstr = "SELECT * FROM Kh_GauList WHERE GauListCode= '" + Trim(LrText(0).Text) + "'"
  796.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  797.             
  798.             If Not Cxnrrec.EOF Then
  799.                 With CzxsGrid
  800.                     Call Jltcwg(Cxnrrec, .Row)
  801.                 End With
  802.             Else
  803.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  804.                 Call Xtxxts(Tsxx, 0, 4)
  805.                 Exit Function
  806.             End If
  807.    
  808.         End If
  809.      
  810.         '保存记录成功,函数返回真值
  811.         Bclrsj = True
  812.         Exit Function
  813.     End With
  814.  
  815. Swcwcl:
  816.     Cw_DataEnvi.DataConnect.RollbackTrans
  817.     
  818.     Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  819.     Call Xtxxts(Tsxx, 0, 1)
  820.     
  821.     Exit Function
  822.      
  823. End Function
  824. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  825.     TextChangeLock = True       '关闭文本框Chang事件
  826.     
  827.     If lrztxx = 1 Then
  828.     
  829.         '增加新记录时将文本框清空
  830.         For Jsqte = 0 To Max_Text_Index
  831.             If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  832.                 LrText(Jsqte).Text = ""
  833.                 LrText(Jsqte).Tag = ""
  834.             End If
  835.             TextValiJudgeLock(Jsqte) = True
  836.         Next Jsqte
  837.        
  838.         '[>>
  839.         '在此处可添加新增记录时初始化设置
  840.         '<<]
  841.     Else
  842.     
  843.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  844.         With RecTemp
  845.         
  846.             Sqlstr = "SELECT Kh_GauList.* FROM Kh_GauList Where GauListCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'"
  847.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  848.        
  849.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  850.             If Not RecTemp.EOF Then
  851.                 LrText(0).Text = Trim(.Fields("GauListCode") & "")            '规则明细编码
  852.                 LrText(1).Text = Trim(.Fields("GauListName") & "")            '规则明细名称
  853.                 LrText(2).Text = Trim(.Fields("GauListMark") & "")            '对应分值
  854.                 LrText(3).Text = Trim(.Fields("GauListContent") & "")         '规则明细内容
  855.             Else
  856.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  857.                 Call Xtxxts(Tsxx, 0, 4)
  858.                 Call Cancel
  859.                 TextChangeLock = False
  860.                 Exit Function
  861.             End If
  862.             
  863.         End With
  864.         
  865.     End If
  866.     
  867.     Cshlrxx = True
  868.     TextChangeLock = False
  869.     
  870. End Function
  871. Private Sub Scdqjl()                 '删 除 当 前 记 录
  872.     Dim yhAnswer As Integer
  873.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  874.     If Not Security_Log("Khgl_GauList_edit", Xtczybm, 1) Then
  875.         Exit Sub
  876.     End If
  877.   
  878.     '非数据行不能删除
  879.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  880.         Exit Sub
  881.     End If
  882.   
  883.     '用户确认是否删除记录
  884.     Tsxx = "请确认是否删除当前记录?"
  885.     yhAnswer = Xtxxts(Tsxx, 2, 2)
  886.     
  887.     If yhAnswer = 2 Then
  888.         Exit Sub
  889.     End If
  890.   
  891.     On Error GoTo Cwcl
  892.   
  893.     Cw_DataEnvi.DataConnect.BeginTrans
  894.   
  895.     '[以下需自定义部分
  896.     Cw_DataEnvi.DataConnect.Execute "delete Kh_GauList where GauListCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  897.     '以上为自定义部分]
  898.   
  899.     Cw_DataEnvi.DataConnect.CommitTrans
  900.     
  901.     CzxsGrid.RemoveItem CzxsGrid.Row
  902.   
  903.     Exit Sub
  904.   
  905. Cwcl:
  906.     Cw_DataEnvi.DataConnect.RollbackTrans
  907.     
  908.     If Err.Number = -2147217873 Then              '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  909.         Tsxx = "该规则明细已经被使用,不能删除!"
  910.         Call Xtxxts(Tsxx, 0, 1)
  911.         Exit Sub
  912.     Else
  913.         Tsxx = "出现未知情况,该规则明细不能被删除!"
  914.         Call Xtxxts(Tsxx, 0, 1)
  915.         Exit Sub
  916.     End If
  917.     
  918. End Sub
  919. '*******************以下区域为编写自定义过程区域**********************
  920. Private Sub Imgcbo_Check_Click()
  921.     str_CheckCode = GetComboKey(Imgcbo_Check, 0)
  922.     Call Cxnrtcwg
  923. End Sub
  924. '*******************以上区域为编写自定义过程区域**********************
  925. '*******************************以下为基本处理程序(固定不变)*******************************************'
  926. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  927.     If Shift = 2 Then
  928.         Select Case UCase(Chr(KeyCode))
  929.             Case "P"                                                                          'Ctrl+P 打印
  930.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  931.                     Call bbyl(False)
  932.                 End If
  933.             Case "A"                                                                          'Ctrl+A 增加
  934.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  935.                 If Not Security_Log("Khgl_GauList_edit", Xtczybm, 1) Then
  936.                     Exit Sub
  937.                 End If
  938.             
  939.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  940.                     Call Toolbjzt
  941.                     Lrzt = 1
  942.                     Call Cshlrxx(Lrzt)
  943.                     LrText(0).Enabled = True
  944.                     LrText(0).SetFocus
  945.                 End If
  946.             Case "D"                                                                          'Ctrl+D 删除
  947.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  948.                     Call Scdqjl
  949.                 End If
  950.         End Select
  951.     End If
  952.   
  953. End Sub
  954. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  955.     Select Case Button.Key
  956.         Case "ymsz"                                          '页面设置
  957.             Dyymctbl.Show 1
  958.         Case "yl"                                            '预 览
  959.             Call bbyl(True)
  960.         Case "dy"                                            '打 印
  961.              Call bbyl(False)
  962.         Case "zj"                                            '增 加
  963.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  964.             If Not Security_Log("Khgl_GauList_edit", Xtczybm, 1) Then
  965.                 Exit Sub
  966.             End If
  967.             If Not Len(Trim(str_CheckCode)) > 0 Then
  968.                 Exit Sub
  969.             End If
  970.             Call Toolbjzt
  971.             Lrzt = 1
  972.             Call Cshlrxx(Lrzt)
  973.             LrText(0).Enabled = True
  974.             LrText(0).SetFocus
  975.         Case "xg"                                            '修 改
  976.             Call Xgdqjl
  977.         Case "sc"                                            '删 除
  978.             Call Scdqjl
  979.         Case "sx"                                            '刷 新
  980.             Call Cxnrtcwg
  981.         Case "bz"                                            '帮 助
  982.             Call F1bz
  983.         Case "fh"                                            '退 出
  984.             Unload Me
  985.     End Select
  986.     
  987. End Sub
  988. Private Sub CzxsGrid_DblClick()                                         '修改当前编码记录
  989.     Call Xgdqjl
  990.     
  991. End Sub
  992. Private Sub Xgdqjl()                                                    '修改当前编码记录
  993.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  994.     If Not Security_Log("Khgl_GauList_edit", Xtczybm, 1) Then
  995.         Exit Sub
  996.     End If
  997.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  998.         Exit Sub
  999.     End If
  1000.     
  1001.     Call Toolbjzt
  1002.     Lrzt = 2
  1003.     
  1004.     If Cshlrxx(Lrzt) Then
  1005.         LrText(1).SetFocus
  1006.         LrText(0).Enabled = False
  1007.     End If
  1008.   
  1009. End Sub
  1010. Private Sub Toolbjzt()                                                  'Toolbar状态(编辑状态)
  1011.     StTab.TabEnabled(1) = True
  1012.     StTab.Tab = 1
  1013.     Frame1.Enabled = True
  1014.     StTab.TabEnabled(0) = False
  1015.     CzxsGrid.Enabled = False
  1016.     
  1017.     With SzToolbar
  1018.         .Buttons("ymsz").Enabled = False
  1019.         .Buttons("dy").Enabled = False
  1020.         .Buttons("yl").Enabled = False
  1021.         .Buttons("zj").Enabled = False
  1022.         .Buttons("xg").Enabled = False
  1023.         .Buttons("sc").Enabled = False
  1024.         .Buttons("sx").Enabled = False
  1025.     End With
  1026.     '设置考核规则组合框不可用
  1027.     Imgcbo_Check.Enabled = False
  1028.   
  1029. End Sub
  1030. Private Sub Toolfbjzt()                                                 'Toolbar状态(非编辑状态)
  1031.     StTab.TabEnabled(0) = True
  1032.     StTab.Tab = 0
  1033.     CzxsGrid.Enabled = True
  1034.     Frame1.Enabled = False
  1035.     StTab.TabEnabled(1) = False
  1036.     Lrzt = 0
  1037.     
  1038.     With SzToolbar
  1039.         .Buttons("ymsz").Enabled = True
  1040.         .Buttons("dy").Enabled = True
  1041.         .Buttons("yl").Enabled = True
  1042.         .Buttons("zj").Enabled = True
  1043.         .Buttons("xg").Enabled = True
  1044.         .Buttons("sc").Enabled = True
  1045.         .Buttons("sx").Enabled = True
  1046.     End With
  1047.     '设置考核规则组合框可用
  1048.     Imgcbo_Check.Enabled = True
  1049. End Sub
  1050. Private Sub BcCommand_Click()                                           '保 存
  1051.     If Not Bclrsj Then
  1052.         Exit Sub
  1053.     End If
  1054.     
  1055.     If Lrzt = 2 Then
  1056.         Call Toolfbjzt
  1057.     End If
  1058.   
  1059. End Sub
  1060. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)       '取消
  1061.   
  1062.     '避免执行Click程序
  1063.     Bln_Cancel = True
  1064.     
  1065.     Call Cancel
  1066.   
  1067. End Sub
  1068. Private Sub QxCommand_Click()                                           '取消
  1069.     If Bln_Cancel Then
  1070.         Bln_Cancel = False
  1071.         Exit Sub
  1072.     End If
  1073.     
  1074.     Call Cancel
  1075.     
  1076. End Sub
  1077. Private Sub Cancel()                                                    '取消
  1078.     '文本框加锁
  1079.     For Jsqte = 0 To Max_Text_Index
  1080.         TextValiJudgeLock(Jsqte) = True
  1081.     Next Jsqte
  1082.     
  1083.     Call Toolfbjzt
  1084.   
  1085. End Sub
  1086. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1087.   
  1088.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  1089.   
  1090. End Sub
  1091. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1092.     Select Case Button.Key
  1093.         Case "bcgs"                                       '保存表格格式
  1094.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1095.         Case "hfmrgs"                                     '恢复默认格式
  1096.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1097.         Case "szxsxm"                                     '设置显示项目
  1098.             Call Szxsxm(CzxsGrid, GridCode)
  1099.     End Select
  1100.     
  1101. End Sub
  1102. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1103.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1104.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1105.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  1106.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1107.     ReDim Bbxbt(1 To Bbxbtgs)
  1108.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1109.     
  1110.     If Bbbwhgs <> 0 Then
  1111.         ReDim Bbbwh(1 To Bbbwhgs)
  1112.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1113.     End If
  1114.     
  1115.     Bbzbt = ReportTitle
  1116.     Bbxbt(1) = " "
  1117.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1118.     Bbxbt(2) = "量化规则:" + Imgcbo_Check.Text
  1119.     bbxbtzzxs(2) = 0                                    '居左
  1120.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1121.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1122.     
  1123.     If Not bbylte Then
  1124.         Unload DY_Tybbyldy
  1125.     End If
  1126.     
  1127. End Sub
  1128. '************以下为文本框录入处理程序(固定不变部分)*************'
  1129. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1130.   
  1131.     '以下为依据实际情况自定义部分[
  1132.     
  1133.         '在此填写文本框录入事后处理程序
  1134.      
  1135.     ']以上为依据实际情况自定义部分
  1136.   
  1137. End Sub
  1138. Private Sub LrText_Change(Index As Integer)
  1139.     '屏蔽程序改变控制
  1140.     If TextChangeLock Then
  1141.         Exit Sub
  1142.     End If
  1143.     
  1144.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1145.     
  1146.     '限制字段录入长度
  1147.           
  1148.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1149.      
  1150.     Select Case Textint(Index, 1)
  1151.         Case 8, 11       '金额型
  1152.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1153.         Case 9, 12       '数量型
  1154.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1155.         Case 10          '单价型
  1156.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1157.         Case Else        '其他小数类型控制
  1158.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1159.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1160.             End If
  1161.     End Select
  1162.         
  1163.     TextChangeLock = False '解锁
  1164.    
  1165. End Sub
  1166. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1167.    
  1168.     Call TextShow(Index)
  1169.     CurTextIndex = Index
  1170.     LrText(Index).SelStart = Len(LrText(Index))
  1171.    
  1172. End Sub
  1173. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1174.    
  1175.     Select Case KeyCode
  1176.         Case vbKeyF2
  1177.             Call Text_Help(Index)
  1178.     End Select
  1179.    
  1180. End Sub
  1181. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1182.    
  1183.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1184. End Sub
  1185. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1186.     '显示相应信息但不能进行有效性判断
  1187.   
  1188. End Sub
  1189. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)     '按钮提供帮助
  1190.    
  1191.     Call Text_Help(Index)
  1192.     
  1193. End Sub
  1194. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1195.   
  1196.     If Not Textboolean(Index, 1) Then
  1197.         Exit Sub
  1198.     End If
  1199.      
  1200.     '调用帮助
  1201.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1202.   
  1203.     '根据设置选择显示编码和名称,并进行存储
  1204.     If Len(Xtfhcs) <> 0 Then
  1205.         If Textint(Index, 3) = 1 Then
  1206.             LrText(Index).Text = Xtfhcsfz
  1207.             LrText(Index).Tag = Xtfhcs
  1208.         Else
  1209.             LrText(Index).Text = Xtfhcs
  1210.             LrText(Index).Tag = Xtfhcsfz
  1211.         End If
  1212.     End If
  1213.    
  1214.     LrText(Index).SetFocus
  1215.     
  1216. End Sub
  1217. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1218.     '填写文本框得到焦点,进行相应信息处理程序
  1219.    
  1220. End Sub
  1221. Private Sub Wbkcsh()                          '录入文本框初始化
  1222.     Dim Jsqte As Integer
  1223.   
  1224.     '最大录入文本框索引值
  1225.     Max_Text_Index = Textvar(1)
  1226.   
  1227.     ReDim TextValiJudgeLock(Max_Text_Index)
  1228.   
  1229.     For Jsqte = 0 To Max_Text_Index
  1230.         If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  1231.             If Textboolean(Jsqte, 1) Then
  1232.                 If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
  1233.                     Load Ydcommand1(Jsqte)
  1234.                 End If
  1235.                 Ydcommand1(Jsqte).Visible = True
  1236.                 Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
  1237.             End If
  1238.             
  1239.             TextChangeLock = True
  1240.             LrText(Jsqte).Text = ""
  1241.             LrText(Jsqte).Tag = ""
  1242.             
  1243.             If Textint(Jsqte, 5) <> 0 Then
  1244.                 LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
  1245.             End If
  1246.             
  1247.             TextChangeLock = False
  1248.         End If
  1249.        
  1250.         TextValiJudgeLock(Jsqte) = True
  1251.     Next Jsqte
  1252.     
  1253. End Sub
  1254. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  1255.     Dim Sqlstr As String
  1256.     Dim Findrec As ADODB.Recordset
  1257.   
  1258.     '文本框内容未曾改变不进行有效性判断
  1259.     If TextValiJudgeLock(Index) Then
  1260.         TextYxxpd = True
  1261.         Exit Function
  1262.     End If
  1263.   
  1264.     '文本框内容为空认为有效,并清空其Tag值
  1265.     If Trim(LrText(Index)) = "" Then
  1266.         LrText(Index).Tag = ""
  1267.         Call Wbklrwbcl(Index)
  1268.         TextValiJudgeLock(Index) = True
  1269.         TextYxxpd = True
  1270.         Exit Function
  1271.     End If
  1272.   
  1273.     '可在此加入不做有效性判断的理由
  1274.     Select Case Textint(Index, 4)
  1275.         Case 1      '编码型
  1276.             Sqlstr = Trim(Textstr(Index, 5))
  1277.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1278.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1279.             
  1280.             If Findrec.EOF Then
  1281.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1282.                 LrText(Index).SetFocus
  1283.                 Exit Function
  1284.             Else
  1285.                 Select Case Textint(Index, 3)
  1286.                     Case 0
  1287.                     
  1288.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1289.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1290.                         End If
  1291.                         
  1292.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1293.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1294.                         End If
  1295.                         
  1296.                     Case 1
  1297.                     
  1298.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1299.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1300.                         End If
  1301.                         
  1302.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1303.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1304.                         End If
  1305.                 End Select
  1306.             End If
  1307.             
  1308.         Case 2      '日期型
  1309.             If IsDate(LrText(Index).Text) Then
  1310.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1311.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  1312.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1313.                 End If
  1314.             Else
  1315.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1316.                 Call Xtxxts(Tsxx, 0, 1)
  1317.                 LrText(Index).SetFocus
  1318.                 Exit Function
  1319.             End If
  1320.             
  1321.         Case 3      '其他类型
  1322.         
  1323.     End Select
  1324.     
  1325.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1326.     TextValiJudgeLock(Index) = True
  1327.     '调用文本框事后处理程序
  1328.     Call Wbklrwbcl(Index)
  1329.    
  1330.     '有效性判断通过则返回True
  1331.     TextYxxpd = True
  1332.    
  1333. End Function