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

企业管理

开发平台:

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_Warehouse 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "仓库档案设置"
  8.    ClientHeight    =   7110
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   9375
  12.    HelpContextID   =   2001
  13.    Icon            =   "公用_仓库档案设置.frx":0000
  14.    KeyPreview      =   -1  'True
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   7110
  19.    ScaleWidth      =   9375
  20.    ShowInTaskbar   =   0   'False
  21.    StartUpPosition =   2  '屏幕中心
  22.    Begin TabDlg.SSTab StTab 
  23.       Height          =   6435
  24.       Left            =   30
  25.       TabIndex        =   18
  26.       Top             =   660
  27.       Width           =   9330
  28.       _ExtentX        =   16457
  29.       _ExtentY        =   11351
  30.       _Version        =   393216
  31.       Style           =   1
  32.       Tabs            =   2
  33.       TabHeight       =   520
  34.       TabCaption(0)   =   "列表视图"
  35.       TabPicture(0)   =   "公用_仓库档案设置.frx":08CA
  36.       Tab(0).ControlEnabled=   -1  'True
  37.       Tab(0).Control(0)=   "CzxsGrid"
  38.       Tab(0).Control(0).Enabled=   0   'False
  39.       Tab(0).ControlCount=   1
  40.       TabCaption(1)   =   "单张视图"
  41.       TabPicture(1)   =   "公用_仓库档案设置.frx":08E6
  42.       Tab(1).ControlEnabled=   0   'False
  43.       Tab(1).Control(0)=   "Frame1"
  44.       Tab(1).ControlCount=   1
  45.       Begin VB.Frame Frame1 
  46.          Height          =   6016
  47.          Left            =   -74909
  48.          TabIndex        =   19
  49.          Top             =   316
  50.          Width           =   9135
  51.          Begin VB.TextBox LrText 
  52.             Height          =   301
  53.             Index           =   6
  54.             Left            =   1290
  55.             TabIndex        =   6
  56.             Text            =   "5"
  57.             Top             =   1559
  58.             Width           =   1739
  59.          End
  60.          Begin VB.TextBox LrText 
  61.             Height          =   301
  62.             Index           =   2
  63.             Left            =   1290
  64.             TabIndex        =   2
  65.             Text            =   "2"
  66.             Top             =   781
  67.             Width           =   1739
  68.          End
  69.          Begin VB.TextBox LrText 
  70.             Height          =   301
  71.             Index           =   8
  72.             Left            =   1290
  73.             TabIndex        =   13
  74.             Text            =   "7"
  75.             Top             =   2926
  76.             Width           =   5131
  77.          End
  78.          Begin VB.TextBox LrText 
  79.             Height          =   301
  80.             Index           =   4
  81.             Left            =   1290
  82.             TabIndex        =   4
  83.             Text            =   "3"
  84.             Top             =   1170
  85.             Width           =   1739
  86.          End
  87.          Begin VB.TextBox LrText 
  88.             Height          =   301
  89.             Index           =   0
  90.             Left            =   1290
  91.             TabIndex        =   0
  92.             Text            =   "0"
  93.             Top             =   389
  94.             Width           =   1739
  95.          End
  96.          Begin VB.CheckBox LrCheck 
  97.             Caption         =   "储备预警"
  98.             Height          =   225
  99.             Index           =   2
  100.             Left            =   1290
  101.             TabIndex        =   12
  102.             Top             =   2625
  103.             Width           =   1935
  104.          End
  105.          Begin VB.ComboBox Lrcomb 
  106.             Height          =   300
  107.             Index           =   0
  108.             ItemData        =   "公用_仓库档案设置.frx":0902
  109.             Left            =   1290
  110.             List            =   "公用_仓库档案设置.frx":0904
  111.             Style           =   2  'Dropdown List
  112.             TabIndex        =   8
  113.             Top             =   1950
  114.             Width           =   1739
  115.          End
  116.          Begin VB.CheckBox LrCheck 
  117.             Caption         =   "存货核算系统使用"
  118.             Height          =   225
  119.             Index           =   0
  120.             Left            =   1290
  121.             TabIndex        =   10
  122.             Top             =   2340
  123.             Width           =   1935
  124.          End
  125.          Begin VB.TextBox LrText 
  126.             Height          =   301
  127.             Index           =   7
  128.             Left            =   4665
  129.             TabIndex        =   7
  130.             Text            =   "6"
  131.             Top             =   1559
  132.             Width           =   1739
  133.          End
  134.          Begin VB.CommandButton BcCommand 
  135.             Caption         =   "保存(&S)"
  136.             Height          =   301
  137.             Left            =   4110
  138.             TabIndex        =   14
  139.             Top             =   3510
  140.             Width           =   1119
  141.          End
  142.          Begin VB.CommandButton QxCommand 
  143.             Cancel          =   -1  'True
  144.             Caption         =   "取消(&C)"
  145.             Height          =   301
  146.             Left            =   5300
  147.             TabIndex        =   15
  148.             Top             =   3510
  149.             Width           =   1119
  150.          End
  151.          Begin VB.CheckBox LrCheck 
  152.             Caption         =   "货区管理"
  153.             Height          =   285
  154.             Index           =   1
  155.             Left            =   4665
  156.             TabIndex        =   11
  157.             Top             =   2340
  158.             Width           =   1454
  159.          End
  160.          Begin VB.TextBox LrText 
  161.             Height          =   301
  162.             Index           =   1
  163.             Left            =   4665
  164.             TabIndex        =   1
  165.             Text            =   "1"
  166.             Top             =   389
  167.             Width           =   1739
  168.          End
  169.          Begin VB.TextBox LrText 
  170.             Height          =   301
  171.             Index           =   3
  172.             Left            =   4665
  173.             TabIndex        =   3
  174.             Text            =   "2"
  175.             Top             =   781
  176.             Width           =   1739
  177.          End
  178.          Begin VB.TextBox LrText 
  179.             Height          =   301
  180.             Index           =   5
  181.             Left            =   4665
  182.             TabIndex        =   5
  183.             Text            =   "4"
  184.             Top             =   1170
  185.             Width           =   1739
  186.          End
  187.          Begin VB.ComboBox Lrcomb 
  188.             Height          =   300
  189.             Index           =   1
  190.             ItemData        =   "公用_仓库档案设置.frx":0906
  191.             Left            =   4665
  192.             List            =   "公用_仓库档案设置.frx":0908
  193.             Style           =   2  'Dropdown List
  194.             TabIndex        =   9
  195.             Top             =   1950
  196.             Width           =   1739
  197.          End
  198.          Begin VB.CommandButton Ydcommand1 
  199.             Height          =   301
  200.             Index           =   0
  201.             Left            =   3465
  202.             Picture         =   "公用_仓库档案设置.frx":090A
  203.             Style           =   1  'Graphical
  204.             TabIndex        =   20
  205.             Top             =   106
  206.             Visible         =   0   'False
  207.             Width           =   300
  208.          End
  209.          Begin VB.CommandButton Ydcommand1 
  210.             Height          =   301
  211.             Index           =   3
  212.             Left            =   6376
  213.             Picture         =   "公用_仓库档案设置.frx":0C94
  214.             Style           =   1  'Graphical
  215.             TabIndex        =   16
  216.             Top             =   781
  217.             Width           =   300
  218.          End
  219.          Begin VB.Label lblMsg 
  220.             Caption         =   "说明:此仓库已被使用,只能修改部分属性!"
  221.             ForeColor       =   &H00FF0000&
  222.             Height          =   374
  223.             Left            =   451
  224.             TabIndex        =   34
  225.             Top             =   4141
  226.             Visible         =   0   'False
  227.             Width           =   3886
  228.          End
  229.          Begin VB.Label TsLabel 
  230.             Caption         =   "资金定额:"
  231.             Height          =   180
  232.             Index           =   9
  233.             Left            =   3825
  234.             TabIndex        =   33
  235.             Top             =   1605
  236.             Width           =   809
  237.          End
  238.          Begin VB.Label TsLabel 
  239.             AutoSize        =   -1  'True
  240.             Caption         =   "电话:"
  241.             Height          =   180
  242.             Index           =   5
  243.             Left            =   451
  244.             TabIndex        =   32
  245.             Top             =   1605
  246.             Width           =   451
  247.          End
  248.          Begin VB.Label TsLabel 
  249.             AutoSize        =   -1  'True
  250.             Caption         =   "仓库前缀:"
  251.             Height          =   180
  252.             Index           =   10
  253.             Left            =   451
  254.             TabIndex        =   31
  255.             Top             =   826
  256.             Width           =   809
  257.          End
  258.          Begin VB.Label TsLabel 
  259.             AutoSize        =   -1  'True
  260.             Caption         =   "属性:"
  261.             Height          =   180
  262.             Index           =   2
  263.             Left            =   451
  264.             TabIndex        =   28
  265.             Top             =   2039
  266.             Width           =   451
  267.          End
  268.          Begin VB.Label TsLabel 
  269.             AutoSize        =   -1  'True
  270.             Caption         =   "仓库编码:"
  271.             Height          =   180
  272.             Index           =   0
  273.             Left            =   451
  274.             TabIndex        =   27
  275.             Top             =   435
  276.             Width           =   809
  277.          End
  278.          Begin VB.Label TsLabel 
  279.             Caption         =   "仓库名称:"
  280.             Height          =   180
  281.             Index           =   1
  282.             Left            =   3825
  283.             TabIndex        =   26
  284.             Top             =   435
  285.             Width           =   809
  286.          End
  287.          Begin VB.Label TsLabel 
  288.             Caption         =   "所属部门:"
  289.             Height          =   180
  290.             Index           =   3
  291.             Left            =   3825
  292.             TabIndex        =   25
  293.             Top             =   826
  294.             Width           =   809
  295.          End
  296.          Begin VB.Label TsLabel 
  297.             AutoSize        =   -1  'True
  298.             Caption         =   "仓库地址:"
  299.             Height          =   180
  300.             Index           =   4
  301.             Left            =   451
  302.             TabIndex        =   24
  303.             Top             =   1215
  304.             Width           =   809
  305.          End
  306.          Begin VB.Label TsLabel 
  307.             Caption         =   "负责人:"
  308.             Height          =   180
  309.             Index           =   6
  310.             Left            =   3825
  311.             TabIndex        =   23
  312.             Top             =   1215
  313.             Width           =   630
  314.          End
  315.          Begin VB.Label TsLabel 
  316.             Caption         =   "计价方式:"
  317.             Height          =   180
  318.             Index           =   7
  319.             Left            =   3825
  320.             TabIndex        =   22
  321.             Top             =   2039
  322.             Width           =   809
  323.          End
  324.          Begin VB.Label TsLabel 
  325.             AutoSize        =   -1  'True
  326.             Caption         =   "备注:"
  327.             Height          =   180
  328.             Index           =   8
  329.             Left            =   451
  330.             TabIndex        =   21
  331.             Top             =   2969
  332.             Width           =   451
  333.          End
  334.       End
  335.       Begin VSFlex8Ctl.VSFlexGrid CzxsGrid 
  336.          Height          =   5955
  337.          Left            =   91
  338.          TabIndex        =   17
  339.          Top             =   389
  340.          Width           =   9135
  341.          _cx             =   5080
  342.          _cy             =   5080
  343.          Appearance      =   1
  344.          BorderStyle     =   1
  345.          Enabled         =   -1  'True
  346.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  347.             Name            =   "宋体"
  348.             Size            =   9
  349.             Charset         =   134
  350.             Weight          =   400
  351.             Underline       =   0   'False
  352.             Italic          =   0   'False
  353.             Strikethrough   =   0   'False
  354.          EndProperty
  355.          MousePointer    =   0
  356.          BackColor       =   -2147483643
  357.          ForeColor       =   -2147483640
  358.          BackColorFixed  =   -2147483633
  359.          ForeColorFixed  =   -2147483630
  360.          BackColorSel    =   -2147483635
  361.          ForeColorSel    =   -2147483634
  362.          BackColorBkg    =   8421504
  363.          BackColorAlternate=   -2147483643
  364.          GridColor       =   -2147483633
  365.          GridColorFixed  =   -2147483632
  366.          TreeColor       =   -2147483632
  367.          FloodColor      =   192
  368.          SheetBorder     =   -2147483642
  369.          FocusRect       =   1
  370.          HighLight       =   1
  371.          AllowSelection  =   -1  'True
  372.          AllowBigSelection=   -1  'True
  373.          AllowUserResizing=   0
  374.          SelectionMode   =   0
  375.          GridLines       =   1
  376.          GridLinesFixed  =   2
  377.          GridLineWidth   =   1
  378.          Rows            =   5000
  379.          Cols            =   10
  380.          FixedRows       =   1
  381.          FixedCols       =   0
  382.          RowHeightMin    =   0
  383.          RowHeightMax    =   0
  384.          ColWidthMin     =   0
  385.          ColWidthMax     =   0
  386.          ExtendLastCol   =   0   'False
  387.          FormatString    =   ""
  388.          ScrollTrack     =   0   'False
  389.          ScrollBars      =   3
  390.          ScrollTips      =   0   'False
  391.          MergeCells      =   0
  392.          MergeCompare    =   0
  393.          AutoResize      =   -1  'True
  394.          AutoSizeMode    =   0
  395.          AutoSearch      =   0
  396.          AutoSearchDelay =   2
  397.          MultiTotals     =   -1  'True
  398.          SubtotalPosition=   1
  399.          OutlineBar      =   0
  400.          OutlineCol      =   0
  401.          Ellipsis        =   0
  402.          ExplorerBar     =   0
  403.          PicturesOver    =   0   'False
  404.          FillStyle       =   0
  405.          RightToLeft     =   0   'False
  406.          PictureType     =   0
  407.          TabBehavior     =   0
  408.          OwnerDraw       =   0
  409.          Editable        =   0
  410.          ShowComboButton =   1
  411.          WordWrap        =   0   'False
  412.          TextStyle       =   0
  413.          TextStyleFixed  =   0
  414.          OleDragMode     =   0
  415.          OleDropMode     =   0
  416.          DataMode        =   0
  417.          VirtualData     =   -1  'True
  418.          DataMember      =   ""
  419.          ComboSearch     =   3
  420.          AutoSizeMouse   =   -1  'True
  421.          FrozenRows      =   0
  422.          FrozenCols      =   0
  423.          AllowUserFreezing=   0
  424.          BackColorFrozen =   0
  425.          ForeColorFrozen =   0
  426.          WallPaperAlignment=   9
  427.          AccessibleName  =   ""
  428.          AccessibleDescription=   ""
  429.          AccessibleValue =   ""
  430.          AccessibleRole  =   24
  431.       End
  432.    End
  433.    Begin MSComctlLib.ImageList ImageList1 
  434.       Left            =   5430
  435.       Top             =   630
  436.       _ExtentX        =   1005
  437.       _ExtentY        =   1005
  438.       BackColor       =   -2147483643
  439.       ImageWidth      =   16
  440.       ImageHeight     =   16
  441.       MaskColor       =   12632256
  442.       _Version        =   393216
  443.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  444.          NumListImages   =   14
  445.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  446.             Picture         =   "公用_仓库档案设置.frx":101E
  447.             Key             =   "sz"
  448.          EndProperty
  449.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  450.             Picture         =   "公用_仓库档案设置.frx":13B8
  451.             Key             =   "dy"
  452.          EndProperty
  453.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  454.             Picture         =   "公用_仓库档案设置.frx":1752
  455.             Key             =   "yl"
  456.          EndProperty
  457.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  458.             Picture         =   "公用_仓库档案设置.frx":1AEC
  459.             Key             =   "xz"
  460.          EndProperty
  461.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  462.             Picture         =   "公用_仓库档案设置.frx":1E86
  463.             Key             =   "xg"
  464.          EndProperty
  465.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  466.             Picture         =   "公用_仓库档案设置.frx":2220
  467.             Key             =   "sc"
  468.          EndProperty
  469.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  470.             Picture         =   "公用_仓库档案设置.frx":25BA
  471.             Key             =   "sx"
  472.          EndProperty
  473.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  474.             Picture         =   "公用_仓库档案设置.frx":2954
  475.             Key             =   "bz"
  476.          EndProperty
  477.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  478.             Picture         =   "公用_仓库档案设置.frx":2CEE
  479.             Key             =   "tc"
  480.          EndProperty
  481.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  482.             Picture         =   "公用_仓库档案设置.frx":3088
  483.             Key             =   "bcgs"
  484.          EndProperty
  485.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  486.             Picture         =   "公用_仓库档案设置.frx":3422
  487.             Key             =   "mrlk"
  488.          EndProperty
  489.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  490.             Picture         =   "公用_仓库档案设置.frx":37BC
  491.             Key             =   "xsxm"
  492.          EndProperty
  493.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  494.             Picture         =   "公用_仓库档案设置.frx":3B56
  495.             Key             =   "cx"
  496.          EndProperty
  497.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  498.             Picture         =   "公用_仓库档案设置.frx":3EF0
  499.             Key             =   "qx"
  500.          EndProperty
  501.       EndProperty
  502.    End
  503.    Begin MSComctlLib.Toolbar SzToolbar 
  504.       Align           =   1  'Align Top
  505.       Height          =   555
  506.       Left            =   0
  507.       TabIndex        =   29
  508.       Top             =   0
  509.       Width           =   9375
  510.       _ExtentX        =   16536
  511.       _ExtentY        =   979
  512.       ButtonWidth     =   820
  513.       ButtonHeight    =   926
  514.       Appearance      =   1
  515.       Style           =   1
  516.       ImageList       =   "ImageList1"
  517.       _Version        =   393216
  518.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  519.          NumButtons      =   14
  520.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  521.             Caption         =   "设置"
  522.             Key             =   "ymsz"
  523.             ImageKey        =   "sz"
  524.          EndProperty
  525.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  526.             Caption         =   "打印"
  527.             Key             =   "dy"
  528.             ImageKey        =   "dy"
  529.          EndProperty
  530.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  531.             Caption         =   "预览"
  532.             Key             =   "yl"
  533.             ImageKey        =   "yl"
  534.          EndProperty
  535.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  536.             Style           =   3
  537.          EndProperty
  538.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  539.             Caption         =   "增加"
  540.             Key             =   "zj"
  541.             ImageKey        =   "xz"
  542.          EndProperty
  543.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  544.             Caption         =   "修改"
  545.             Key             =   "xg"
  546.             ImageKey        =   "xg"
  547.          EndProperty
  548.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  549.             Caption         =   "删除"
  550.             Key             =   "sc"
  551.             ImageKey        =   "sc"
  552.          EndProperty
  553.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  554.             Style           =   3
  555.          EndProperty
  556.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  557.             Caption         =   "权限"
  558.             Key             =   "Limit"
  559.             ImageKey        =   "qx"
  560.          EndProperty
  561.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  562.             Caption         =   "权限"
  563.             Key             =   "PersonLimit"
  564.             ImageIndex      =   1
  565.          EndProperty
  566.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  567.             Caption         =   "刷新"
  568.             Key             =   "sx"
  569.             ImageKey        =   "sx"
  570.          EndProperty
  571.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  572.             Style           =   3
  573.          EndProperty
  574.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  575.             Caption         =   "帮助"
  576.             Key             =   "bz"
  577.             ImageKey        =   "bz"
  578.          EndProperty
  579.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  580.             Caption         =   "退出"
  581.             Key             =   "fh"
  582.             ImageKey        =   "tc"
  583.          EndProperty
  584.       EndProperty
  585.       BorderStyle     =   1
  586.       Begin MSComctlLib.Toolbar GsToolbar 
  587.          Height          =   525
  588.          Left            =   6750
  589.          TabIndex        =   30
  590.          Top             =   0
  591.          Width           =   2595
  592.          _ExtentX        =   4577
  593.          _ExtentY        =   926
  594.          ButtonWidth     =   1455
  595.          ButtonHeight    =   926
  596.          Appearance      =   1
  597.          Style           =   1
  598.          ImageList       =   "ImageList1"
  599.          _Version        =   393216
  600.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  601.             NumButtons      =   3
  602.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  603.                Caption         =   "保存格式"
  604.                Key             =   "bcgs"
  605.                ImageKey        =   "bcgs"
  606.             EndProperty
  607.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  608.                Caption         =   "默认列宽"
  609.                Key             =   "hfmrgs"
  610.                ImageKey        =   "mrlk"
  611.             EndProperty
  612.             BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  613.                Caption         =   "显示项目"
  614.                Key             =   "szxsxm"
  615.                ImageKey        =   "xsxm"
  616.             EndProperty
  617.          EndProperty
  618.       End
  619.    End
  620. End
  621. Attribute VB_Name = "Gy_Warehouse"
  622. Attribute VB_GlobalNameSpace = False
  623. Attribute VB_Creatable = False
  624. Attribute VB_PredeclaredId = True
  625. Attribute VB_Exposed = False
  626. '*******************************************************
  627. '*    模 块 名 称 :仓库档案设置
  628. '*    功 能 描 述 :设置往来仓库档案
  629. '*    程序员姓名  :徐强
  630. '*    最后修改人  :徐强
  631. '*    最后修改时间:2001/11/27
  632. '*    备        注:
  633. '*******************************************************
  634. Dim Rec_CodeSet As New ADODB.Recordset   '编码设置表
  635. Dim jdzygs As Integer                    '控件焦点转移个数
  636. Dim Lrzt As Integer                      '录入状态标志(0-非录入状态 1-增加 2-修改)
  637. Dim ReportTitle As String                '报表主标题
  638. Dim Str_RightEdit As String              '编辑(新增、修改、删除)权限索引
  639. '以下为固定使用变量(网格)
  640. Dim Cxnrrec As New ADODB.Recordset       '显示查询内容动态集
  641. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  642. Dim GridCode As String                   '显示网格网格代码
  643. Dim GridInf() As Variant                 '整个网格设置信息
  644. Dim Tsxx As String                       '系统提示信息
  645. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  646. Dim Sjhgd As Double                      '网格数据行高度
  647. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  648. Dim GridStr()  As String                 '网格列信息(字符型)
  649. Dim GridInt() As Integer                 '网格列信息(整型)
  650. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  651. '以下为固定使用变量(文本框)
  652. Dim Textvar() As Variant                 '存储变体型文本框信息
  653. Dim Textboolean() As Boolean             '存储布尔型文本框信息
  654. Dim Textint() As Integer                 '存储整型文本框信息
  655. Dim Textstr() As String                  '存储字符型文本框信息
  656. Dim Max_Text_Index As Integer            '最大录入文本框索引值
  657. Dim TextGroupCode As String              '文本框录入分组编码
  658. Dim TextValiLock As Boolean              '文本框失去焦点是否进行有效性控制判断
  659. Dim TextValiJudgeLock() As Boolean       '文本框录入有效性判断控制锁
  660. Dim CurTextIndex As Integer              '当前文本框索引值
  661. Dim TextChangeLock As Boolean            '文本框内容变换控制锁
  662. Dim Bln_Cancel As Boolean                '取消按钮信息传递
  663. Public RZ As Long
  664. Public LZ As Long
  665. Private Sub Form_KeyPress(KeyAscii As Integer)   '控 制 焦 点 转 移
  666.     jdzygs = 15
  667.     
  668.     Select Case KeyAscii
  669.         Case vbKeyReturn
  670.             If Kjjdzy(jdzygs) Then
  671.                 KeyAscii = 0
  672.             End If
  673.         Case 39           '屏蔽"'"
  674.             KeyAscii = 0
  675.    End Select
  676.    
  677. End Sub
  678. Private Sub Form_Load()
  679.   
  680.     '打印报表标题信息
  681.     ReportTitle = "仓 库 档 案 设 置"
  682.      
  683.     '调入打印页面设置窗体
  684.     XtReportCode = "Gy_Warehouse"
  685.     Load Dyymctbl
  686.     
  687.     '以下为文本框处理程序(读入文本框录入信息)
  688.     TextGroupCode = "Gy_Warehouse"
  689.     Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr())
  690.     Call Wbkcsh
  691.     
  692.     '调入网格设置信息
  693.     GridCode = "Gy_Warehouse"
  694.     Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  695.     Qslz = GridInf(1)
  696.     Sjhgd = GridInf(2)
  697.     Szzls = CzxsGrid.Cols - 1
  698.     
  699.     '填 充 网 格
  700.     Call Cxnrtcwg
  701.        
  702.     '初始化toolbar,tab卡状态
  703.     StTab.Tab = 0
  704.     StTab.TabEnabled(1) = False
  705.     Frame1.Enabled = False
  706.      
  707.     '设置为非录入状态
  708.     Lrzt = 0
  709.     
  710.     '编辑(新增、修改、删除)权限索引
  711.     Str_RightEdit = "Gy_Warehouse_Edit"
  712.     
  713.     Dim rs As New ADODB.Recordset
  714.     
  715.     Set rs = Cw_DataEnvi.DataConnect.Execute("select * from Xt_ComboList where combo_code='Gy_WhAttribute' order by item_index")
  716.     Do While Not rs.EOF
  717.         Lrcomb(0).AddItem Trim(rs("item_content"))
  718.         rs.MoveNext
  719.     Loop
  720.     rs.Close
  721.     Set rs = Cw_DataEnvi.DataConnect.Execute("select * from Xt_ComboList where combo_code='Gy_PriceMode' order by item_index")
  722.     Do While Not rs.EOF
  723.         Lrcomb(1).AddItem Trim(rs("item_content"))
  724.         rs.MoveNext
  725.     Loop
  726.     
  727. End Sub
  728.  
  729. Private Sub Cxnrtcwg()                               '查询内容填充网格
  730.     Dim Sqlstr As String              '查询连接串
  731.     Dim jsqte As Long                '查询临时使用变量
  732.   
  733.     '为加快显示速度,将网格刷新动作冻结
  734.     CzxsGrid.Redraw = False
  735.   
  736.     '[>>查询连接串
  737.     Sqlstr = "SELECT * FROM Gy_V_Warehouse order by WhCode"
  738.     '<<]
  739.     Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  740.     
  741.     With Cxnrrec
  742.         CzxsGrid.Rows = CzxsGrid.FixedRows
  743.         If .EOF And .BOF Then
  744.             CzxsGrid.Redraw = True
  745.             Exit Sub
  746.         End If
  747.         
  748.         jsqte = CzxsGrid.FixedRows
  749.         
  750.         Do While Not .EOF
  751.             CzxsGrid.AddItem ""
  752.             Call Jltcwg(Cxnrrec, jsqte)                              '调入填充网格子过程
  753.             CzxsGrid.RowHeight(jsqte) = Sjhgd                        '设置网格高度
  754.             .MoveNext
  755.             jsqte = jsqte + 1
  756.         Loop
  757.     End With
  758.   
  759.     '将网格刷新动作解冻
  760.     CzxsGrid.Redraw = True
  761.     
  762. End Sub
  763. Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long)           '记录内容填充网格
  764.     '[>>以下为自定义部分
  765.     With Jlbrec
  766.         CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("WhCode") & "")              '仓库编码
  767.         CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("WhName") & "")              '仓库名称
  768.         CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("Whprofix") & "")            '仓库前缀
  769.         CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("Deptname") & "")            '所属部门
  770.         CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("WhAddress") & "")           '仓库地址
  771.         CzxsGrid.TextMatrix(Rowjsq, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("pricemode") & "")           '记价方式
  772.         CzxsGrid.TextMatrix(Rowjsq, Sydz("007", GridStr(), Szzls)) = Trim(.Fields("warehouseattribute") & "")  '属性
  773.         CzxsGrid.TextMatrix(Rowjsq, Sydz("008", GridStr(), Szzls)) = Trim(.Fields("telephone") & "")           '电话
  774.         CzxsGrid.TextMatrix(Rowjsq, Sydz("009", GridStr(), Szzls)) = Trim(.Fields("manageman") & "")           '负责人
  775.         CzxsGrid.TextMatrix(Rowjsq, Sydz("010", GridStr(), Szzls)) = IIf(.Fields("moneyration") = 0, "", .Fields("moneyration") & "")     '资金定额
  776.         CzxsGrid.TextMatrix(Rowjsq, Sydz("011", GridStr(), Szzls)) = Trim(.Fields("ishqgl") & "")              '是否货区管理
  777.     End With
  778.     '以上为自定义部分<<]
  779.     
  780. End Sub
  781. Private Sub Form_Unload(Cancel As Integer)             '窗体卸载
  782.     Set Cxnrrec = Nothing
  783.     Set Rec_CodeSet = Nothing
  784.     Unload Dyymctbl
  785.    
  786. End Sub
  787. Private Function Bclrsj() As Boolean                   '判断录入数据有效性,并保存数据
  788.     Dim jsqte As Integer
  789.   
  790.     '对文本框录入内容进行为零和为空判断(固定不变)
  791.     With Rec_CodeSet
  792.     
  793.         For jsqte = 0 To Max_Text_Index
  794.             If Textint(jsqte, 8) = 1 Then     '字段不能为空
  795.                 If Len(Trim(LrText(jsqte).Text)) = 0 Then
  796.                     If LrText(jsqte).Enabled Then
  797.                         Tsxx = Textstr(jsqte, 7) & "不能为空!"
  798.                         Call Xtxxts(Tsxx, 0, 1)
  799.                         LrText(jsqte).SetFocus
  800.                         Bclrsj = False
  801.                         Exit Function
  802.                     End If
  803.                 End If
  804.             Else
  805.                 If Textint(jsqte, 8) = 2 Then   '字段不能为零
  806.                     If Val(Trim(LrText(jsqte).Text)) = 0 Then
  807.                         Tsxx = Textstr(jsqte, 7) & "不能为零!"
  808.                         Call Xtxxts(Tsxx, 0, 1)
  809.                         LrText(jsqte).SetFocus
  810.                         Bclrsj = False
  811.                         Exit Function
  812.                     End If
  813.                 End If
  814.             End If
  815.         Next jsqte
  816.     
  817.         '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
  818.         For jsqte = 0 To Max_Text_Index
  819.             If Textint(jsqte, 9) = 0 Or Textint(jsqte, 9) = 2 Then
  820.                 If Not TextYxxpd(jsqte) Then
  821.                     Exit Function
  822.                 End If
  823.             End If
  824.         Next jsqte
  825.    
  826.         If Lrzt = 1 Then  '增 加
  827.         
  828.             '[>>判断编码是否重复
  829.             If .State = 1 Then .Close
  830.             .Open "SELECT * FROM Gy_Warehouse WHERE WhCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  831.     
  832.             If Not .EOF Then
  833.                 Tsxx = "仓库编码重复!"
  834.                 Call Xtxxts(Tsxx, 0, 1)
  835.                 LrText(0).SetFocus
  836.                 Bclrsj = False
  837.                 Exit Function
  838.             End If
  839.     
  840.             '判断名称是否重复
  841.             If .State = 1 Then .Close
  842.             .Open "SELECT * FROM Gy_Warehouse WHERE WhName= '" + Trim(LrText(1).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  843.     
  844.             If Not .EOF Then
  845.                 Tsxx = "仓库名称重复!"
  846.                 Call Xtxxts(Tsxx, 0, 1)
  847.                 LrText(1).SetFocus
  848.                 Bclrsj = False
  849.                 Exit Function
  850.             End If
  851.             '判断记录内容无误后,将记录内容写入数据表
  852.             On Error GoTo Swcwcl
  853.     
  854.             Cw_DataEnvi.DataConnect.BeginTrans
  855.    
  856.             .AddNew
  857.             .Fields("WhCode") = Trim(LrText(0).Text)             '仓库编码
  858.             .Fields("WhName") = Trim(LrText(1).Text)             '仓库名称
  859.             .Fields("Whprofix") = Trim(LrText(2).Text)           '仓库前缀
  860.             If Trim(LrText(3).Tag) <> "" Then
  861.                 .Fields("deptcode") = Trim(LrText(3).Tag)        '所属部门
  862.             Else
  863.                 .Fields("deptcode") = Null
  864.             End If
  865.             .Fields("whaddress") = Trim(LrText(4).Text)          '仓库地址
  866.             .Fields("manageman") = Trim(LrText(5).Text)          '负责人
  867.             .Fields("telephone") = Trim(LrText(6).Text)          '电话
  868.             .Fields("moneyration") = Val(LrText(7).Text)         '资金定额
  869.             .Fields("remark") = Trim(LrText(8).Text)             '备注
  870.             
  871.             .Fields("warehouseattribute") = Trim(Lrcomb(0).Text) '属性
  872.             .Fields("pricemode") = Trim(Lrcomb(1).Text)          '记价方式
  873.             
  874.             .Fields("chhsuseflag") = LrCheck(0).Value            '存货核算
  875.             .Fields("ishqgl") = LrCheck(1).Value                 '货区管理
  876.             .Fields("isrepertory") = LrCheck(2).Value            '储备预警
  877.             
  878.             .Update
  879.             
  880.             Cw_DataEnvi.DataConnect.CommitTrans
  881.             '将记录加入网格
  882.             Sqlstr = "SELECT * FROM Gy_V_Warehouse WHERE WhCode= '" + Trim(LrText(0).Text) + "'"
  883.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  884.    
  885.             With CzxsGrid
  886.                 .AddItem ""
  887.                 .RowHeight(.Rows - 1) = Sjhgd
  888.                 .Select .Rows - 1, Qslz
  889.                 Call Jltcwg(Cxnrrec, .Rows - 1)
  890.             End With
  891.             Tsxx = "保存完毕!"
  892.             Call Xtxxts(Tsxx, 0, 4)
  893.             
  894.             Call Cshlrxx(1)
  895.             LrText(0).SetFocus
  896.             '将网格按编码排序
  897.             With CzxsGrid
  898.                 .Col = Sydz("001", GridStr(), Szzls)
  899.                 CzxsGrid.Sort = flexSortStringAscending
  900.             End With
  901.             '<<]
  902.     
  903.         Else  '否则为修改记录
  904.  
  905.             If .State = 1 Then .Close
  906.             .Open "SELECT * FROM Gy_Warehouse WHERE WhName= '" + Trim(LrText(1).Text) + "' and WhCode<>'" & Trim(LrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  907.             If Not .EOF Then
  908.                 Tsxx = "仓库名称重复!"
  909.                 Call Xtxxts(Tsxx, 0, 1)
  910.                 LrText(1).SetFocus
  911.         
  912.                 Bclrsj = False
  913.                 Exit Function
  914.             End If
  915.             On Error GoTo Swcwcl
  916.             Cw_DataEnvi.DataConnect.BeginTrans
  917.             If .State = 1 Then .Close
  918.             .Open "SELECT * FROM Gy_Warehouse WHERE WhCode= '" + Trim(LrText(0).Text) + "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  919.      
  920.             If Not .EOF Then
  921.                 .Fields("WhName") = Trim(LrText(1).Text)             '仓库名称
  922.                 .Fields("Whprofix") = Trim(LrText(2).Text)           '仓库前缀
  923.                 If Trim(LrText(3).Tag) <> "" Then
  924.                     .Fields("deptcode") = Trim(LrText(3).Tag)        '所属部门
  925.                 Else
  926.                     .Fields("deptcode") = Null
  927.                 End If
  928.                 .Fields("whaddress") = Trim(LrText(4).Text)          '仓库地址
  929.                 .Fields("manageman") = Trim(LrText(5).Text)          '负责人
  930.                 .Fields("telephone") = Trim(LrText(6).Text)          '电话
  931.                 .Fields("moneyration") = Val(LrText(7).Text)         '资金定额
  932.                 .Fields("remark") = Trim(LrText(8).Text)             '备注
  933.                 
  934.                 .Fields("warehouseattribute") = Trim(Lrcomb(0).Text) '属性
  935.                 .Fields("pricemode") = Trim(Lrcomb(1).Text)          '记价方式
  936.                 
  937.                 .Fields("chhsuseflag") = LrCheck(0).Value            '存货核算
  938.                 .Fields("ishqgl") = LrCheck(1).Value                 '货区管理
  939.                 .Fields("isrepertory") = LrCheck(2).Value            '储备预警
  940.                 .Update
  941.             End If
  942.              Cw_DataEnvi.DataConnect.CommitTrans
  943.    
  944.             '刷新当前网格
  945.             Sqlstr = "SELECT * FROM Gy_V_Warehouse WHERE WhCode= '" + Trim(LrText(0).Text) + "'"
  946.             Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  947.    
  948.             With CzxsGrid
  949.                 Call Jltcwg(Cxnrrec, .Row)
  950.             End With
  951.    
  952.         End If
  953.      
  954.         '保存记录成功,函数返回真值
  955.         Bclrsj = True
  956.         Exit Function
  957.         
  958.     End With
  959.  
  960. Swcwcl:
  961.      Cw_DataEnvi.DataConnect.RollbackTrans
  962.      
  963.      Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
  964.      Call Xtxxts(Tsxx, 0, 1)
  965.      
  966.      Exit Function
  967.      
  968. End Function
  969. Private Function Cshlrxx(lrztxx As Integer) As Boolean              '初始化录入字段信息
  970.     TextChangeLock = True       '关闭文本框Chang事件
  971.     
  972.     LrText(2).Enabled = True
  973.     Lrcomb(0).Enabled = True
  974.     Lrcomb(1).Enabled = True
  975.     LrCheck(1).Enabled = True
  976.     lblMsg.Visible = False
  977.     
  978.     If lrztxx = 1 Then
  979.     
  980.         '增加新记录时将文本框清空
  981.         For jsqte = 0 To Max_Text_Index
  982.             If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  983.                 LrText(jsqte).Text = ""
  984.                 LrText(jsqte).Tag = ""
  985.             End If
  986.             TextValiJudgeLock(jsqte) = True
  987.         Next jsqte
  988.        
  989.         '[>>
  990.         Lrcomb(0).ListIndex = 0
  991.         Lrcomb(1).ListIndex = 0
  992.         LrCheck(0).Value = 0
  993.         LrCheck(1).Value = 0
  994.         LrCheck(2).Value = 0
  995.         
  996.         '在此处可添加新增记录时初始化设置
  997.         '<<]
  998.     Else
  999.     
  1000.         '修改记录时根据记录关键字(编码)从数据表中读入其他字段内容
  1001.         With RecTemp
  1002.             Sqlstr = "SELECT * FROM Gy_V_Warehouse Where WhCode='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) & "'"
  1003.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1004.        
  1005.             '记录如存在则读入其内容,否则提示记录已被其他人删除
  1006.             If Not RecTemp.EOF Then
  1007.                 LrText(0).Text = Trim(.Fields("WhCode") & "")              '仓库编码
  1008.                 LrText(1).Text = Trim(.Fields("WhName") & "")              '仓库名称
  1009.                 LrText(2).Text = Trim(.Fields("Whprofix") & "")            '仓库前缀
  1010.                 LrText(3).Tag = Trim(.Fields("deptcode") & "")             '所属部门
  1011.                 LrText(3).Text = Trim(.Fields("deptname") & "")            '所属部门
  1012.                 LrText(4).Text = Trim(.Fields("whaddress") & "")           '仓库地址
  1013.                 LrText(5).Text = Trim(.Fields("manageman") & "")           '负责人
  1014.                 LrText(6).Text = Trim(.Fields("telephone") & "")           '电话
  1015.                 LrText(7).Text = Trim(.Fields("moneyration") & "")         '资金定额
  1016.                 LrText(8).Text = Trim(.Fields("remark") & "")              '备注
  1017.                 
  1018.                 Lrcomb(0).Text = Trim(.Fields("warehouseattribute") & "")  '仓库属性
  1019.                 Lrcomb(1).Text = Trim(.Fields("pricemode") & "")           '计价方式
  1020.                 
  1021.                 If .Fields("chhsuseflag") Then                             '存货核算
  1022.                     LrCheck(0).Value = 1
  1023.                 Else
  1024.                     LrCheck(0).Value = 0
  1025.                 End If
  1026.                 If .Fields("ishqgl") Then                                  '货区管理
  1027.                     LrCheck(1).Value = 1
  1028.                 Else
  1029.                     LrCheck(1).Value = 0
  1030.                 End If
  1031.                 If .Fields("isrepertory") Then                             '储备预警
  1032.                     LrCheck(2).Value = 1
  1033.                 Else
  1034.                     LrCheck(2).Value = 0
  1035.                 End If
  1036. '****************************************************已使用仓库只能修改部分属性
  1037. '如果删除产生异常,说明记录已被引用
  1038. On Error GoTo ErrMsg
  1039.                 Cw_DataEnvi.DataConnect.BeginTrans
  1040.                 Cw_DataEnvi.DataConnect.Execute "delete Gy_warehouse where whcode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  1041.                 Cw_DataEnvi.DataConnect.RollbackTrans
  1042.                 Cshlrxx = True
  1043.                 TextChangeLock = False
  1044.                 Exit Function
  1045. ErrMsg:
  1046.                 Cw_DataEnvi.DataConnect.RollbackTrans
  1047.                 If Err.Number = -2147217873 Then                '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1048.                     
  1049.                     
  1050.                     LrText(2).Enabled = False
  1051.                     Lrcomb(0).Enabled = False
  1052.                     Lrcomb(1).Enabled = False
  1053.                     LrCheck(1).Enabled = False
  1054.                     lblMsg.Visible = True
  1055.                     
  1056.                     TextChangeLock = False
  1057.                     Cshlrxx = True
  1058.                     Exit Function
  1059.                 Else
  1060.                     Tsxx = "出现未知情况,请重新进入系统再试!"
  1061.                     Call Xtxxts(Tsxx, 0, 4)
  1062.                     Call Cancel
  1063.                     TextChangeLock = False
  1064.                     Exit Function
  1065.                 End If
  1066. '***************************************************
  1067.             Else
  1068.                 Tsxx = "该记录已经被其他人删除,请刷新当前数据!"
  1069.                 Call Xtxxts(Tsxx, 0, 4)
  1070.                 Call Cancel
  1071.                 TextChangeLock = False
  1072.                 Exit Function
  1073.             End If
  1074.         End With
  1075.     End If
  1076.     
  1077.     Cshlrxx = True
  1078.     TextChangeLock = False
  1079. End Function
  1080. Private Sub Scdqjl()                 '删 除 当 前 记 录
  1081.     Dim Yhanswer As Integer
  1082.     
  1083.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1084.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1085.         Exit Sub
  1086.     End If
  1087.     
  1088.     '非数据行不能删除
  1089.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1090.         Exit Sub
  1091.     End If
  1092.   
  1093.     '用户确认是否删除记录
  1094.     Tsxx = "请确认是否删除当前记录?"
  1095.     Yhanswer = Xtxxts(Tsxx, 2, 2)
  1096.     
  1097.     If Yhanswer = 2 Then
  1098.         Exit Sub
  1099.     End If
  1100.     On Error GoTo Cwcl
  1101.   
  1102.     Cw_DataEnvi.DataConnect.BeginTrans
  1103.     '[>>以下需自定义部分
  1104.     Cw_DataEnvi.DataConnect.Execute "delete Gy_Warehouse where WhCode = '" + Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("001", GridStr(), Szzls))) + "'"
  1105.     '以上为自定义部分<<]
  1106.   
  1107.     Cw_DataEnvi.DataConnect.CommitTrans
  1108.     CzxsGrid.RemoveItem CzxsGrid.Row
  1109.     Exit Sub
  1110.   
  1111. Cwcl:
  1112.     Cw_DataEnvi.DataConnect.RollbackTrans
  1113.     
  1114.     If Err.Number = -2147217873 Then                '(-2147217873 为SQL Server 2000通过建立外键产生的错误号)
  1115.         Tsxx = "此仓库已经被使用,不能删除!"
  1116.         Call Xtxxts(Tsxx, 0, 1)
  1117.         Exit Sub
  1118.     Else
  1119.         Tsxx = "出现未知情况,此仓库不能被删除!"
  1120.         Call Xtxxts(Tsxx, 0, 1)
  1121.         Exit Sub
  1122.     End If
  1123.     
  1124. End Sub
  1125. '*******************以下区域为编写自定义过程区域**********************
  1126. '*******************以上区域为编写自定义过程区域**********************
  1127. '******************以下为基本处理程序(固定不变)************************'
  1128. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)        '支持热键操作
  1129.     If Shift = 2 Then
  1130.         Select Case UCase(Chr(KeyCode))
  1131.             Case "P"                                                                          'Ctrl+P 打印
  1132.                 If SzToolbar.Buttons("dy").Visible And SzToolbar.Buttons("dy").Enabled Then
  1133.                     Call bbyl(False)
  1134.                 End If
  1135.             Case "A"                                                                          'Ctrl+A 增加
  1136.                 '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1137.                 If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1138.                     Exit Sub
  1139.                 End If
  1140.                 If SzToolbar.Buttons("zj").Visible And SzToolbar.Buttons("zj").Enabled Then
  1141.                     Call Toolbjzt
  1142.                     Lrzt = 1
  1143.                     Call Cshlrxx(Lrzt)
  1144.                     LrText(0).Enabled = True
  1145.                     LrText(0).SetFocus
  1146.                 End If
  1147.             Case "D"                                                                          'Ctrl+D 删除
  1148.                 If SzToolbar.Buttons("sc").Visible And SzToolbar.Buttons("sc").Enabled Then
  1149.                     Call Scdqjl
  1150.                 End If
  1151.         End Select
  1152.     End If
  1153.     
  1154. End Sub
  1155. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1156.    
  1157.     Select Case Button.Key
  1158.         Case "ymsz"                                          '页面设置
  1159.             Dyymctbl.Show 1
  1160.         Case "yl"                                            '预 览
  1161.             Call bbyl(True)
  1162.         Case "dy"                                            '打 印
  1163.             Call bbyl(False)
  1164.         Case "zj"                                            '增 加
  1165.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1166.             If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
  1167.                 Exit Sub
  1168.             End If
  1169.             Call Toolbjzt
  1170.             Lrzt = 1
  1171.             Call Cshlrxx(Lrzt)
  1172.             
  1173.             LrText(0).Enabled = True
  1174.             LrText(0).SetFocus
  1175.         Case "xg"                                            '修 改
  1176.             Call Xgdqjl
  1177.         Case "sc"                                            '删 除
  1178.             Call Scdqjl
  1179.         Case "Limit"                                         '权限
  1180.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1181.             If Not Security_Log("Gy_Warehouse_Power", Xtczybm, 1, True) Then
  1182.                 Exit Sub
  1183.             End If
  1184.             If CzxsGrid.Rows <= CzxsGrid.FixedRows Then
  1185.                 Tsxx = "没有仓库,不能设置仓库权限!"
  1186.                 Call Xtxxts(Tsxx, 0, 4)
  1187.             Else
  1188.                 RZ = CzxsGrid.Row
  1189.                 LZ = Sydz("001", GridStr(), Szzls)
  1190.                 
  1191.                 Gy_WarehousePower.Show 1
  1192.             End If
  1193.         Case "PersonLimit"                                   '操作员权限
  1194.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1195.             If Not Security_Log("Gy_Warehouse_PersonPower", Xtczybm, 1, True) Then
  1196.                 Exit Sub
  1197.             End If
  1198.             Gy_WarehousePersonPower.HelpContextID = 331200301
  1199.             Gy_WarehousePersonPower.Show 1
  1200.         Case "sx"                                            '刷 新
  1201.             Call Cxnrtcwg
  1202.         Case "bz"                                            '帮 助
  1203.             Call F1bz
  1204.         Case "fh"                                            '退 出
  1205.             Unload Me
  1206.         End Select
  1207.         
  1208. End Sub
  1209. Private Sub CzxsGrid_DblClick()                            '修改当前编码记录
  1210.     Call Xgdqjl
  1211.   
  1212. End Sub
  1213. Private Sub Xgdqjl()                                       '修改当前编码记录
  1214.     Dim bln_tmp As Boolean
  1215.     
  1216.     '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1217.     If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
  1218.         BcCommand.Enabled = False
  1219.     End If
  1220.     
  1221.     If CzxsGrid.Row < CzxsGrid.FixedRows Then
  1222.         Exit Sub
  1223.     End If
  1224.     
  1225.     Lrzt = 2
  1226.     bln_tmp = Cshlrxx(Lrzt)
  1227.     Call Toolbjzt
  1228.     If bln_tmp Then
  1229.         LrText(1).SetFocus
  1230.         LrText(0).Enabled = False
  1231.     End If
  1232. End Sub
  1233. Private Sub Toolbjzt()                                     'Toolbar状态(编辑状态)
  1234.     StTab.TabEnabled(1) = True
  1235.     StTab.Tab = 1
  1236.     Frame1.Enabled = True
  1237.     StTab.TabEnabled(0) = False
  1238.     CzxsGrid.Enabled = False
  1239.   
  1240.     With SzToolbar
  1241.         .Buttons("ymsz").Enabled = False
  1242.         .Buttons("dy").Enabled = False
  1243.         .Buttons("yl").Enabled = False
  1244.         .Buttons("zj").Enabled = False
  1245.         .Buttons("xg").Enabled = False
  1246.         .Buttons("sc").Enabled = False
  1247.         .Buttons("sx").Enabled = False
  1248.         .Buttons("Limit").Enabled = False
  1249.         .Buttons("PersonLimit").Enabled = False
  1250.         
  1251.     End With
  1252.   
  1253. End Sub
  1254. Private Sub Toolfbjzt()                                    'Toolbar状态(非编辑状态)
  1255.     StTab.TabEnabled(0) = True
  1256.     StTab.Tab = 0
  1257.     CzxsGrid.Enabled = True
  1258.     Frame1.Enabled = False
  1259.     StTab.TabEnabled(1) = False
  1260.     Lrzt = 0
  1261.     
  1262.     With SzToolbar
  1263.         .Buttons("ymsz").Enabled = True
  1264.         .Buttons("dy").Enabled = True
  1265.         .Buttons("yl").Enabled = True
  1266.         .Buttons("zj").Enabled = True
  1267.         .Buttons("xg").Enabled = True
  1268.         .Buttons("sc").Enabled = True
  1269.         .Buttons("sx").Enabled = True
  1270.         .Buttons("Limit").Enabled = True
  1271.         .Buttons("PersonLimit").Enabled = True
  1272.     End With
  1273.   
  1274. End Sub
  1275. Private Sub BcCommand_Click()                                           '保 存
  1276.     If Not Bclrsj Then
  1277.         Exit Sub
  1278.     End If
  1279.   
  1280.     If Lrzt = 2 Then
  1281.         Call Toolfbjzt
  1282.     End If
  1283.   
  1284. End Sub
  1285. Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)       '取消
  1286.   
  1287.     '避免执行Click程序
  1288.     Bln_Cancel = True
  1289.   
  1290.     Call Cancel
  1291.     
  1292. End Sub
  1293. Private Sub QxCommand_Click()                                                                         '取消
  1294.  
  1295.     If Bln_Cancel Then
  1296.         Bln_Cancel = False
  1297.         Exit Sub
  1298.     End If
  1299.  
  1300.     Call Cancel
  1301.     
  1302. End Sub
  1303. Private Sub Cancel()                                                                                  '取消
  1304.   
  1305.     '文本框加锁
  1306.     For jsqte = 0 To Max_Text_Index
  1307.         TextValiJudgeLock(jsqte) = True
  1308.     Next jsqte
  1309.   
  1310.     Call Toolfbjzt
  1311.     
  1312. End Sub
  1313. Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  1314.     
  1315.     FnBln_RefreshArray Col, Position, GridStr(), GridInf()
  1316. End Sub
  1317. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)   '表格格式设置(通用)
  1318.     
  1319.     Select Case Button.Key
  1320.         Case "bcgs"                                       '保存表格格式
  1321.             Call Bcwggs(CzxsGrid, GridCode, GridStr())
  1322.         Case "hfmrgs"                                     '恢复默认格式
  1323.             Call Hfmrgs(CzxsGrid, GridCode, GridStr())
  1324.         Case "szxsxm"                                     '设置显示项目
  1325.             Call Szxsxm(CzxsGrid, GridCode)
  1326.     End Select
  1327.     
  1328. End Sub
  1329. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1330.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1331.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1332.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1333.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1334.     ReDim Bbxbt(1 To Bbxbtgs)
  1335.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1336.     
  1337.     If Bbbwhgs <> 0 Then
  1338.         ReDim Bbbwh(1 To Bbbwhgs)
  1339.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1340.     End If
  1341.     
  1342.     Bbzbt = ReportTitle
  1343.     Bbxbt(1) = " "
  1344.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1345.     
  1346.     Call Scyxsjb(CzxsGrid)                               '生成报表数据
  1347.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1348.   
  1349.     If Not bbylte Then
  1350.         Unload DY_Tybbyldy
  1351.     End If
  1352.     
  1353. End Sub
  1354. '************以下为文本框录入处理程序(固定不变部分)*************'
  1355. Private Sub Wbklrwbcl(Index As Integer)    '文本框录入事后处理程序
  1356.     '以下为依据实际情况自定义部分[
  1357.   
  1358.         '在此填写文本框录入事后处理程序
  1359.    
  1360.     ']以上为依据实际情况自定义部分
  1361.     
  1362. End Sub
  1363. Private Sub LrText_Change(Index As Integer)
  1364.     '屏蔽程序改变控制
  1365.     If TextChangeLock Then
  1366.         Exit Sub
  1367.     End If
  1368.     
  1369.     TextValiJudgeLock(Index) = False    '打开有效性判断锁
  1370.     
  1371.     '限制字段录入长度
  1372.           
  1373.     TextChangeLock = True  '加锁(防止执行Lrtext_Change)
  1374.     Call TextChangeLimit(LrText(Index), Textint(Index, 1))  '去掉无效字符
  1375.     Select Case Textint(Index, 1)
  1376.         Case 8, 11      '金额型
  1377.             Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
  1378.         Case 9, 12      '数量型
  1379.             Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
  1380.         Case 10          '单价型
  1381.             Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
  1382.         Case Else        '其他小数类型控制
  1383.             If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
  1384.                 Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
  1385.             End If
  1386.     End Select
  1387.         
  1388.     TextChangeLock = False '解锁
  1389.     
  1390. End Sub
  1391. Private Sub LrText_GotFocus(Index As Integer)                                                 '文本框得到焦点,显示相应信息
  1392.    
  1393.     Call TextShow(Index)
  1394.     CurTextIndex = Index
  1395.     LrText(Index).SelStart = Len(LrText(Index))
  1396.    
  1397. End Sub
  1398. Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)            '字段按F2键提供帮助
  1399.    
  1400.     Select Case KeyCode
  1401.          Case vbKeyF2
  1402.              Call Text_Help(Index)
  1403.     End Select
  1404.    
  1405. End Sub
  1406. Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer)                            '文本框录入事中控制
  1407.    
  1408.     Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
  1409. End Sub
  1410. Private Sub LrText_LostFocus(Index As Integer)                                                '文本框失去焦点
  1411.     '显示相应信息但不能进行有效性判断
  1412.   
  1413. End Sub
  1414. Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)     '按钮提供帮助
  1415.     
  1416.     Call Text_Help(Index)
  1417.     
  1418. End Sub
  1419. Private Sub Text_Help(Index As Integer)                                                       '录入字段帮助
  1420.   
  1421.     If Not Textboolean(Index, 1) Then
  1422.         Exit Sub
  1423.     End If
  1424.    
  1425.     '调用帮助
  1426.     Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
  1427.   
  1428.     '根据设置选择显示编码和名称,并进行存储
  1429.     If Len(Xtfhcs) <> 0 Then
  1430.         If Textint(Index, 3) = 1 Then
  1431.             LrText(Index).Text = Xtfhcsfz
  1432.             LrText(Index).Tag = Xtfhcs
  1433.         Else
  1434.             LrText(Index).Text = Xtfhcs
  1435.             LrText(Index).Tag = Xtfhcsfz
  1436.         End If
  1437.     End If
  1438.    
  1439.     LrText(Index).SetFocus
  1440.     
  1441. End Sub
  1442. Private Sub TextShow(Index As Integer)        '文本框得到焦点,显示相应信息
  1443.     '填写文本框得到焦点,进行相应信息处理程序
  1444.    
  1445. End Sub
  1446. Private Sub Wbkcsh()                          '录入文本框初始化
  1447.     Dim jsqte As Integer
  1448.   
  1449.     '最大录入文本框索引值
  1450.     Max_Text_Index = Textvar(1)
  1451.   
  1452.     ReDim TextValiJudgeLock(Max_Text_Index)
  1453.     
  1454.     For jsqte = 0 To Max_Text_Index
  1455.      
  1456.         If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
  1457.             If Textboolean(jsqte, 1) Then
  1458.                 If jsqte <> 0 And Not Textboolean(jsqte, 3) Then
  1459.                     Load Ydcommand1(jsqte)
  1460.                 End If
  1461.                 Ydcommand1(jsqte).Visible = True
  1462.                 Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
  1463.             End If
  1464.             TextChangeLock = True
  1465.             LrText(jsqte).Text = ""
  1466.             LrText(jsqte).Tag = ""
  1467.             
  1468.             If Textint(jsqte, 5) <> 0 Then
  1469.                 LrText(jsqte).MaxLength = Textint(jsqte, 5)
  1470.             End If
  1471.             
  1472.             TextChangeLock = False
  1473.         End If
  1474.         
  1475.         TextValiJudgeLock(jsqte) = True
  1476.     Next jsqte
  1477.     
  1478. End Sub
  1479. Private Function TextYxxpd(Index As Integer) As Boolean           '文本框有效性判断
  1480.     Dim Sqlstr As String
  1481.     Dim Findrec As ADODB.Recordset
  1482.   
  1483.     '文本框内容未曾改变不进行有效性判断
  1484.     If TextValiJudgeLock(Index) Then
  1485.         TextYxxpd = True
  1486.         Exit Function
  1487.     End If
  1488.   
  1489.     '文本框内容为空认为有效,并清空其Tag值
  1490.     If Trim(LrText(Index)) = "" Then
  1491.         LrText(Index).Tag = ""
  1492.         Call Wbklrwbcl(Index)
  1493.         TextValiJudgeLock(Index) = True
  1494.         TextYxxpd = True
  1495.         Exit Function
  1496.     End If
  1497.   
  1498.     '可在此加入不做有效性判断的理由
  1499.   
  1500.     Select Case Textint(Index, 4)
  1501.         Case 1      '编码型
  1502.             Sqlstr = Trim(Textstr(Index, 5))
  1503.             Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
  1504.             Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  1505.          
  1506.             If Findrec.EOF Then
  1507.                 Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
  1508.                 LrText(Index).SetFocus
  1509.                 Exit Function
  1510.             Else
  1511.                 Select Case Textint(Index, 3)
  1512.                     Case 0
  1513.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1514.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1515.                         End If
  1516.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1517.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1518.                         End If
  1519.                     Case 1
  1520.                         If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
  1521.                             LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
  1522.                         End If
  1523.                         If Len(Trim(Textstr(Index, 2))) <> 0 Then
  1524.                             LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
  1525.                         End If
  1526.                 End Select
  1527.             End If
  1528.             
  1529.         Case 2      '日期型
  1530.             If IsDate(LrText(Index).Text) Then
  1531.                 LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
  1532.                 If Val(Mid(LrText(Index), 1, 4)) < 1900 Then
  1533.                     LrText(Index).Text = "1900" + Mid(LrText(Index), 5, 6)
  1534.                 End If
  1535.             Else
  1536.                 Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
  1537.                 Call Xtxxts(Tsxx, 0, 1)
  1538.                 LrText(Index).SetFocus
  1539.                 Exit Function
  1540.             End If
  1541.             
  1542.         Case 3      '其他类型
  1543.         
  1544.     End Select
  1545.     
  1546.     '如果有效则加锁,用户不改变内容则不再进行有效性判断
  1547.     TextValiJudgeLock(Index) = True
  1548.     '调用文本框事后处理程序
  1549.     Call Wbklrwbcl(Index)
  1550.    
  1551.     '有效性判断通过则返回True
  1552.     TextYxxpd = True
  1553.    
  1554. End Function