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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  5. Begin VB.Form Gy_Customer 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "客户设置"
  8.    ClientHeight    =   7275
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   9270
  12.    HelpContextID   =   1402004
  13.    Icon            =   "公用_客户设置.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   7275
  19.    ScaleWidth      =   9270
  20.    StartUpPosition =   2  '屏幕中心
  21.    Begin VB.Timer Timer1 
  22.       Enabled         =   0   'False
  23.       Interval        =   1
  24.       Left            =   2430
  25.       Top             =   585
  26.    End
  27.    Begin TabDlg.SSTab StTab 
  28.       Height          =   6585
  29.       Left            =   30
  30.       TabIndex        =   35
  31.       Top             =   675
  32.       Width           =   9225
  33.       _ExtentX        =   16272
  34.       _ExtentY        =   11615
  35.       _Version        =   393216
  36.       Style           =   1
  37.       Tabs            =   2
  38.       TabHeight       =   520
  39.       TabCaption(0)   =   "列表视图"
  40.       TabPicture(0)   =   "公用_客户设置.frx":1042
  41.       Tab(0).ControlEnabled=   -1  'True
  42.       Tab(0).Control(0)=   "CzxsGrid"
  43.       Tab(0).Control(0).Enabled=   0   'False
  44.       Tab(0).ControlCount=   1
  45.       TabCaption(1)   =   "单张视图"
  46.       TabPicture(1)   =   "公用_客户设置.frx":105E
  47.       Tab(1).ControlEnabled=   0   'False
  48.       Tab(1).Control(0)=   "Frame1"
  49.       Tab(1).ControlCount=   1
  50.       Begin VB.Frame Frame1 
  51.          Height          =   6160
  52.          Left            =   -74910
  53.          TabIndex        =   38
  54.          Top             =   343
  55.          Width           =   9045
  56.          Begin VB.CommandButton Ydcommand1 
  57.             Height          =   313
  58.             Index           =   2
  59.             Left            =   3795
  60.             Picture         =   "公用_客户设置.frx":107A
  61.             Style           =   1  'Graphical
  62.             TabIndex        =   74
  63.             Top             =   945
  64.             Width           =   301
  65.          End
  66.          Begin VB.CommandButton Ydcommand1 
  67.             Height          =   313
  68.             Index           =   26
  69.             Left            =   3795
  70.             Picture         =   "公用_客户设置.frx":1404
  71.             Style           =   1  'Graphical
  72.             TabIndex        =   73
  73.             Top             =   5370
  74.             Width           =   301
  75.          End
  76.          Begin VB.CommandButton Command4 
  77.             Height          =   300
  78.             Left            =   6150
  79.             Picture         =   "公用_客户设置.frx":178E
  80.             Style           =   1  'Graphical
  81.             TabIndex        =   72
  82.             Top             =   178
  83.             Width           =   300
  84.          End
  85.          Begin VB.CommandButton Command3 
  86.             Height          =   300
  87.             Left            =   5850
  88.             Picture         =   "公用_客户设置.frx":1B18
  89.             Style           =   1  'Graphical
  90.             TabIndex        =   71
  91.             Top             =   178
  92.             Width           =   300
  93.          End
  94.          Begin VB.CommandButton Command2 
  95.             Height          =   300
  96.             Left            =   5550
  97.             Picture         =   "公用_客户设置.frx":1EA2
  98.             Style           =   1  'Graphical
  99.             TabIndex        =   70
  100.             Top             =   178
  101.             Width           =   300
  102.          End
  103.          Begin VB.CommandButton Command1 
  104.             Height          =   300
  105.             Left            =   5250
  106.             Picture         =   "公用_客户设置.frx":222C
  107.             Style           =   1  'Graphical
  108.             TabIndex        =   69
  109.             Top             =   178
  110.             Width           =   300
  111.          End
  112.          Begin VB.TextBox LrText 
  113.             Height          =   313
  114.             Index           =   26
  115.             Left            =   1665
  116.             TabIndex        =   26
  117.             Text            =   "0"
  118.             Top             =   5370
  119.             Width           =   2160
  120.          End
  121.          Begin VB.TextBox LrText 
  122.             Height          =   313
  123.             Index           =   17
  124.             Left            =   5640
  125.             TabIndex        =   17
  126.             Text            =   "1"
  127.             Top             =   3555
  128.             Width           =   2160
  129.          End
  130.          Begin VB.TextBox LrText 
  131.             Height          =   313
  132.             Index           =   18
  133.             Left            =   1665
  134.             TabIndex        =   18
  135.             Text            =   "0"
  136.             Top             =   3900
  137.             Width           =   2160
  138.          End
  139.          Begin VB.TextBox LrText 
  140.             Enabled         =   0   'False
  141.             Height          =   313
  142.             Index           =   19
  143.             Left            =   5640
  144.             TabIndex        =   19
  145.             Text            =   "1"
  146.             Top             =   3900
  147.             Width           =   2160
  148.          End
  149.          Begin VB.TextBox LrText 
  150.             Enabled         =   0   'False
  151.             Height          =   313
  152.             Index           =   20
  153.             Left            =   1665
  154.             TabIndex        =   20
  155.             Text            =   "1"
  156.             Top             =   4275
  157.             Width           =   2160
  158.          End
  159.          Begin VB.TextBox LrText 
  160.             Enabled         =   0   'False
  161.             Height          =   313
  162.             Index           =   21
  163.             Left            =   5640
  164.             TabIndex        =   21
  165.             Text            =   "0"
  166.             Top             =   4275
  167.             Width           =   2160
  168.          End
  169.          Begin VB.TextBox LrText 
  170.             Enabled         =   0   'False
  171.             Height          =   313
  172.             Index           =   23
  173.             Left            =   5640
  174.             TabIndex        =   23
  175.             Text            =   "0"
  176.             Top             =   4635
  177.             Width           =   2160
  178.          End
  179.          Begin VB.TextBox LrText 
  180.             Enabled         =   0   'False
  181.             Height          =   313
  182.             Index           =   24
  183.             Left            =   1665
  184.             TabIndex        =   24
  185.             Text            =   "1"
  186.             Top             =   5010
  187.             Width           =   2160
  188.          End
  189.          Begin VB.TextBox LrText 
  190.             Height          =   313
  191.             Index           =   16
  192.             Left            =   1665
  193.             TabIndex        =   16
  194.             Text            =   "0"
  195.             Top             =   3555
  196.             Width           =   2160
  197.          End
  198.          Begin VB.TextBox LrText 
  199.             Enabled         =   0   'False
  200.             Height          =   313
  201.             Index           =   22
  202.             Left            =   1665
  203.             TabIndex        =   22
  204.             Text            =   "1"
  205.             Top             =   4635
  206.             Width           =   2160
  207.          End
  208.          Begin VB.TextBox LrText 
  209.             Height          =   313
  210.             Index           =   11
  211.             Left            =   5640
  212.             TabIndex        =   11
  213.             Text            =   "0"
  214.             Top             =   2430
  215.             Width           =   2160
  216.          End
  217.          Begin VB.TextBox LrText 
  218.             Height          =   313
  219.             Index           =   12
  220.             Left            =   1665
  221.             TabIndex        =   12
  222.             Text            =   "1"
  223.             Top             =   2790
  224.             Width           =   2160
  225.          End
  226.          Begin VB.TextBox LrText 
  227.             Height          =   313
  228.             Index           =   13
  229.             Left            =   5640
  230.             TabIndex        =   13
  231.             Text            =   "0"
  232.             Top             =   2790
  233.             Width           =   2160
  234.          End
  235.          Begin VB.TextBox LrText 
  236.             Height          =   313
  237.             Index           =   14
  238.             Left            =   1665
  239.             TabIndex        =   14
  240.             Text            =   "1"
  241.             Top             =   3165
  242.             Width           =   2160
  243.          End
  244.          Begin VB.TextBox LrText 
  245.             Height          =   313
  246.             Index           =   15
  247.             Left            =   5640
  248.             TabIndex        =   15
  249.             Text            =   "1"
  250.             Top             =   3165
  251.             Width           =   2160
  252.          End
  253.          Begin VB.TextBox LrText 
  254.             Height          =   313
  255.             Index           =   5
  256.             Left            =   5640
  257.             TabIndex        =   5
  258.             Text            =   "0"
  259.             Top             =   1320
  260.             Width           =   2160
  261.          End
  262.          Begin VB.TextBox LrText 
  263.             Height          =   313
  264.             Index           =   6
  265.             Left            =   1665
  266.             TabIndex        =   6
  267.             Text            =   "1"
  268.             Top             =   1695
  269.             Width           =   2160
  270.          End
  271.          Begin VB.TextBox LrText 
  272.             Height          =   313
  273.             Index           =   7
  274.             Left            =   5640
  275.             TabIndex        =   7
  276.             Text            =   "0"
  277.             Top             =   1695
  278.             Width           =   2160
  279.          End
  280.          Begin VB.TextBox LrText 
  281.             Height          =   313
  282.             Index           =   8
  283.             Left            =   1665
  284.             TabIndex        =   8
  285.             Text            =   "1"
  286.             Top             =   2055
  287.             Width           =   2160
  288.          End
  289.          Begin VB.TextBox LrText 
  290.             Height          =   313
  291.             Index           =   9
  292.             Left            =   5640
  293.             TabIndex        =   9
  294.             Text            =   "1"
  295.             Top             =   2055
  296.             Width           =   2160
  297.          End
  298.          Begin VB.TextBox LrText 
  299.             Height          =   313
  300.             Index           =   10
  301.             Left            =   1665
  302.             TabIndex        =   10
  303.             Text            =   "1"
  304.             Top             =   2430
  305.             Width           =   2160
  306.          End
  307.          Begin VB.TextBox LrText 
  308.             Height          =   313
  309.             Index           =   0
  310.             Left            =   1665
  311.             TabIndex        =   0
  312.             Text            =   "0"
  313.             Top             =   585
  314.             Width           =   2160
  315.          End
  316.          Begin VB.TextBox LrText 
  317.             Height          =   313
  318.             Index           =   1
  319.             Left            =   5640
  320.             TabIndex        =   1
  321.             Text            =   "1"
  322.             Top             =   585
  323.             Width           =   2160
  324.          End
  325.          Begin VB.TextBox LrText 
  326.             Height          =   313
  327.             Index           =   2
  328.             Left            =   1665
  329.             TabIndex        =   2
  330.             Text            =   "0"
  331.             Top             =   945
  332.             Width           =   2160
  333.          End
  334.          Begin VB.TextBox LrText 
  335.             Height          =   313
  336.             Index           =   3
  337.             Left            =   5640
  338.             TabIndex        =   3
  339.             Text            =   "1"
  340.             Top             =   945
  341.             Width           =   2160
  342.          End
  343.          Begin VB.TextBox LrText 
  344.             Height          =   313
  345.             Index           =   4
  346.             Left            =   1665
  347.             TabIndex        =   4
  348.             Text            =   "1"
  349.             Top             =   1320
  350.             Width           =   2160
  351.          End
  352.          Begin VB.CheckBox ChkStopUse 
  353.             Height          =   328
  354.             Left            =   1665
  355.             TabIndex        =   30
  356.             Top             =   5700
  357.             Width           =   1260
  358.          End
  359.          Begin VB.CommandButton Ydcommand1 
  360.             Height          =   313
  361.             Index           =   3
  362.             Left            =   7770
  363.             Picture         =   "公用_客户设置.frx":25B6
  364.             Style           =   1  'Graphical
  365.             TabIndex        =   31
  366.             Top             =   945
  367.             Width           =   301
  368.          End
  369.          Begin VB.CommandButton QxCommand 
  370.             Cancel          =   -1  'True
  371.             Caption         =   "取消(&C)"
  372.             Height          =   300
  373.             Left            =   7800
  374.             TabIndex        =   29
  375.             Top             =   178
  376.             Width           =   1120
  377.          End
  378.          Begin VB.CommandButton BcCommand 
  379.             Caption         =   "保存(&S)"
  380.             Height          =   300
  381.             Left            =   6648
  382.             TabIndex        =   28
  383.             Top             =   178
  384.             Width           =   1120
  385.          End
  386.          Begin VB.CommandButton Ydcommand1 
  387.             Height          =   313
  388.             Index           =   0
  389.             Left            =   3675
  390.             Picture         =   "公用_客户设置.frx":2940
  391.             Style           =   1  'Graphical
  392.             TabIndex        =   39
  393.             Top             =   133
  394.             Visible         =   0   'False
  395.             Width           =   301
  396.          End
  397.          Begin VB.TextBox LrText 
  398.             Height          =   313
  399.             Index           =   25
  400.             Left            =   5640
  401.             TabIndex        =   25
  402.             Text            =   "1"
  403.             Top             =   5010
  404.             Width           =   2160
  405.          End
  406.          Begin VB.TextBox LrText 
  407.             Height          =   313
  408.             Index           =   27
  409.             Left            =   5640
  410.             TabIndex        =   27
  411.             Text            =   "1"
  412.             Top             =   5370
  413.             Width           =   2160
  414.          End
  415.          Begin VB.CommandButton Ydcommand1 
  416.             Height          =   313
  417.             Index           =   27
  418.             Left            =   7770
  419.             Picture         =   "公用_客户设置.frx":2CCA
  420.             Style           =   1  'Graphical
  421.             TabIndex        =   33
  422.             Top             =   5370
  423.             Width           =   301
  424.          End
  425.          Begin VB.CommandButton Ydcommand1 
  426.             Height          =   313
  427.             Index           =   25
  428.             Left            =   7770
  429.             Picture         =   "公用_客户设置.frx":3054
  430.             Style           =   1  'Graphical
  431.             TabIndex        =   32
  432.             Top             =   5010
  433.             Width           =   301
  434.          End
  435.          Begin VB.Label TsLabel 
  436.             Caption         =   "停用:"
  437.             Height          =   180
  438.             Index           =   28
  439.             Left            =   675
  440.             TabIndex        =   68
  441.             Top             =   5790
  442.             Width           =   990
  443.          End
  444.          Begin VB.Label TsLabel 
  445.             Caption         =   "分管部门:"
  446.             Height          =   180
  447.             Index           =   25
  448.             Left            =   4635
  449.             TabIndex        =   67
  450.             Top             =   5085
  451.             Width           =   810
  452.          End
  453.          Begin VB.Label TsLabel 
  454.             Caption         =   "所属业务员:"
  455.             Height          =   180
  456.             Index           =   26
  457.             Left            =   675
  458.             TabIndex        =   66
  459.             Top             =   5460
  460.             Width           =   990
  461.          End
  462.          Begin VB.Label TsLabel 
  463.             Caption         =   "发展日期:"
  464.             Height          =   180
  465.             Index           =   27
  466.             Left            =   4635
  467.             TabIndex        =   65
  468.             Top             =   5460
  469.             Width           =   810
  470.          End
  471.          Begin VB.Label TsLabel 
  472.             Caption         =   "信用等级:"
  473.             Height          =   180
  474.             Index           =   16
  475.             Left            =   675
  476.             TabIndex        =   64
  477.             Top             =   3615
  478.             Width           =   810
  479.          End
  480.          Begin VB.Label TsLabel 
  481.             Caption         =   "信用额度:"
  482.             Height          =   180
  483.             Index           =   17
  484.             Left            =   4635
  485.             TabIndex        =   63
  486.             Top             =   3615
  487.             Width           =   810
  488.          End
  489.          Begin VB.Label TsLabel 
  490.             Caption         =   "帐龄额度:"
  491.             Height          =   180
  492.             Index           =   18
  493.             Left            =   675
  494.             TabIndex        =   62
  495.             Top             =   3990
  496.             Width           =   810
  497.          End
  498.          Begin VB.Label TsLabel 
  499.             Caption         =   "信用天数:"
  500.             Height          =   180
  501.             Index           =   19
  502.             Left            =   4635
  503.             TabIndex        =   61
  504.             Top             =   3990
  505.             Width           =   810
  506.          End
  507.          Begin VB.Label TsLabel 
  508.             Caption         =   "最后交易日:"
  509.             Height          =   180
  510.             Index           =   20
  511.             Left            =   675
  512.             TabIndex        =   60
  513.             Top             =   4350
  514.             Width           =   990
  515.          End
  516.          Begin VB.Label TsLabel 
  517.             Caption         =   "最后交易额:"
  518.             Height          =   180
  519.             Index           =   21
  520.             Left            =   4635
  521.             TabIndex        =   59
  522.             Top             =   4350
  523.             Width           =   990
  524.          End
  525.          Begin VB.Label TsLabel 
  526.             Caption         =   "最后回款日:"
  527.             Height          =   180
  528.             Index           =   22
  529.             Left            =   675
  530.             TabIndex        =   58
  531.             Top             =   4710
  532.             Width           =   990
  533.          End
  534.          Begin VB.Label TsLabel 
  535.             Caption         =   "最后回款额:"
  536.             Height          =   180
  537.             Index           =   23
  538.             Left            =   4635
  539.             TabIndex        =   57
  540.             Top             =   4710
  541.             Width           =   990
  542.          End
  543.          Begin VB.Label TsLabel 
  544.             Caption         =   "应收余额:"
  545.             Height          =   180
  546.             Index           =   24
  547.             Left            =   675
  548.             TabIndex        =   56
  549.             Top             =   5085
  550.             Width           =   810
  551.          End
  552.          Begin VB.Label TsLabel 
  553.             Caption         =   "E-Mail:"
  554.             Height          =   180
  555.             Index           =   11
  556.             Left            =   4635
  557.             TabIndex        =   55
  558.             Top             =   2520
  559.             Width           =   630
  560.          End
  561.          Begin VB.Label TsLabel 
  562.             Caption         =   "客户网址:"
  563.             Height          =   180
  564.             Index           =   12
  565.             Left            =   675
  566.             TabIndex        =   54
  567.             Top             =   2880
  568.             Width           =   810
  569.          End
  570.          Begin VB.Label TsLabel 
  571.             Caption         =   "联系人:"
  572.             Height          =   180
  573.             Index           =   13
  574.             Left            =   4635
  575.             TabIndex        =   53
  576.             Top             =   2880
  577.             Width           =   630
  578.          End
  579.          Begin VB.Label TsLabel 
  580.             Caption         =   "联系方式:"
  581.             Height          =   180
  582.             Index           =   14
  583.             Left            =   675
  584.             TabIndex        =   52
  585.             Top             =   3255
  586.             Width           =   810
  587.          End
  588.          Begin VB.Label TsLabel 
  589.             Caption         =   "收货地址:"
  590.             Height          =   180
  591.             Index           =   15
  592.             Left            =   4635
  593.             TabIndex        =   51
  594.             Top             =   3255
  595.             Width           =   810
  596.          End
  597.          Begin VB.Label TsLabel 
  598.             Caption         =   "邮政编码:"
  599.             Height          =   180
  600.             Index           =   5
  601.             Left            =   4635
  602.             TabIndex        =   50
  603.             Top             =   1425
  604.             Width           =   810
  605.          End
  606.          Begin VB.Label TsLabel 
  607.             Caption         =   "法人名称:"
  608.             Height          =   180
  609.             Index           =   7
  610.             Left            =   4635
  611.             TabIndex        =   49
  612.             Top             =   1785
  613.             Width           =   810
  614.          End
  615.          Begin VB.Label TsLabel 
  616.             Caption         =   "开户银行:"
  617.             Height          =   180
  618.             Index           =   8
  619.             Left            =   675
  620.             TabIndex        =   48
  621.             Top             =   2160
  622.             Width           =   810
  623.          End
  624.          Begin VB.Label TsLabel 
  625.             Caption         =   "银行账号:"
  626.             Height          =   180
  627.             Index           =   9
  628.             Left            =   4635
  629.             TabIndex        =   47
  630.             Top             =   2160
  631.             Width           =   810
  632.          End
  633.          Begin VB.Label TsLabel 
  634.             Caption         =   "上级单位:"
  635.             Height          =   180
  636.             Index           =   10
  637.             Left            =   675
  638.             TabIndex        =   46
  639.             Top             =   2520
  640.             Width           =   810
  641.          End
  642.          Begin VB.Label TsLabel 
  643.             Caption         =   "税    号:"
  644.             Height          =   180
  645.             Index           =   6
  646.             Left            =   675
  647.             TabIndex        =   45
  648.             Top             =   1785
  649.             Width           =   810
  650.          End
  651.          Begin VB.Label TsLabel 
  652.             Caption         =   "客户编码:"
  653.             Height          =   180
  654.             Index           =   0
  655.             Left            =   675
  656.             TabIndex        =   44
  657.             Top             =   690
  658.             Width           =   810
  659.          End
  660.          Begin VB.Label TsLabel 
  661.             Caption         =   "客户名称:"
  662.             Height          =   180
  663.             Index           =   1
  664.             Left            =   4635
  665.             TabIndex        =   43
  666.             Top             =   690
  667.             Width           =   810
  668.          End
  669.          Begin VB.Label TsLabel 
  670.             Caption         =   "所属地区:"
  671.             Height          =   180
  672.             Index           =   2
  673.             Left            =   675
  674.             TabIndex        =   42
  675.             Top             =   1050
  676.             Width           =   810
  677.          End
  678.          Begin VB.Label TsLabel 
  679.             Caption         =   "所属行业:"
  680.             Height          =   180
  681.             Index           =   3
  682.             Left            =   4635
  683.             TabIndex        =   41
  684.             Top             =   1050
  685.             Width           =   810
  686.          End
  687.          Begin VB.Label TsLabel 
  688.             Caption         =   "客户地址:"
  689.             Height          =   180
  690.             Index           =   4
  691.             Left            =   675
  692.             TabIndex        =   40
  693.             Top             =   1425
  694.             Width           =   810
  695.          End
  696.       End
  697.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  698.          Height          =   6105
  699.          Left            =   90
  700.          TabIndex        =   34
  701.          Top             =   405
  702.          Width           =   9030
  703.          _cx             =   5080
  704.          _cy             =   5080
  705.          Appearance      =   1
  706.          BorderStyle     =   1
  707.          Enabled         =   -1  'True
  708.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  709.             Name            =   "宋体"
  710.             Size            =   9
  711.             Charset         =   134
  712.             Weight          =   400
  713.             Underline       =   0   'False
  714.             Italic          =   0   'False
  715.             Strikethrough   =   0   'False
  716.          EndProperty
  717.          MousePointer    =   0
  718.          BackColor       =   -2147483643
  719.          ForeColor       =   -2147483640
  720.          BackColorFixed  =   -2147483633
  721.          ForeColorFixed  =   -2147483630
  722.          BackColorSel    =   -2147483635
  723.          ForeColorSel    =   -2147483634
  724.          BackColorBkg    =   8421504
  725.          BackColorAlternate=   -2147483643
  726.          GridColor       =   -2147483633
  727.          GridColorFixed  =   -2147483632
  728.          TreeColor       =   -2147483632
  729.          FloodColor      =   192
  730.          SheetBorder     =   -2147483642
  731.          FocusRect       =   1
  732.          HighLight       =   1
  733.          AllowSelection  =   -1  'True
  734.          AllowBigSelection=   -1  'True
  735.          AllowUserResizing=   0
  736.          SelectionMode   =   0
  737.          GridLines       =   1
  738.          GridLinesFixed  =   2
  739.          GridLineWidth   =   1
  740.          Rows            =   5000
  741.          Cols            =   10
  742.          FixedRows       =   1
  743.          FixedCols       =   0
  744.          RowHeightMin    =   0
  745.          RowHeightMax    =   0
  746.          ColWidthMin     =   0
  747.          ColWidthMax     =   0
  748.          ExtendLastCol   =   0   'False
  749.          FormatString    =   ""
  750.          ScrollTrack     =   0   'False
  751.          ScrollBars      =   3
  752.          ScrollTips      =   0   'False
  753.          MergeCells      =   0
  754.          MergeCompare    =   0
  755.          AutoResize      =   -1  'True
  756.          AutoSizeMode    =   0
  757.          AutoSearch      =   0
  758.          AutoSearchDelay =   2
  759.          MultiTotals     =   -1  'True
  760.          SubtotalPosition=   1
  761.          OutlineBar      =   0
  762.          OutlineCol      =   0
  763.          Ellipsis        =   0
  764.          ExplorerBar     =   0
  765.          PicturesOver    =   0   'False
  766.          FillStyle       =   0
  767.          RightToLeft     =   0   'False
  768.          PictureType     =   0
  769.          TabBehavior     =   0
  770.          OwnerDraw       =   0
  771.          Editable        =   0
  772.          ShowComboButton =   1
  773.          WordWrap        =   0   'False
  774.          TextStyle       =   0
  775.          TextStyleFixed  =   0
  776.          OleDragMode     =   0
  777.          OleDropMode     =   0
  778.          DataMode        =   0
  779.          VirtualData     =   -1  'True
  780.          DataMember      =   ""
  781.          ComboSearch     =   3
  782.          AutoSizeMouse   =   -1  'True
  783.          FrozenRows      =   0
  784.          FrozenCols      =   0
  785.          AllowUserFreezing=   0
  786.          BackColorFrozen =   0
  787.          ForeColorFrozen =   0
  788.          WallPaperAlignment=   9
  789.          AccessibleName  =   ""
  790.          AccessibleDescription=   ""
  791.          AccessibleValue =   ""
  792.          AccessibleRole  =   24
  793.       End
  794.    End
  795.    Begin MSComctlLib.Toolbar SzToolbar 
  796.       Align           =   1  'Align Top
  797.       Height          =   555
  798.       Left            =   0
  799.       TabIndex        =   36
  800.       Top             =   0
  801.       Width           =   9270
  802.       _ExtentX        =   16351
  803.       _ExtentY        =   979
  804.       ButtonWidth     =   820
  805.       ButtonHeight    =   926
  806.       AllowCustomize  =   0   'False
  807.       Appearance      =   1
  808.       Style           =   1
  809.       ImageList       =   "ImageList1"
  810.       _Version        =   393216
  811.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  812.          NumButtons      =   13
  813.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  814.             Caption         =   "设置"
  815.             Key             =   "ymsz"
  816.             ImageKey        =   "sz"
  817.          EndProperty
  818.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  819.             Caption         =   "打印"
  820.             Key             =   "dy"
  821.             Object.ToolTipText     =   "点击或按Ctrl+P打印表格"
  822.             ImageKey        =   "dy"
  823.          EndProperty
  824.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  825.             Caption         =   "预览"
  826.             Key             =   "yl"
  827.             ImageKey        =   "yl"
  828.          EndProperty
  829.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  830.             Style           =   3
  831.          EndProperty
  832.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  833.             Caption         =   "增加"
  834.             Key             =   "zj"
  835.             Object.ToolTipText     =   "点击或按Ctrl+A增加记录"
  836.             ImageKey        =   "xz"
  837.          EndProperty
  838.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  839.             Caption         =   "修改"
  840.             Key             =   "xg"
  841.             ImageKey        =   "xg"
  842.          EndProperty
  843.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  844.             Caption         =   "删除"
  845.             Key             =   "sc"
  846.             Object.ToolTipText     =   "点击或按Ctrl+D删除当前记录"
  847.             ImageKey        =   "sc"
  848.          EndProperty
  849.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  850.             Style           =   3
  851.          EndProperty
  852.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  853.             Caption         =   "查询"
  854.             Key             =   "cx"
  855.             ImageIndex      =   24
  856.          EndProperty
  857.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  858.             Caption         =   "刷新"
  859.             Key             =   "sx"
  860.             ImageKey        =   "sx"
  861.          EndProperty
  862.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  863.             Style           =   3
  864.          EndProperty
  865.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  866.             Caption         =   "帮助"
  867.             Key             =   "bz"
  868.             ImageKey        =   "bz"
  869.          EndProperty
  870.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  871.             Caption         =   "退出"
  872.             Key             =   "fh"
  873.             ImageKey        =   "tc"
  874.          EndProperty
  875.       EndProperty
  876.       BorderStyle     =   1
  877.       Begin MSComctlLib.Toolbar GsToolbar 
  878.          Height          =   525
  879.          Left            =   6795
  880.          TabIndex        =   37
  881.          Top             =   0
  882.          Width           =   2475
  883.          _ExtentX        =   4366
  884.          _ExtentY        =   926
  885.          ButtonWidth     =   1455
  886.          ButtonHeight    =   926
  887.          AllowCustomize  =   0   'False
  888.          Appearance      =   1
  889.          Style           =   1
  890.          ImageList       =   "ImageList1"
  891.          _Version        =   393216
  892.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  893.             NumButtons      =   3
  894.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  895.                Caption         =   "保存格式"
  896.                Key             =   "bcgs"
  897.                ImageKey        =   "bcgs"
  898.             EndProperty
  899.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  900.                Caption         =   "默认列宽"
  901.                Key             =   "hfmrgs"
  902.                ImageKey        =   "mrlk"
  903.             EndProperty
  904.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  905.                Caption         =   "显示项目"
  906.                Key             =   "szxsxm"
  907.                ImageKey        =   "xsxm"
  908.             EndProperty
  909.          EndProperty
  910.       End
  911.    End
  912.    Begin MSComctlLib.ImageList ImageList1 
  913.       Left            =   0
  914.       Top             =   420
  915.       _ExtentX        =   1005
  916.       _ExtentY        =   1005
  917.       BackColor       =   -2147483643
  918.       ImageWidth      =   16
  919.       ImageHeight     =   16
  920.       MaskColor       =   12632256
  921.       _Version        =   393216
  922.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  923.          NumListImages   =   29
  924.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  925.             Picture         =   "公用_客户设置.frx":33DE
  926.             Key             =   "sz"
  927.          EndProperty
  928.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  929.             Picture         =   "公用_客户设置.frx":3778
  930.             Key             =   "dy"
  931.          EndProperty
  932.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  933.             Picture         =   "公用_客户设置.frx":3B12
  934.             Key             =   "yl"
  935.          EndProperty
  936.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  937.             Picture         =   "公用_客户设置.frx":3EAC
  938.             Key             =   "xg"
  939.          EndProperty
  940.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  941.             Picture         =   "公用_客户设置.frx":4246
  942.             Key             =   "zh"
  943.          EndProperty
  944.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  945.             Picture         =   "公用_客户设置.frx":45E0
  946.             Key             =   "sh"
  947.          EndProperty
  948.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  949.             Picture         =   "公用_客户设置.frx":497A
  950.             Key             =   "bc"
  951.          EndProperty
  952.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  953.             Picture         =   "公用_客户设置.frx":4D14
  954.             Key             =   "fq"
  955.          EndProperty
  956.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  957.             Picture         =   "公用_客户设置.frx":50AE
  958.             Key             =   "bz"
  959.          EndProperty
  960.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  961.             Picture         =   "公用_客户设置.frx":5448
  962.             Key             =   "tc"
  963.          EndProperty
  964.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  965.             Picture         =   "公用_客户设置.frx":57E2
  966.             Key             =   "bcgs"
  967.          EndProperty
  968.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  969.             Picture         =   "公用_客户设置.frx":5B7C
  970.             Key             =   "mrlk"
  971.          EndProperty
  972.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  973.             Picture         =   "公用_客户设置.frx":5F16
  974.             Key             =   "xsxm"
  975.          EndProperty
  976.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  977.             Picture         =   "公用_客户设置.frx":62B0
  978.             Key             =   "first"
  979.          EndProperty
  980.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  981.             Picture         =   "公用_客户设置.frx":664A
  982.             Key             =   "prev"
  983.          EndProperty
  984.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  985.             Picture         =   "公用_客户设置.frx":69E4
  986.             Key             =   "next"
  987.          EndProperty
  988.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  989.             Picture         =   "公用_客户设置.frx":6D7E
  990.             Key             =   "last"
  991.          EndProperty
  992.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  993.             Picture         =   "公用_客户设置.frx":7118
  994.             Key             =   "xx"
  995.          EndProperty
  996.          BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  997.             Picture         =   "公用_客户设置.frx":74B2
  998.             Key             =   "define"
  999.          EndProperty
  1000.          BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1001.             Picture         =   "公用_客户设置.frx":784C
  1002.             Key             =   "exec"
  1003.          EndProperty
  1004.          BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1005.             Picture         =   "公用_客户设置.frx":7BE6
  1006.             Key             =   "xz"
  1007.          EndProperty
  1008.          BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1009.             Picture         =   "公用_客户设置.frx":7F80
  1010.             Key             =   "sc"
  1011.          EndProperty
  1012.          BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1013.             Picture         =   "公用_客户设置.frx":831A
  1014.             Key             =   "sx"
  1015.          EndProperty
  1016.          BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1017.             Picture         =   "公用_客户设置.frx":86B4
  1018.             Key             =   "cx"
  1019.          EndProperty
  1020.          BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1021.             Picture         =   "公用_客户设置.frx":8A4E
  1022.             Key             =   "zd"
  1023.          EndProperty
  1024.          BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1025.             Picture         =   "公用_客户设置.frx":8DE8
  1026.             Key             =   "dz"
  1027.          EndProperty
  1028.          BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1029.             Picture         =   "公用_客户设置.frx":9182
  1030.             Key             =   "ph"
  1031.          EndProperty
  1032.          BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1033.             Picture         =   "公用_客户设置.frx":951C
  1034.             Key             =   "fz"
  1035.          EndProperty
  1036.          BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  1037.             Picture         =   "公用_客户设置.frx":98B6
  1038.             Key             =   "dw"
  1039.          EndProperty
  1040.       EndProperty
  1041.    End
  1042. End
  1043. Attribute VB_Name = "Gy_Customer"
  1044. Attribute VB_GlobalNameSpace = False
  1045. Attribute VB_Creatable = False
  1046. Attribute VB_PredeclaredId = True
  1047. Attribute VB_Exposed = False
  1048. '*******************************************************
  1049. '*    模 块 名 称 :客户档案设置
  1050. '*    功 能 描 述 :设置往来客户档案
  1051. '*    程序员姓名  :徐强
  1052. '*    最后修改人  :徐强
  1053. '*    最后修改时间:2001/11/27
  1054. '*    备        注:
  1055. '*******************************************************
  1056. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  1057. Dim jdzygs As Integer                    '控件焦点转移个数
  1058. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  1059. Dim ReportTitle As String                '报表主标题
  1060. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  1061. '以下为固定使用变量(网格)
  1062. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  1063. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  1064. Dim GridCode As String                   '显示网格网格代码
  1065. Dim GridInf() As Variant                 '整个网格设置信息
  1066. Dim Tsxx As String                       '系统提示信息
  1067. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  1068. Dim Sjhgd As Double                      '网格数据行高度
  1069. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  1070. Dim GridStr()  As String                 '网格列信息(字符型)
  1071. Dim GridInt() As Integer                 '网格列信息(整型)
  1072. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  1073. '以下为固定使用变量(文本框)
  1074. Dim Textvar() As Variant                 '存储变体型文本框信息
  1075. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  1076. Dim Textint() As Integer                 '存储整型文本框信息
  1077. Dim Textstr() As String                  '存储字符型文本框信息
  1078. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  1079. Dim TextGroupCode As String              '文本框录入分组编码
  1080. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  1081. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  1082. Dim CurTextIndex As Integer              '当前文本框索引值
  1083. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  1084. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  1085. Dim str_cusname As String                '客户名称
  1086. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  1087.     jdzygs = 34
  1088.     
  1089.     Select Case KeyAscii
  1090.         Case vbKeyReturn
  1091.             If Kjjdzy(jdzygs) Then
  1092.                 KeyAscii = 0
  1093.             End If
  1094.         Case 39           '屏蔽"'"
  1095.             KeyAscii = 0
  1096.    End Select
  1097.    
  1098. End Sub
  1099. Private Sub Form_Load()
  1100.   
  1101.     '打印报表标题信息
  1102.     ReportTitle = "客 户 设 置"
  1103.      
  1104.     '调入打印页面设置窗体
  1105.     XtReportCode = "Gy_Customer"
  1106.     Load Dyymctbl
  1107.     
  1108.     '以下为文本框处理程序(读入文本框录入信息)
  1109.     TextGroupCode = "Gy_Customer"
  1110.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  1111.     Call Wbkcsh
  1112.     
  1113.     '调入网格设置信息
  1114.     GridCode = "Gy_Customer"
  1115.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  1116.     Qslz = GridInf(1)
  1117.     Sjhgd = GridInf(2)
  1118.     Szzls = CzxsGrid.Cols - 1
  1119.     
  1120.     '填 充 网 格
  1121.        
  1122.     '初始化toolbar,tab卡状态
  1123.     StTab.Tab = 0
  1124.     StTab.TabEnabled(1) = False
  1125.     Frame1.Enabled = False
  1126.      
  1127.     '设置为非录入状态
  1128.     Lrzt = 0
  1129.     
  1130.     '编辑(新增、修改、删除)权限索引
  1131.     Str_RightEdit = "Gy_Customer_Edit"
  1132. End Sub
  1133.  
  1134. Private Sub Cxnrtcwg(Optional Sqlstr As String)                                '查询内容填充网格
  1135.     Dim Jsqte As Long                 '查询临时使用变量
  1136.   
  1137.     '为加快显示速度,将网格刷新动作冻结
  1138.     CzxsGrid.Redraw = False
  1139.   
  1140.     '[>>查询连接串
  1141.     If Sqlstr = "" Then
  1142.         Sqlstr = "SELECT * FROM Gy_V_Customer order by CusCode"
  1143.     End If
  1144.     '<<]
  1145.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1146.     
  1147.     With Cxnrrec
  1148.         CzxsGrid.Rows = CzxsGrid.FixedRows
  1149.         If .EOF And .BOF Then
  1150.             CzxsGrid.Redraw = True
  1151.             Exit Sub
  1152.         End If
  1153.         
  1154.         Jsqte = CzxsGrid.FixedRows
  1155.         
  1156.         Do While Not .EOF
  1157.             CzxsGrid.AddItem ""
  1158.             Call Jltcwg(Cxnrrec, Jsqte)                              '调入填充网格子过程
  1159.             CzxsGrid.RowHeight(Jsqte) = Sjhgd                        '设置网格高度
  1160.             .MoveNext
  1161.             Jsqte = Jsqte + 1
  1162.         Loop
  1163.     End With
  1164.   
  1165.     '将网格刷新动作解冻
  1166.     CzxsGrid.Redraw = True
  1167.     
  1168. End Sub
  1169. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  1170.     '[>>以下为自定义部分
  1171.     With Jlbrec
  1172.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("CusCode") & "")            '客户编码
  1173.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("CusName") & "")            '客户名称
  1174.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("AreaName") & "")           '所属地区
  1175.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("TradeName") & "")          '所属行业
  1176.         CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Address") & "")            '客户地址
  1177.         CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PostCode") & "")           '邮政编码
  1178.         CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("TaxCode") & "")            '税号
  1179.         CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("FictPerson") & "")         '法人名称
  1180.         CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("Bank") & "")               '开户银行
  1181.         CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = Trim(.Fields("BankAccount") & "")        '银行账号
  1182.         CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("CusSuper") & "")           '上级单位
  1183.         CzxsGrid.TextMatrix(Rowjsq, Sydz("012", GridStr(), Szzls)) = Trim(.Fields("Deptname") & "")           '分管部门
  1184.         CzxsGrid.TextMatrix(Rowjsq, Sydz("013", GridStr(), Szzls)) = Trim(.Fields("Personname") & "")         '所属业务员
  1185.         CzxsGrid.TextMatrix(Rowjsq, Sydz("014", GridStr(), Szzls)) = Trim(.Fields("StopFlag") & "")           '停用
  1186.         CzxsGrid.TextMatrix(Rowjsq, Sydz("015", GridStr(), Szzls)) = Trim(.Fields("CreditGrade") & "")        '信用等级
  1187.         CzxsGrid.TextMatrix(Rowjsq, Sydz("016", GridStr(), Szzls)) = Trim(.Fields("CreditMoney") & "")        '信用额度
  1188.         CzxsGrid.TextMatrix(Rowjsq, Sydz("017", GridStr(), Szzls)) = Trim(.Fields("CreditageMoney") & "")     '帐龄额度
  1189.         CzxsGrid.TextMatrix(Rowjsq, Sydz("018", GridStr(), Szzls)) = Trim(.Fields("CreditDate") & "")         '信用天数
  1190.     End With
  1191.     '以上为自定义部分<<]
  1192.     
  1193. End Sub
  1194. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  1195.     Set Cxnrrec = Nothing
  1196.     Set Rec_CodeSet = Nothing
  1197.     Unload Dyymctbl
  1198.     Gy_CustomerQuery.UnloadCheck = 1
  1199.     Unload Gy_CustomerQuery
  1200. End Sub
  1201. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  1202.     Dim Jsqte As Integer
  1203.     Dim I As Long
  1204.     Dim str_tmp As String
  1205.     Dim likenum As Long
  1206.     Dim rs As New ADODB.Recordset
  1207.     Dim intyesno As Integer
  1208.     
  1209.     '对文本框录入内容进行为零和为空判断(固定不变)
  1210.     With Rec_CodeSet
  1211.     
  1212.         For Jsqte = 0 To Max_Text_Index
  1213.             If Textint(Jsqte, 8) = 1 Then     '字段不能为空
  1214.                 If Len(Trim(LrText(Jsqte).Text)) = 0 Then
  1215.                     Tsxx = Textstr(Jsqte, 7) & "不能为空!"
  1216.                     Call Xtxxts(Tsxx, 0, 1)
  1217.                     LrText(Jsqte).SetFocus
  1218.                     Bclrsj = False
  1219.                     Exit Function
  1220.                 End If
  1221.             Else
  1222.                 If Textint(Jsqte, 8) = 2 Then   '字段不能为零
  1223.                     If Val(Trim(LrText(Jsqte).Text)) = 0 Then
  1224.                         Tsxx = Textstr(Jsqte, 7) & "不能为零!"
  1225.                         Call Xtxxts(Tsxx, 0, 1)
  1226.                         LrText(Jsqte).SetFocus
  1227.                         Bclrsj = False
  1228.                         Exit Function
  1229.                     End If
  1230.                 End If
  1231.             End If
  1232.         Next Jsqte
  1233.     
  1234.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  1235.         For Jsqte = 0 To Max_Text_Index
  1236.             If Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
  1237.                 If Not TextYxxpd(Jsqte) Then
  1238.                     Exit Function
  1239.                 End If
  1240.             End If
  1241.         Next Jsqte
  1242.         If Lrzt = 1 Then  '增 加
  1243.         
  1244.             '[>>判断编码是否重复
  1245.             If .State = 1 Then .Close
  1246.             .Open "SELECT * FROM Gy_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1247.     
  1248.             If Not .EOF Then
  1249.                 Tsxx = "客户编码重复!"
  1250.                 Call Xtxxts(Tsxx, 0, 1)
  1251.                 LrText(0).SetFocus
  1252.                 Bclrsj = False
  1253.                 Exit Function
  1254.             End If
  1255.         '******************************************
  1256.         '计算客户名称相似率(相同字的个数/长度)
  1257.         likenum = 0
  1258.         j = 0
  1259.         'rs用于取出相似率
  1260.         rs.Open "select itemvalue from gy_accinformation where itemcode='gy_customer'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1261.         If .State = 1 Then .Close
  1262.         .Open "SELECT cusname FROM Gy_Customer ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1263.         str_tmp = Trim(LrText(1))
  1264.         Do While Not .EOF
  1265.             For I = 1 To Len(str_tmp)
  1266.                 If InStr(1, Trim(.Fields("cusname")), Mid(str_tmp, I, 1)) Then
  1267.                     likenum = likenum + 1
  1268.                 End If
  1269.             Next
  1270.             
  1271.             If likenum * 100# / Len(str_tmp) > Val(rs("itemvalue")) Then
  1272.                 Cusname = Cusname & "        " & Trim(.Fields("cusname")) & "     " & Chr(13)
  1273.             End If
  1274.             likenum = 0
  1275.             .MoveNext
  1276.         Loop
  1277.         If Len(Cusname) > 0 Then
  1278.             Tsxx = "存在相似的客户名称:" & Chr(13) & suppliername & "要继续吗?"
  1279.             If Xtxxts(Tsxx, 1, 2) = vbNo Then
  1280.                 LrText(1).SetFocus
  1281.                 Bclrsj = False
  1282.                 Exit Function
  1283.             End If
  1284.         End If
  1285.     
  1286.         Set rs = Nothing
  1287.         '****************************************************
  1288.             If .State = 1 Then .Close
  1289.             .Open "SELECT * FROM Gy_Customer WHERE 1=2", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1290.             '判断记录内容无误后,将记录内容写入数据表
  1291.             On Error GoTo Swcwcl
  1292.     
  1293.             Cw_DataEnvi.DataConnect.BeginTrans
  1294.    
  1295.             .AddNew
  1296.             .Fields("CusCode") = Trim(LrText(0).Text)          '客户编码
  1297.             .Fields("CusName") = Trim(LrText(1).Text)          '客户名称
  1298.             If Trim(LrText(2).Tag) <> "" Then                  '地区编码
  1299.                 .Fields("Areacode") = Trim(LrText(2).Tag)
  1300.             Else
  1301.                 .Fields("Areacode") = Null
  1302.             End If
  1303.             If Trim(LrText(3).Tag) <> "" Then                  '行业编码
  1304.                 .Fields("Tradecode") = Trim(LrText(3).Tag)
  1305.             Else
  1306.                 .Fields("Tradecode") = Null
  1307.             End If
  1308.             .Fields("Address") = Trim(LrText(4).Text)          '地址
  1309.             .Fields("postcode") = Trim(LrText(5))              '邮编
  1310.             .Fields("taxcode") = Trim(LrText(6))               '税号
  1311.             .Fields("fictperson") = Trim(LrText(7))            '法人
  1312.             .Fields("bank") = Trim(LrText(8).Text)             '开户银行
  1313.             .Fields("bankaccount") = Trim(LrText(9).Text)      '银行账号
  1314.             .Fields("Cussuper") = Trim(LrText(10).Text)        '上级主管公司
  1315.             .Fields("email") = Trim(LrText(11).Text)           'email
  1316.             .Fields("worknet") = Trim(LrText(12).Text)         '网址
  1317.             .Fields("contactperson") = Trim(LrText(13).Text)   '联系人
  1318.             .Fields("contacttype") = Trim(LrText(14).Text)     '联系方式
  1319.             .Fields("desaddress") = Trim(LrText(15).Text)      '收获地址
  1320.             
  1321.             .Fields("creditgrade") = Trim(LrText(16).Text)     '信用等级
  1322.             .Fields("creditmoney") = Val(LrText(17).Text)      '信用额度
  1323.             .Fields("creditagemoney") = Val(LrText(18).Text)   '帐龄额度
  1324.             If IsDate(LrText(19).Text) Then
  1325.                 .Fields("creditdate") = Trim(LrText(19).Text)  '信用天数
  1326.             End If
  1327.             
  1328.             If Trim(LrText(25).Tag) <> "" Then                 '公司分管部门
  1329.                  .Fields("deptcode") = Trim(LrText(25).Tag)
  1330.              Else
  1331.                  .Fields("deptcode") = Null
  1332.              End If
  1333.              If Trim(LrText(26).Tag) <> "" Then                '所属销售员
  1334.                  .Fields("PersonCode") = Trim(LrText(26).Tag)
  1335.              Else
  1336.                  .Fields("PersonCode") = Null
  1337.              End If
  1338.              If IsDate(LrText(27)) Then                        '发展日期
  1339.                  .Fields("relationdate") = LrText(27)
  1340.              Else
  1341.                  .Fields("relationdate") = Null
  1342.              End If
  1343.             
  1344.              
  1345.              If ChkStopUse.Value Then           '停用标志
  1346.                  .Fields("stopflag") = 1
  1347.              Else
  1348.                  .Fields("stopflag") = 0
  1349.              End If
  1350.            
  1351.             .Update
  1352.             Cw_DataEnvi.DataConnect.CommitTrans
  1353.             '将记录加入网格
  1354.             Sqlstr = "SELECT * FROM Gy_V_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'"
  1355.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1356.    
  1357.             With CzxsGrid
  1358.                 .AddItem ""
  1359.                 .RowHeight(.Rows - 1) = Sjhgd
  1360.                 .Select .Rows - 1, Qslz
  1361.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  1362.             End With
  1363.             Tsxx = "保存完毕!"
  1364.             Call Xtxxts(Tsxx, 0, 4)
  1365.             
  1366.             Call Cshlrxx(1)
  1367.             LrText(0).SetFocus
  1368.             '将网格按编码排序
  1369.             With CzxsGrid
  1370.                 .Col = Sydz("001", GridStr(), Szzls)
  1371.                 CzxsGrid.Sort = flexSortStringAscending
  1372.             End With
  1373.             '<<]
  1374.     
  1375.         Else  '否则为修改记录
  1376.  
  1377.             '******************************************
  1378.             '计算客户名称相似率(相同字的个数/长度)
  1379.             If Trim(LrText(1)) <> str_cusname Then '如果客户名称改变
  1380.                 str_cusname = ""
  1381.                 likenum = 0
  1382.                 j = 0
  1383.                 'rs用于取出相似率
  1384.                 rs.Open "select itemvalue from gy_accinformation where itemcode='gy_customer'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1385.                 If .State = 1 Then .Close
  1386.                 .Open "SELECT cusname FROM Gy_Customer where cuscode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1387.                 str_tmp = Trim(LrText(1))
  1388.                 Do While Not .EOF
  1389.                     For I = 1 To Len(str_tmp)
  1390.                         If InStr(1, Trim(.Fields("cusname")), Mid(str_tmp, I, 1)) Then
  1391.                             likenum = likenum + 1
  1392.                         End If
  1393.                     Next
  1394.                     
  1395.                     If likenum * 100# / Len(str_tmp) > Val(rs("itemvalue")) Then
  1396.                         Cusname = Cusname & "        " & Trim(.Fields("cusname")) & "     " & Chr(13)
  1397.                     End If
  1398.                     likenum = 0
  1399.                     .MoveNext
  1400.                 Loop
  1401.                 If Len(Cusname) > 0 Then
  1402.                     Tsxx = "存在相似的客户名称:" & Chr(13) & suppliername & "要继续吗?"
  1403.                     If Xtxxts(Tsxx, 1, 2) = vbNo Then
  1404.                         LrText(1).SetFocus
  1405.                         Bclrsj = False
  1406.                         Exit Function
  1407.                     End If
  1408.                 End If
  1409.         
  1410.                 Set rs = Nothing
  1411.             End If
  1412.             '****************************************************
  1413.             On Error GoTo Swcwcl
  1414.             Cw_DataEnvi.DataConnect.BeginTrans
  1415.             If .State = 1 Then .Close
  1416.             .Open "SELECT * FROM Gy_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  1417.      
  1418.             If Not .EOF Then
  1419.                 .Fields("CusName") = Trim(LrText(1).Text)          '客户名称
  1420.                 If Trim(LrText(2).Tag) <> "" Then                  '地区编码
  1421.                     .Fields("Areacode") = Trim(LrText(2).Tag)
  1422.                 Else
  1423.                     .Fields("Areacode") = Null
  1424.                 End If
  1425.                 If Trim(LrText(3).Tag) <> "" Then                  '行业编码
  1426.                     .Fields("Tradecode") = Trim(LrText(3).Tag)
  1427.                 Else
  1428.                     .Fields("Tradecode") = Null
  1429.                 End If
  1430.                 .Fields("Address") = Trim(LrText(4).Text)          '地址
  1431.                 .Fields("postcode") = Trim(LrText(5))              '邮编
  1432.                 .Fields("taxcode") = Trim(LrText(6))               '税号
  1433.                 .Fields("fictperson") = Trim(LrText(7))            '法人
  1434.                 .Fields("bank") = Trim(LrText(8).Text)             '开户银行
  1435.                 .Fields("bankaccount") = Trim(LrText(9).Text)      '银行账号
  1436.                 .Fields("Cussuper") = Trim(LrText(10).Text)        '上级主管公司
  1437.                 .Fields("email") = Trim(LrText(11).Text)           'email
  1438.                 .Fields("worknet") = Trim(LrText(12).Text)         '网址
  1439.                 .Fields("contactperson") = Trim(LrText(13).Text)   '联系人
  1440.                 .Fields("contacttype") = Trim(LrText(14).Text)     '联系方式
  1441.                 .Fields("desaddress") = Trim(LrText(15).Text)      '收获地址
  1442.                 
  1443.                 .Fields("creditgrade") = Trim(LrText(16).Text)     '信用等级
  1444.                 .Fields("creditmoney") = Val(LrText(17).Text)      '信用额度
  1445.                 .Fields("creditagemoney") = Val(LrText(18).Text)   '帐龄额度
  1446.                 If IsDate(LrText(19).Text) Then
  1447.                     .Fields("creditdate") = Trim(LrText(19).Text)  '信用天数
  1448.                 End If
  1449.                 
  1450.                 
  1451.                 If Trim(LrText(25).Tag) <> "" Then                 '公司分管部门
  1452.                      .Fields("deptcode") = Trim(LrText(25).Tag)
  1453.                  Else
  1454.                      .Fields("deptcode") = Null
  1455.                  End If
  1456.                  If Trim(LrText(26).Tag) <> "" Then                '所属销售员
  1457.                      .Fields("PersonCode") = Trim(LrText(26).Tag)
  1458.                  Else
  1459.                      .Fields("PersonCode") = Null
  1460.                  End If
  1461.                  If IsDate(LrText(27)) Then                        '发展日期
  1462.                      .Fields("relationdate") = LrText(27)
  1463.                  Else
  1464.                      .Fields("relationdate") = Null
  1465.                  End If
  1466.                 
  1467.                  
  1468.                  If ChkStopUse.Value Then           '停用标志
  1469.                      .Fields("stopflag") = 1
  1470.                  Else
  1471.                      .Fields("stopflag") = 0
  1472.                  End If
  1473.                     .Update
  1474.                 End If
  1475.              Cw_DataEnvi.DataConnect.CommitTrans
  1476.    
  1477.             '刷新当前网格
  1478.             Sqlstr = "SELECT * FROM Gy_V_Customer WHERE CusCode= '" + Trim(LrText(0).Text) + "'"
  1479.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1480.    
  1481.             With CzxsGrid
  1482.                 Call Jltcwg(Cxnrrec, .Row)
  1483.             End With
  1484.    
  1485.         End If
  1486.      
  1487.         '保存记录成功,函数返回真值
  1488.         Bclrsj = True
  1489.         Exit Function
  1490.         
  1491.     End With
  1492.  
  1493. Swcwcl:
  1494.      Cw_DataEnvi.DataConnect.RollbackTrans
  1495.      
  1496.      Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  1497.      Call Xtxxts(Tsxx, 0, 1)
  1498.      
  1499.      Exit Function
  1500.      
  1501. End Function
  1502. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  1503.     Dim RecTemp As New ADODB.Recordset
  1504.     TextChangeLock = True       '关闭文本框Chang事件
  1505.     Call mmkn
  1506.     str_cusname = ""
  1507.     If lrztxx = 1 Then
  1508.         '增加新记录时将文本框清空
  1509.         For Jsqte = 0 To Max_Text_Index
  1510.             If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  1511.                 LrText(Jsqte).Text = ""
  1512.                 LrText(Jsqte).Tag = ""
  1513.             End If
  1514.             TextValiJudgeLock(Jsqte) = True
  1515.         Next Jsqte
  1516.     
  1517.         '[>>
  1518.         '在此处可添加新增记录时初始化设置
  1519.         '<<]
  1520.     Else
  1521.     
  1522.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1523.         With RecTemp
  1524.             Sqlstr = "SELECT * FROM Gy_V_Customer Where CusCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'"
  1525.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1526.        
  1527.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  1528.             If Not RecTemp.EOF Then
  1529.                 
  1530.                 Call ShowData(RecTemp)
  1531.             Else
  1532.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1533.                 Call Xtxxts(Tsxx, 0, 4)
  1534.                 Call Cancel
  1535.                 TextChangeLock = False
  1536.                 Exit Function
  1537.             End If
  1538.         End With
  1539.     End If
  1540.     
  1541.     Cshlrxx = True
  1542.     TextChangeLock = False
  1543.     
  1544. End Function
  1545. Private Sub ShowData(rs As ADODB.Recordset)
  1546.     With rs
  1547.         
  1548.         LrText(0) = Trim(.Fields("CusCode") & "")                 '客户编码
  1549.         LrText(1) = Trim(.Fields("CusName") & "")                 '客户名称
  1550.         LrText(2) = Trim(.Fields("Areaname") & "")                '地区名称
  1551.         LrText(3) = Trim(.Fields("Tradename") & "")               '行业名称
  1552.         LrText(4) = Trim(.Fields("Address") & "")                 '地址
  1553.         LrText(5) = Trim(.Fields("postcode") & "")                '邮政编码
  1554.         LrText(6) = Trim(.Fields("taxcode") & "")                 '税号
  1555.         LrText(7) = Trim(.Fields("fictperson") & "")              '法人
  1556.         LrText(8) = Trim(.Fields("bank") & "")                    '开户银行
  1557.         LrText(9) = Trim(.Fields("bankaccount") & "")             '银行账号
  1558.         LrText(10) = Trim(.Fields("cussuper") & "")               '上级主管部门
  1559.         LrText(11) = Trim(.Fields("email") & "")                  'email
  1560.         LrText(12) = Trim(.Fields("worknet"))                     '网址
  1561.         LrText(13) = Trim(.Fields("contactperson") & "")          '联系人
  1562.         LrText(14) = Trim(.Fields("contacttype") & "")            '联系方式
  1563.         LrText(15) = Trim(.Fields("desaddress") & "")             '收货地址
  1564.         
  1565.         LrText(16) = Trim(.Fields("creditgrade") & "")            '信用等级
  1566.         LrText(17) = Trim(.Fields("creditmoney") & "")            '信用额度
  1567.         LrText(18) = Trim(.Fields("creditagemoney") & "")         '帐龄额度
  1568.         LrText(19) = Trim(.Fields("creditdate") & "")             '信用天数
  1569.         
  1570.         '
  1571.         LrText(25) = Trim(.Fields("deptname") & "")               '公司分管部门名称
  1572.         LrText(26) = Trim(.Fields("Personname") & "")             '所属销售员
  1573.         LrText(27) = Format(Trim(.Fields("relationdate") & ""), "yyyy-mm-dd")  '发展日期
  1574.         
  1575.         If .Fields("stopflag") Then                               '停用标志
  1576.             ChkStopUse.Value = 1
  1577.         Else
  1578.             ChkStopUse.Value = 0
  1579.         End If
  1580.         
  1581.         str_cusname = LrText(1)
  1582.     End With
  1583. End Sub
  1584. Private Sub Scdqjl()                 '删 除 当 前 记 录
  1585.     Dim Yhanswer As Integer
  1586.     
  1587.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1588.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1589.         Exit Sub
  1590.     End If
  1591.             
  1592.     '非数据行不能删除
  1593.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1594.         Exit Sub
  1595.     End If
  1596.   
  1597.     '用户确认是否删除记录
  1598.     Tsxx = "请确认是否删除当前记录?"
  1599.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1600.     
  1601.     If Yhanswer = 2 Then
  1602.         Exit Sub
  1603.     End If
  1604.     On Error GoTo Cwcl
  1605.   
  1606.     Cw_DataEnvi.DataConnect.BeginTrans
  1607.     '[>>以下需自定义部分
  1608.     Cw_DataEnvi.DataConnect.Execute "delete Gy_Customer where CusCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  1609.     '以上为自定义部分<<]
  1610.   
  1611.     Cw_DataEnvi.DataConnect.CommitTrans
  1612.     CzxsGrid.RemoveItem CzxsGrid.Row
  1613.     Exit Sub
  1614.   
  1615. Cwcl:
  1616.     Cw_DataEnvi.DataConnect.RollbackTrans
  1617.     
  1618.     If Err.Number = -2147217873 Then                '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1619.         Tsxx = "此客户已经被使用,不能删除!"
  1620.         Call Xtxxts(Tsxx, 0, 1)
  1621.         Exit Sub
  1622.     Else
  1623.         Tsxx = "出现未知情况,此客户不能被删除!"
  1624.         Call Xtxxts(Tsxx, 0, 1)
  1625.         Exit Sub
  1626.     End If
  1627.     
  1628. End Sub
  1629. '*******************以下区域为编写自定义过程区域**********************
  1630. '*******************以上区域为编写自定义过程区域**********************
  1631. '******************以下为基本处理程序(固定不变)************************'
  1632. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1633.     If Shift = 2 Then
  1634.         Select Case UCase(Chr(KeyCode))
  1635.             Case "P"                                                                          'Ctrl+P 打印
  1636.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1637.                     Call bbyl(False)
  1638.                 End If
  1639.             Case "A"                                                                          'Ctrl+A 增加
  1640.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1641.                 If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1642.                     Exit Sub
  1643.                 End If
  1644.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1645.                     Call Toolbjzt
  1646.                     Lrzt = 1
  1647.                     Call Cshlrxx(Lrzt)
  1648.                     LrText(0).SetFocus
  1649.                     LrText(0).Enabled = True
  1650.                 End If
  1651.             Case "D"                                                                          'Ctrl+D 删除
  1652.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1653.                     Call Scdqjl
  1654.                 End If
  1655.         End Select
  1656.     End If
  1657.     
  1658. End Sub
  1659. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1660.    
  1661.     Select Case Button.Key
  1662.         Case "ymsz"                                          '页面设置
  1663.             Dyymctbl.Show 1
  1664.         Case "yl"                                            '预 览
  1665.             Call bbyl(True)
  1666.         Case "dy"                                            '打 印
  1667.             Call bbyl(False)
  1668.         Case "zj"                                            '增 加
  1669.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1670.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1671.                 Exit Sub
  1672.             End If
  1673.             Call Toolbjzt
  1674.             Lrzt = 1
  1675.             Call Cshlrxx(Lrzt)
  1676.             
  1677.             LrText(0).Enabled = True
  1678.             LrText(0).SetFocus
  1679.         Case "xg"                                            '修 改
  1680.             Call Xgdqjl
  1681.         Case "sc"                                            '删 除
  1682.             Call Scdqjl                                      '查询
  1683.         Case "cx"
  1684.             Gy_CustomerQuery.Show 1
  1685.         Case "sx"                                            '刷 新
  1686.             Call Cxnrtcwg
  1687.         Case "bz"                                            '帮 助
  1688.             Call F1bz
  1689.         Case "fh"                                            '退 出
  1690.             Unload Me
  1691.         End Select
  1692.         
  1693. End Sub
  1694. Private Sub CzxsGrid_DblClick()                            '修改当前编码记录
  1695.     Call Xgdqjl
  1696.   
  1697. End Sub
  1698. Private Sub Xgdqjl()                                       '修改当前编码记录
  1699.     
  1700.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1701.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  1702.         BcCommand.Enabled = False
  1703.     End If
  1704.     
  1705.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1706.         Exit Sub
  1707.     End If
  1708.     
  1709.     Call Toolbjzt
  1710.     Call mmkn
  1711.     Lrzt = 2
  1712.     
  1713.     If Cshlrxx(Lrzt) Then
  1714.         LrText(1).SetFocus
  1715.         LrText(0).Enabled = False
  1716.     End If
  1717.   
  1718. End Sub
  1719. Private Sub Toolbjzt()                                     'Toolbar状态(编辑状态)
  1720.     StTab.TabEnabled(1) = True
  1721.     StTab.Tab = 1
  1722.     Frame1.Enabled = True
  1723.     StTab.TabEnabled(0) = False
  1724.     CzxsGrid.Enabled = False
  1725.   
  1726.     With SzToolbar
  1727.         .Buttons("ymsz").Enabled = False
  1728.         .Buttons("dy").Enabled = False
  1729.         .Buttons("yl").Enabled = False
  1730.         .Buttons("zj").Enabled = False
  1731.         .Buttons("xg").Enabled = False
  1732.         .Buttons("sc").Enabled = False
  1733.         .Buttons("sx").Enabled = False
  1734.         .Buttons("cx").Enabled = False
  1735.     End With
  1736.   
  1737. End Sub
  1738. Private Sub Toolfbjzt()                                    'Toolbar状态(非编辑状态)
  1739.     StTab.TabEnabled(0) = True
  1740.     StTab.Tab = 0
  1741.     CzxsGrid.Enabled = True
  1742.     Frame1.Enabled = False
  1743.     StTab.TabEnabled(1) = False
  1744.     Lrzt = 0
  1745.     
  1746.     With SzToolbar
  1747.         .Buttons("ymsz").Enabled = True
  1748.         .Buttons("dy").Enabled = True
  1749.         .Buttons("yl").Enabled = True
  1750.         .Buttons("zj").Enabled = True
  1751.         .Buttons("xg").Enabled = True
  1752.         .Buttons("sc").Enabled = True
  1753.         .Buttons("sx").Enabled = True
  1754.         .Buttons("cx").Enabled = True
  1755.     End With
  1756.   
  1757. End Sub
  1758. Private Sub BcCommand_Click()                                           '保 存
  1759.     If Not Bclrsj Then
  1760.         Exit Sub
  1761.     End If
  1762.   
  1763.     If Lrzt = 2 Then
  1764.         Call Toolfbjzt
  1765.     End If
  1766.   
  1767. End Sub
  1768. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)       '取消
  1769.   
  1770.     '避免执行Click程序
  1771.     Bln_Cancel = True
  1772.   
  1773.     Call Cancel
  1774.     
  1775. End Sub
  1776. Private Sub QxCommand_Click()                                                                         '取消
  1777.  
  1778.     If Bln_Cancel Then
  1779.         Bln_Cancel = False
  1780.         Exit Sub
  1781.     End If
  1782.  
  1783.     Call Cancel
  1784.     
  1785. End Sub
  1786. Private Sub Cancel()                                                                                  '取消
  1787.   
  1788.     '文本框加锁
  1789.     For Jsqte = 0 To Max_Text_Index
  1790.         TextValiJudgeLock(Jsqte) = True
  1791.     Next Jsqte
  1792.   
  1793.     Call Toolfbjzt
  1794.     
  1795. End Sub
  1796. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1797.     
  1798.     FnBln_RefreshArray Col, Position, GridStr(), GridInf()
  1799. End Sub
  1800. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1801.     
  1802.     Select Case Button.Key
  1803.         Case "bcgs"                                       '保存表格格式
  1804.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1805.         Case "hfmrgs"                                     '恢复默认格式
  1806.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1807.         Case "szxsxm"                                     '设置显示项目
  1808.             Call Szxsxm(CzxsGrid, GridCode)
  1809.     End Select
  1810.     
  1811. End Sub
  1812. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1813.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1814.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1815.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1816.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1817.     ReDim Bbxbt(1 To Bbxbtgs)
  1818.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1819.     
  1820.     If Bbbwhgs <> 0 Then
  1821.         ReDim Bbbwh(1 To Bbbwhgs)
  1822.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1823.     End If
  1824.     
  1825.     Bbzbt = ReportTitle
  1826.     Bbxbt(1) = " "
  1827.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1828.     
  1829.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1830.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1831.   
  1832.     If Not bbylte Then
  1833.         Unload DY_Tybbyldy
  1834.     End If
  1835.     
  1836. End Sub
  1837. '************以下为文本框录入处理程序(固定不变部分)*************'
  1838. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1839.     '以下为依据实际情况自定义部分[
  1840.   
  1841.         '在此填写文本框录入事后处理程序
  1842.    
  1843.     ']以上为依据实际情况自定义部分
  1844.     
  1845. End Sub
  1846. Private Sub LrText_Change(Index As Integer)
  1847.     '屏蔽程序改变控制
  1848.     If TextChangeLock Then
  1849.         Exit Sub
  1850.     End If
  1851.     
  1852.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1853.     
  1854.     '限制字段录入长度
  1855.           
  1856.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1857.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  1858.     Select Case Textint(Index, 1)
  1859.         Case 8, 11      '金额型
  1860.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1861.         Case 9, 12      '数量型
  1862.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1863.         Case 10          '单价型
  1864.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1865.         Case Else        '其他小数类型控制
  1866.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1867.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1868.             End If
  1869.     End Select
  1870.         
  1871.     TextChangeLock = False '解锁
  1872.     
  1873. End Sub
  1874. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1875.    
  1876.     Call TextShow(Index)
  1877.     CurTextIndex = Index
  1878.     LrText(Index).SelStart = Len(LrText(Index))
  1879.    
  1880. End Sub
  1881. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1882.    
  1883.     Select Case KeyCode
  1884.          Case vbKeyF2
  1885.              Call Text_Help(Index)
  1886.     End Select
  1887.    
  1888. End Sub
  1889. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1890.    
  1891.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1892. End Sub
  1893. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1894.     Dim RecTemp As New ADODB.Recordset
  1895.     '显示相应信息但不能进行有效性判断
  1896.     '[>>
  1897.     If Index = 0 And Lrzt = 1 Then '增加时,用户输入物料编码,显示此物料编码对应的记录
  1898.         Sqlstr = "SELECT * FROM Gy_V_Customer Where cuscode='" & Trim(LrText(0)) & "'"
  1899.         
  1900.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1901.         
  1902.         '记录如存在则读入其内容,否则提示记录已被其他人删除
  1903.         If Not RecTemp.EOF Then
  1904.             Call ShowData(RecTemp)
  1905.         End If
  1906.     End If
  1907.     '<<]
  1908. End Sub
  1909. Private Sub Timer1_Timer()
  1910.      Dim Sqlstr As String
  1911.      Timer1.Enabled = False
  1912. '     Xt_Wait.Show
  1913. '     Xt_Wait.Refresh
  1914.     
  1915.      '加快显示速度
  1916.      CzxsGrid.Redraw = False
  1917.     
  1918.      '生成查询结果
  1919.      Dim Str_QueryCondi As String
  1920.      Dim Jsqte As Integer
  1921.     
  1922.      With Gy_CustomerQuery
  1923.          Str_QueryCondi = " where 1=1 "
  1924.          For Jsqte = 0 To 4
  1925.             Select Case Jsqte
  1926.               Case 0  '客户名称
  1927.                 If Trim(.LrText(0).Text) <> "" Then
  1928.                  Str_QueryCondi = Str_QueryCondi & " and cuscode='" & Trim(.LrText(0).Tag) & "'"
  1929.                 End If
  1930.               Case 1  '所属地区
  1931.                 If Trim(.LrText(1).Text) <> "" Then
  1932.                  Str_QueryCondi = Str_QueryCondi & " and areacode='" & Trim(.LrText(1).Tag) & "'"
  1933.                 End If
  1934.               Case 2   '所属行业
  1935.                  If Trim(.LrText(2).Text) <> "" Then
  1936.                     Str_QueryCondi = Str_QueryCondi & " and tradecode='" & Trim(.LrText(2).Tag) & "'"
  1937.                  End If
  1938.               Case 3    '分管部门
  1939.                 If Trim(.LrText(3).Text) <> "" Then
  1940.                     Str_QueryCondi = Str_QueryCondi & " and deptcode= '" & Trim(.LrText(3).Tag) & "'"
  1941.                 End If
  1942.               Case 4    '所属业务员
  1943.                 If Trim(.LrText(4).Text) <> "" Then
  1944.                     Str_QueryCondi = Str_QueryCondi & " and PersonCode= '" & Trim(.LrText(4).Tag) & "'"
  1945.                 End If
  1946.             End Select
  1947.     
  1948.         Next
  1949.        '查询连接串
  1950.       Sqlstr = "SELECT * from Gy_v_customer  " & Str_QueryCondi & " order by cuscode"
  1951.     
  1952.        Call Cxnrtcwg(Sqlstr)
  1953.       
  1954.      End With
  1955.    
  1956.     CzxsGrid.Redraw = True
  1957. '
  1958. '    Xt_Wait.Hide
  1959. End Sub
  1960. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)     '按钮提供帮助
  1961.     
  1962.     Call Text_Help(Index)
  1963.     
  1964. End Sub
  1965. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1966.   
  1967.     If Not Textboolean(Index, 1) Then
  1968.         Exit Sub
  1969.     End If
  1970.    
  1971.     '调用帮助
  1972.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1973.   
  1974.     '根据设置选择显示编码和名称,并进行存储
  1975.     If Len(Xtfhcs) <> 0 Then
  1976.         If Textint(Index, 3) = 1 Then
  1977.             LrText(Index).Text = Xtfhcsfz
  1978.             LrText(Index).Tag = Xtfhcs
  1979.         Else
  1980.             LrText(Index).Text = Xtfhcs
  1981.             LrText(Index).Tag = Xtfhcsfz
  1982.         End If
  1983.     End If
  1984.    
  1985.     LrText(Index).SetFocus
  1986.     
  1987. End Sub
  1988. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1989.     '填写文本框得到焦点,进行相应信息处理程序
  1990.    
  1991. End Sub
  1992. Private Sub Wbkcsh()                          '录入文本框初始化
  1993.     Dim Jsqte As Integer
  1994.   
  1995.     '最大录入文本框索引值
  1996.     Max_Text_Index = Textvar(1)
  1997.   
  1998.     ReDim TextValiJudgeLock(Max_Text_Index)
  1999.     
  2000.     For Jsqte = 0 To Max_Text_Index
  2001.      
  2002.         If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
  2003.             If Textboolean(Jsqte, 1) Then
  2004.                 If Jsqte <> 0 And Not Textboolean(Jsqte, 3) Then
  2005.                     Load Ydcommand1(Jsqte)
  2006.                 End If
  2007.                 Ydcommand1(Jsqte).Visible = True
  2008.                 Ydcommand1(Jsqte).Move LrText(Jsqte).Left + LrText(Jsqte).Width, LrText(Jsqte).Top
  2009.             End If
  2010.             TextChangeLock = True
  2011.             LrText(Jsqte).Text = ""
  2012.             LrText(Jsqte).Tag = ""
  2013.             
  2014.             If Textint(Jsqte, 5) <> 0 Then
  2015.                 LrText(Jsqte).MaxLength = Textint(Jsqte, 5)
  2016.             End If
  2017.             
  2018.             TextChangeLock = False
  2019.         End If
  2020.         
  2021.         TextValiJudgeLock(Jsqte) = True
  2022.     Next Jsqte
  2023.     
  2024. End Sub
  2025. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  2026.     Dim Sqlstr As String
  2027.     Dim Findrec As ADODB.Recordset
  2028.   
  2029.     '文本框内容未曾改变不进行有效性判断
  2030.     If TextValiJudgeLock(Index) Then
  2031.         TextYxxpd = True
  2032.         Exit Function
  2033.     End If
  2034.   
  2035.     '文本框内容为空认为有效,并清空其Tag值
  2036.     If Trim(LrText(Index)) = "" Then
  2037.         LrText(Index).Tag = ""
  2038.         Call Wbklrwbcl(Index)
  2039.         TextValiJudgeLock(Index) = True
  2040.         TextYxxpd = True
  2041.         Exit Function
  2042.     End If
  2043.   
  2044.     '可在此加入不做有效性判断的理由
  2045.   
  2046.     Select Case Textint(Index, 4)
  2047.         Case 1      '编码型
  2048.             Sqlstr = Trim(Textstr(Index, 5))
  2049.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  2050.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  2051.          
  2052.             If Findrec.EOF Then
  2053.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  2054.                 LrText(Index).SetFocus
  2055.                 Exit Function
  2056.             Else
  2057.                 Select Case Textint(Index, 3)
  2058.                     Case 0
  2059.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2060.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2061.                         End If
  2062.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2063.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2064.                         End If
  2065.                     Case 1
  2066.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  2067.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  2068.                         End If
  2069.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  2070.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  2071.                         End If
  2072.                 End Select
  2073.             End If
  2074.             
  2075.         Case 2      '日期型
  2076.             If IsDate(LrText(Index).Text) Then
  2077.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  2078.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  2079.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  2080.                 End If
  2081.             Else
  2082.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  2083.                 Call Xtxxts(Tsxx, 0, 1)
  2084.                 LrText(Index).SetFocus
  2085.                 Exit Function
  2086.             End If
  2087.             
  2088.         Case 3      '其他类型
  2089.         
  2090.     End Select
  2091.     
  2092.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  2093.     TextValiJudgeLock(Index) = True
  2094.     '调用文本框事后处理程序
  2095.     Call Wbklrwbcl(Index)
  2096.    
  2097.     '有效性判断通过则返回True
  2098.     TextYxxpd = True
  2099.    
  2100. End Function
  2101. '[<<
  2102. Private Sub Command1_Click()
  2103.     CzxsGrid.Row = CzxsGrid.FixedRows
  2104.     Call mmkn
  2105.     Lrzt = 2
  2106.     If Cshlrxx(Lrzt) Then
  2107.         LrText(1).SetFocus
  2108.         LrText(0).Enabled = False
  2109.     End If
  2110. End Sub
  2111. Private Sub Command2_Click()
  2112.     If CzxsGrid.Row = CzxsGrid.FixedRows Then
  2113.         Exit Sub
  2114.     Else
  2115.         CzxsGrid.Row = CzxsGrid.Row - 1
  2116.     End If
  2117.     Call mmkn
  2118.     Lrzt = 2
  2119.     If Cshlrxx(Lrzt) Then
  2120.         LrText(1).SetFocus
  2121.         LrText(0).Enabled = False
  2122.     End If
  2123. End Sub
  2124. Private Sub Command3_Click()
  2125.     If CzxsGrid.Row = CzxsGrid.Rows - 1 Then
  2126.         Exit Sub
  2127.     Else
  2128.         CzxsGrid.Row = CzxsGrid.Row + 1
  2129.     End If
  2130.     Call mmkn
  2131.     Lrzt = 2
  2132.     If Cshlrxx(Lrzt) Then
  2133.         LrText(1).SetFocus
  2134.         LrText(0).Enabled = False
  2135.     End If
  2136. End Sub
  2137. Private Sub Command4_Click()
  2138.     CzxsGrid.Row = CzxsGrid.Rows - 1
  2139.     Call mmkn
  2140.     Lrzt = 2
  2141.     If Cshlrxx(Lrzt) Then
  2142.         LrText(1).SetFocus
  2143.         LrText(0).Enabled = False
  2144.     End If
  2145. End Sub
  2146. Private Sub mmkn()
  2147.             If CzxsGrid.Rows = CzxsGrid.FixedRows Then
  2148.                Command1.Enabled = False    '首张
  2149.                Command2.Enabled = False     '上张
  2150.                Command3.Enabled = False     '下张
  2151.                Command4.Enabled = False     '末张
  2152.             ElseIf CzxsGrid.Rows - 1 = CzxsGrid.FixedRows Then
  2153.                Command1.Enabled = False    '首张
  2154.                Command2.Enabled = False     '上张
  2155.                Command3.Enabled = False     '下张
  2156.                Command4.Enabled = False     '末张
  2157.             ElseIf CzxsGrid.Row = CzxsGrid.Rows - 1 Then
  2158.                Command1.Enabled = True     '首张
  2159.                Command2.Enabled = True      '上张
  2160.                Command3.Enabled = False     '下张
  2161.                Command4.Enabled = False     '末张
  2162.             ElseIf CzxsGrid.Row = CzxsGrid.FixedRows Then
  2163.                Command1.Enabled = False    '首张
  2164.                Command2.Enabled = False     '上张
  2165.                Command3.Enabled = True      '下张
  2166.                Command4.Enabled = True     '末张
  2167.             ElseIf CzxsGrid.Row <> CzxsGrid.Rows - 1 And CzxsGrid.Row <> CzxsGrid.FixedRows Then
  2168.                Command1.Enabled = True   '首张
  2169.                Command2.Enabled = True     '上张
  2170.                Command3.Enabled = True     '下张
  2171.                Command4.Enabled = True     '末张
  2172.             End If
  2173. End Sub
  2174. '>>]