+
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:65k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{65A39231-6133-11D1-BAA2-444553540000}#1.0#0"; "VSLIGHT6.OCX"
- Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "tabctl32.ocx"
- Begin VB.Form Set_ArItemsFrm
- BorderStyle = 1 'Fixed Single
- Caption = "档案细节设置"
- ClientHeight = 6570
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 9735
- HelpContextID = 12006
- Icon = "设置_档案细节设置.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6570
- ScaleWidth = 9735
- StartUpPosition = 2 '屏幕中心
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 570
- Left = 0
- TabIndex = 10
- Top = 0
- Width = 9735
- _ExtentX = 17171
- _ExtentY = 1005
- ButtonWidth = 820
- ButtonHeight = 953
- AllowCustomize = 0 'False
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 13
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "设置"
- Key = "ymsz"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- ImageIndex = 2
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageIndex = 3
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "增加"
- Key = "zj"
- ImageIndex = 4
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "xg"
- ImageIndex = 5
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "sc"
- ImageIndex = 6
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "调整"
- Key = "FaceSet"
- ImageIndex = 13
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Object.Visible = 0 'False
- Caption = "刷新"
- Key = "sx"
- ImageIndex = 7
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageIndex = 8
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageIndex = 9
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.ImageList ImageList1
- Left = 5640
- Top = 120
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 13
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":1042
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":13DC
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":1776
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":1B10
- Key = "xz"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":1EAA
- Key = "xg"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":2244
- Key = "sc"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":25DE
- Key = "sx"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":2978
- Key = "bz"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":2D12
- Key = "tc"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":30AC
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":3446
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":37E0
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":3B7A
- Key = "gs"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 540
- Left = 7200
- TabIndex = 11
- Top = 0
- Width = 2505
- _ExtentX = 4419
- _ExtentY = 953
- ButtonWidth = 1455
- ButtonHeight = 953
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "保存格式"
- Key = "bcgs"
- ImageIndex = 10
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageIndex = 11
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageIndex = 12
- EndProperty
- EndProperty
- End
- End
- Begin MSComctlLib.TreeView Tree_List
- Height = 5745
- Left = 60
- TabIndex = 16
- Top = 750
- Width = 2625
- _ExtentX = 4630
- _ExtentY = 10134
- _Version = 393217
- Indentation = 661
- LabelEdit = 1
- LineStyle = 1
- Style = 7
- ImageList = "ImageList2"
- Appearance = 1
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin TabDlg.SSTab StTab
- Height = 5790
- Left = 2790
- TabIndex = 9
- Top = 720
- Width = 6885
- _ExtentX = 12144
- _ExtentY = 10213
- _Version = 393216
- Style = 1
- TabHeight = 520
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- TabCaption(0) = "列表视图"
- TabPicture(0) = "设置_档案细节设置.frx":3F14
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "Label1"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).Control(1)= "F_Sort"
- Tab(0).Control(1).Enabled= 0 'False
- Tab(0).Control(2)= "CzxsGrid"
- Tab(0).Control(2).Enabled= 0 'False
- Tab(0).ControlCount= 3
- TabCaption(1) = "单张视图"
- TabPicture(1) = "设置_档案细节设置.frx":3F30
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Frame1"
- Tab(1).ControlCount= 1
- TabCaption(2) = "界面设置"
- TabPicture(2) = "设置_档案细节设置.frx":3F4C
- Tab(2).ControlEnabled= 0 'False
- Tab(2).Control(0)= "Fra_face"
- Tab(2).ControlCount= 1
- Begin VB.Frame Fra_face
- Height = 5190
- Left = -74865
- TabIndex = 27
- Top = 450
- Width = 6585
- Begin VB.CommandButton Cmd_No
- Caption = "取消(&C)"
- Height = 300
- Left = 3600
- TabIndex = 32
- Top = 4680
- Width = 1100
- End
- Begin VB.CommandButton Cmd_Yes
- Caption = "保存(&S)"
- Height = 300
- Left = 2295
- TabIndex = 7
- Top = 4680
- Width = 1100
- End
- Begin VSFlex8Ctl.VSFlexGrid vsFlexGrid1
- Height = 3030
- Left = 270
- TabIndex = 31
- Top = 1395
- Width = 6045
- _ExtentX = 10663
- _ExtentY = 5345
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483636
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 50
- Cols = 10
- FixedRows = 1
- FixedCols = 1
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0 'False
- ShowComboButton = -1 'True
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- End
- Begin VB.TextBox Txt_DataLineH
- Height = 300
- Left = 4680
- TabIndex = 30
- Text = "Text2"
- Top = 675
- Visible = 0 'False
- Width = 1275
- End
- Begin VB.TextBox Txt_TitleH
- Height = 300
- Left = 1935
- TabIndex = 6
- Text = "Text1"
- Top = 630
- Width = 1275
- End
- Begin VB.Label lbl_datalineH
- Caption = "数据行高度:"
- Height = 255
- Left = 3600
- TabIndex = 29
- Top = 705
- Visible = 0 'False
- Width = 1095
- End
- Begin VB.Label lbl_titleH
- Caption = "标题行高度:"
- Height = 255
- Left = 855
- TabIndex = 28
- Top = 660
- Width = 1095
- End
- End
- Begin VB.Frame Frame1
- Height = 5360
- Left = -74910
- TabIndex = 13
- Top = 320
- Width = 6705
- Begin VB.ComboBox Cbo_ItmType
- Height = 300
- Left = 1575
- TabIndex = 1
- Top = 1110
- Width = 1900
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 1575
- TabIndex = 0
- Text = "Text1"
- Top = 720
- Width = 1900
- End
- Begin VB.ComboBox Cbo_Align
- Height = 300
- Left = 1575
- TabIndex = 4
- Top = 2295
- Width = 1900
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 1575
- TabIndex = 2
- Text = "1"
- Top = 1500
- Width = 1900
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 1575
- TabIndex = 3
- Text = "2"
- Top = 1905
- Width = 1900
- End
- Begin VB.CheckBox A_YNStop
- Caption = "停用"
- Height = 375
- Left = 5400
- TabIndex = 15
- Top = 548
- Visible = 0 'False
- Width = 1095
- End
- Begin VB.CommandButton Ydcommand1
- Height = 289
- Index = 0
- Left = 6225
- Picture = "设置_档案细节设置.frx":3F68
- Style = 1 'Graphical
- TabIndex = 14
- Top = 240
- Visible = 0 'False
- Width = 315
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 2355
- TabIndex = 8
- Top = 2865
- Width = 1120
- End
- Begin VB.CommandButton BcCommand
- Caption = "保存(&S)"
- Height = 300
- Left = 1125
- TabIndex = 5
- Top = 2865
- Width = 1120
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "项目类型:"
- Height = 180
- Index = 1
- Left = 540
- TabIndex = 26
- Top = 1170
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "项目名称:"
- Height = 180
- Index = 0
- Left = 540
- TabIndex = 25
- Top = 780
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "长度:"
- Height = 180
- Index = 2
- Left = 540
- TabIndex = 24
- Top = 1560
- Width = 450
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "小数位数:"
- Height = 180
- Index = 3
- Left = 540
- TabIndex = 23
- Top = 1965
- Width = 810
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "对齐方式:"
- Height = 180
- Index = 4
- Left = 540
- TabIndex = 22
- Top = 2355
- Width = 810
- End
- Begin VB.Label Lbl_Indicate
- Height = 465
- Left = 630
- TabIndex = 21
- Top = 3825
- Visible = 0 'False
- Width = 4425
- End
- Begin VB.Label F_Sort1
- BeginProperty Font
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 1575
- TabIndex = 20
- Top = 375
- Width = 1935
- End
- Begin VB.Label Label2
- Caption = "类别:"
- BeginProperty Font
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 540
- TabIndex = 19
- Top = 375
- Width = 855
- End
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 4755
- Left = 90
- TabIndex = 12
- Top = 930
- Width = 6705
- _ExtentX = 11827
- _ExtentY = 8387
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 0
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = 8421504
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 0
- SelectionMode = 0
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 5000
- Cols = 10
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 0
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = ""
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 0
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0 'False
- ShowComboButton = -1 'True
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- End
- Begin VB.Label F_Sort
- BeginProperty Font
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 720
- TabIndex = 18
- Top = 480
- Width = 2055
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "类别:"
- BeginProperty Font
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 180
- Left = 120
- TabIndex = 17
- Top = 517
- Width = 510
- End
- End
- Begin MSComctlLib.ImageList ImageList2
- Left = 0
- Top = 0
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 4
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":42F2
- Key = "xttb"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":4BCC
- Key = "gnqx"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":54A6
- Key = "stb"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "设置_档案细节设置.frx":64F8
- Key = "szk"
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "Set_ArItemsFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模块名称 :档案细节设置设置
- '* 功能描述 : 设置档案项目、界面的模块
- '* 程序员姓名 : 刘刚
- '* 最后修改人 : 刘刚
- '* 最后修改时间:2001/12/03
- '* 备 注:经过自己测试
- '*******************************************************
- Dim RecDigest As New ADODB.Recordset '常用摘要表
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Lrzt As Integer '录入状态标志(0-非录入状态 1-增加 2-修改)
- Dim ReportTitle As String '报表主标题
- Dim Str_RightEdit As String '编辑(新增、修改、删除)权限索引
- '以下为固定使用变量(网格)
- Dim Cxnrrec As New ADODB.Recordset '显示查询内容动态集
- Dim Dyymctbl As New DY_Dyymsz '打印页面窗体变量
- Dim GridCode As String '显示网格网格代码
- Dim GridInf() As Variant '整个网格设置信息
- Dim Tsxx As String '系统提示信息
- Dim Qslz As Long '网格隐藏(非操作显示)列数
- Dim Sjhgd As Double '网格数据行高度
- Dim GridBoolean() As Boolean '网格列信息(布尔型)
- Dim GridStr() As String '网格列信息(字符型)
- Dim GridInt() As Integer '网格列信息(整型)
- Dim Szzls As Integer '数组总列数(网格列数-1)
- '以下为固定使用变量(文本框)
- Dim Textvar() As Variant '存储变体型文本框信息
- Dim Textboolean() As Boolean '存储布尔型文本框信息
- Dim Textint() As Integer '存储整型文本框信息
- Dim Textstr() As String '存储字符型文本框信息
- Dim Max_Text_Index As Integer '最大录入文本框索引值
- Dim TextGroupCode As String '文本框录入分组编码
- Dim TextValiLock As Boolean '文本框失去焦点是否进行有效性控制判断
- Dim TextValiJudgeLock() As Boolean '文本框录入有效性判断控制锁
- Dim CurTextIndex As Integer '当前文本框索引值
- Dim TextChangeLock As Boolean '文本框内容变换控制锁
- '<<<<<<<<<<<<<<<<<<
- Dim nodX As Node
- Dim sortId As Integer
- Dim listId As Integer
- Private Sub Cmd_No_Click()
- '首先要把主表的网格重新刷新
- GridCode = "Rs_SetArItems"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- '设置网格的列属性不可移动
- sSql = "UPDATE Xt_Grid SET explorerbar=0 WHERE System_Code='Rs_User' AND ColIndex = '000' "
- Cw_DataEnvi.DataConnect.Execute (sSql)
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- Call Tree_List_Click
- Call Toolfbjzt
- With GsToolbar
- .Buttons("bcgs").Enabled = True
- .Buttons("hfmrgs").Enabled = True
- .Buttons("szxsxm").Enabled = True
- End With
- Fra_face.Enabled = False
- End Sub
- Private Sub Cmd_Yes_Click()
- If Not TxtDataPass(Txt_TitleH) Then Exit Sub
- Call Bcwggs_U(vsFlexGrid1, GridCode, GridStr())
- Call BzWgcsh(vsFlexGrid1, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- vsFlexGrid1.ColHidden(Sydz("001", GridStr(), Szzls)) = True
- vsFlexGrid1.ColHidden(Sydz("002", GridStr(), Szzls)) = True
- vsFlexGrid1.AddItem ""
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- jdzygs = 5
- Select Case KeyAscii
- Case vbKeyReturn
- If Kjjdzy(jdzygs) Then
- KeyAscii = 0
- End If
- Case 39 '屏蔽"'"
- KeyAscii = 0
- End Select
- End Sub
- Private Sub Form_Load()
- '定义可变部分变量
- ReportTitle = "档案项目"
- '调入打印页面设置窗体
- XtReportCode = "Rs_SetArItems"
- Load Dyymctbl
- '以下为文本框处理程序
- Add_Tree
- TextGroupCode = "Rs_SetArItems"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- '调 入 网 格
- GridCode = "Rs_SetArItems"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- ' Call Cxnrtcwg
- '初始化toolbar,tab卡状态
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- StTab.TabEnabled(2) = False
- Frame1.Enabled = False
- Lrzt = 0
- Call FillTypeCbo
- Call FillAlignCbo
- Lbl_Indicate.Caption = "1.明细编码最多可以录入3位数字,在同一类别中不得重复" + Chr(10) _
- & "2.明细名称最长可以录入30个汉字,在所有类别中不得重复"
- '编辑(新增、修改、删除)权限索引
- Str_RightEdit = "Rs_Set_ArItems_Edit"
- End Sub
- Private Sub Cxnrtcwg() '查 询 内 容 填 充 网 格
- Dim Sqlstr As String
- Dim jsqte As Long
- '查询连接串
- Sqlstr = "select * from Xt_Grid where FieldsName <> '' and FieldsName <> 'EmpNo' AND FieldsName<>'EmpName' AND Grid_Code = '" & F_Sort.Tag & "' ORDER BY ColIndex"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Cxnrrec
- CzxsGrid.Clear , flexClearData
- CzxsGrid.Rows = .RecordCount + CzxsGrid.FixedRows
- If .EOF And .BOF Then
- Exit Sub
- End If
- jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- ' If .Fields("FieldsName") <> "EmpNo" And .Fields("FieldsName") <> "EmpName" Then
- If jsqte >= CzxsGrid.Rows Then
- CzxsGrid.AddItem ""
- End If
- Call Jltcwg(Cxnrrec, jsqte)
- CzxsGrid.RowHeight(jsqte) = Sjhgd
- ' End If
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- Dim tmpStr As String
- '[以下为自定义部分
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, 0) = Trim(.Fields("FieldsName"))
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("ColTitle1"))
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = ConvertCode2Type(Trim(.Fields("Text_Data_Type")))
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "" & .Fields("Text_Length")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = "" & .Fields("Text_Deci_Length")
- CzxsGrid.TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = ConvertCode2Align("" & .Fields("ColAlignment"))
- End With
- '以上为自定义部分]
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- If Me.Height < 5000 Then Me.Height = 5000
- If Me.Width < 8805 Then Me.Width = 8805
- End Sub
- Private Sub Form_Unload(Cancel As Integer) '窗体卸载
- Set Cxnrrec = Nothing
- Unload Dyymctbl
- End Sub
- Private Function Bclrsj() As Boolean '判断录入数据有效性,并保存数据
- Dim jsqte As Integer
- Dim sSql As String
- Dim tLen As Integer '数字型总长度或是字符型总长度
- Dim dLen As Integer '小数位数
- Dim nulStr As String
- Dim nnulStr As String
- Dim FieldName As String
- Dim Colid As Integer
- Dim tmpRs As New ADODB.Recordset
- Bclrsj = False
- With RecDigest
- For jsqte = 0 To Max_Text_Index
- If Textint(jsqte, 8) = 1 Then '字段不能为空
- If Len(Trim(LrText(jsqte).Text)) = 0 Then
- Tsxx = Textstr(jsqte, 7) & "不能为空!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- Else
- If Textint(jsqte, 8) = 2 Then '字段不能为零
- If Val(Trim(LrText(jsqte).Text)) = 0 Then
- Tsxx = Textstr(jsqte, 7) & "不能为零!"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(jsqte).SetFocus
- Bclrsj = False
- Exit Function
- End If
- End If
- End If
- Next jsqte
- '对需要进行事后判断的文本框录入内容进行有效性判断 (固定不变)
- For jsqte = 0 To Max_Text_Index
- If Textboolean(jsqte, 2) Then
- If Not TextYxxpd(jsqte) Then
- Exit Function
- End If
- End If
- Next jsqte
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- On Error GoTo Swcwcl
- tLen = Val(Trim(LrText(1).Text))
- dLen = Val(Trim(LrText(2).Text))
- If GetDataType = -1 Then
- Call Xtxxts("请选择项目类型!", 0, 3)
- Exit Function
- End If
- If (GetDataType = 0) Then
- dLen = 0
- If tLen > 30 Then
- Call Xtxxts("字符型长度不能大于30!", 0, 1)
- dLen = 0
- Exit Function
- End If
- End If
- If (GetDataType = 5) And (tLen - dLen > 10) Then
- Call Xtxxts("数字型整数长度不能大于10!", 0, 1)
- Exit Function
- End If
- If (GetDataType = 5) And (dLen > tLen - 1) Then
- Call Xtxxts("数字型小数长度必须小于总长度!", 0, 1)
- Exit Function
- End If
- If (GetDataType = 5) And (dLen > 2) Then
- Call Xtxxts("数字型小数长度不能大于2!", 0, 1)
- Exit Function
- End If
- If (GetDataType = 7) Then tLen = 10: dLen = 0
- If Lrzt = 1 Then '增 加
- '------------------------------------------------
- sSql = "SELECT Col=MAX(ColIndex)+1 FROM Xt_Grid WHERE Grid_Code ='" & F_Sort.Tag & "'"
- Cw_DataEnvi.DataConnect.BeginTrans
- Set tmpRs = Cw_DataEnvi.DataConnect.Execute(sSql)
- If Not tmpRs.EOF Then
- Colid = Trim(tmpRs!Col)
- FieldName = Trim(F_Sort.Tag) & Format(Colid - 2, "000") 'Right("000" & (Colid - 2), 3) '去掉职工号,姓名两条记录
- End If
- sSql = "INSERT INTO Xt_Grid (System_Code,Grid_Code,ColId,ColIndex,ColTitle1,FieldsName,ColAlignment,Text_Data_Type,Text_Length,Text_Deci_Length,Edit_Flag,SelectRow_flag,AssistantRows) " + Chr$(10) _
- & "SELECT 'Rs_User','" & F_Sort.Tag & "','" & Colid & "','" & Format(Colid, "000") & "','" & Trim(LrText(0).Text) & "','" & FieldName & "','" & GetDataAlign & "','" & GetDataType & "','" & tLen & "','" & dLen & "','1','0','0'"
- Cw_DataEnvi.DataConnect.Execute sSql
- sSql = "ALTER TABLE Rs_ArMain ADD " & FieldName & " NVARCHAR(30) NULL"
- Cw_DataEnvi.DataConnect.Execute sSql
- Cw_DataEnvi.DataConnect.CommitTrans
- Sqlstr = "SELECT * FROM Xt_Grid WHERE FieldsName ='" & FieldName & "'"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With CzxsGrid
- .AddItem ""
- .RowHeight(.Rows - 1) = Sjhgd
- .Select .Rows - 1, Qslz
- Call Jltcwg(Cxnrrec, .Rows - 1)
- End With
- Cxnrrec.Close
- Call Cshlrxx(1)
- LrText(0).SetFocus
- '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- Else '修改
- sSql = "UPDATE Xt_Grid SET ColTitle1 ='" _
- & Trim(LrText(0).Text) & "',Text_Data_Type ='" & GetDataType & "'" _
- & ",Text_Length = '" & tLen & "', Text_Deci_Length = '" & dLen & "'" _
- & ",ColAlignment = '" & GetDataAlign & "' Where FieldsName = '" & CzxsGrid.TextMatrix(CzxsGrid.Row, 0) & "'"
- Cw_DataEnvi.DataConnect.Execute sSql
- Call Cxnrtcwg
- End If
- Bclrsj = True
- Call Xtxxts("保存成功!", 0, 4)
- Exit Function
- End With
- Swcwcl:
- Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
- If Err.Number = -2147217900 Then
- Tsxx = "明细编码不能重复"
- End If
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End Function
- Private Sub Cshlrxx(lrztxx As Integer) '初始化录入字段信息
- Dim tmpRs As New ADODB.Recordset
- Dim sSql As String
- If lrztxx = 1 Then
- For jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
- TextChangeLock = True
- LrText(jsqte).Text = ""
- LrText(jsqte).Tag = ""
- TextChangeLock = False
- End If
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- Else
- sSql = "SELECT * FROM Xt_Grid Where FieldsName ='" & Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, 0)) & "'"
- Set tmpRs = Cw_DataEnvi.DataConnect.Execute(sSql)
- If Not tmpRs.EOF Then
- LrText(0).Text = Trim(tmpRs.Fields("ColTitle1") & "") '项目名称
- LrText(1).Text = Trim(tmpRs.Fields("Text_Length") & "") '项目长度
- LrText(2).Text = Trim(tmpRs.Fields("Text_deci_Length")) '小数位数
- Call LocateTypeCbo(Trim(tmpRs.Fields("Text_Data_Type"))) '数据类型
- Call LocateAlignCbo(Trim(tmpRs.Fields("ColAlignment"))) '对齐方式
- End If
- Set tmpRs = Nothing
- End If
- End Sub
- Private Sub Scdqjl() '删 除 当 前 记 录
- Dim tmpStr As String
- Dim tmpRs As New ADODB.Recordset
- Dim Yhanswer As Integer
- Dim FieldName As String
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- On Error GoTo Cwcl
- FieldName = Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, 0))
- sSql = "SELECT count(" & FieldName & ") as NUM FROM Rs_ArMain WHERE " & FieldName & " IS NOT NULL AND (" & FieldName & " <> '') "
- Set tmpRs = Cw_DataEnvi.DataConnect.Execute(sSql)
- If tmpRs.Fields("num") > 0 Then
- Call Xtxxts("该类档案已经存入数据,欲删除该档案项目,请先到相关档案维护删除对应数据!", 0, 3)
- Exit Sub
- End If
- Tsxx = "请确认是否删除当前记录?"
- Yhanswer = Xtxxts(Tsxx, 2, 2)
- If Yhanswer = 2 Then
- Exit Sub
- End If
- Cw_DataEnvi.DataConnect.BeginTrans
- '[>>以下需自定义部分
- Cw_DataEnvi.DataConnect.Execute "DELETE Xt_Grid WHERE FieldsName = '" + FieldName + "'"
- Cw_DataEnvi.DataConnect.Execute "ALTER TABLE Rs_ArMain DROP COLUMN " + FieldName
- '以上为自定义部分<<]
- tmpRs.Close: Set tmpRs = Nothing
- Cw_DataEnvi.DataConnect.CommitTrans
- CzxsGrid.RemoveItem CzxsGrid.Row
- Exit Sub
- Cwcl:
- If Err.Number = -2147217900 Then
- Tsxx = "该项目已经被使用,不能删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- Else
- Tsxx = "出现未知情况,该项目不能被删除!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- End Sub
- '******************以下为基本处理程序(固定不变)************************'
- Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) '支持热键操作
- If Shift = 2 Then
- Select Case UCase(Chr(KeyCode))
- Case "P" 'Ctrl+P 打印
- Call bbyl(False)
- Case "I" 'Ctrl+I 增加
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- LrText(0).SetFocus
- LrText(0).Locked = False
- Case "D" 'Ctrl+D 删除
- Call Scdqjl
- End Select
- End If
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- If Button.Key <> "fh" And Button.Key <> "bz" Then
- If Trim(F_Sort.Tag) = "" Then Call Xtxxts("没有选定类别!", 0, 3): Exit Sub
- End If
- Select Case Button.Key
- Case "ymsz" '页面设置
- Dyymctbl.Show 1
- Case "yl" '预 览
- Call bbyl(True)
- Case "dy" '打 印
- Call bbyl(False)
- Case "zj" '增 加
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- Call Toolbjzt
- Lrzt = 1
- Call Cshlrxx(Lrzt)
- LrText(0).SetFocus
- LrText(0).Locked = False
- Case "xg" '修 改
- If CzxsGrid.Row < CzxsGrid.FixedRows Then Call Xtxxts("没有选定类别!", 0, 3): Exit Sub
- Call Xgdqjl
- Case "sc" '删 除
- Call Scdqjl
- Case "fq" '取 消
- Call Toolfbjzt
- Case "sx" '刷 新
- Call Cxnrtcwg
- Case "FaceSet" '界面设置
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
- Cmd_Yes.Enabled = False
- End If
- Call FaceSet
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- sSql = "UPDATE Xt_Grid SET explorerbar=0 WHERE System_Code='Rs_User' AND ColIndex = '000' "
- Cw_DataEnvi.DataConnect.Execute (sSql)
- Unload Me
- End Select
- End Sub
- Private Sub CzxsGrid_DblClick() '修改当前编码记录
- Call Xgdqjl
- End Sub
- Private Sub Xgdqjl() '修改当前编码记录
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
- BcCommand.Enabled = False
- End If
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- If Not CanModify Then Exit Sub
- Call Toolbjzt
- Lrzt = 2
- Call Cshlrxx(Lrzt)
- LrText(1).SetFocus
- ' LrText(0).Locked = True
- End Sub
- Private Sub Toolbjzt() 'Toolbar状态(编辑状态)
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True, False) Then
- BcCommand.Enabled = False
- End If
- StTab.TabEnabled(1) = True
- A_YNStop.Value = 0
- Tree_List.Enabled = False
- StTab.Tab = 1
- Frame1.Enabled = True
- StTab.TabEnabled(0) = False
- CzxsGrid.Enabled = False
- Fra_face.Enabled = False
- With SzToolbar
- .Buttons("ymsz").Enabled = False
- .Buttons("dy").Enabled = False
- .Buttons("yl").Enabled = False
- .Buttons("zj").Enabled = False
- .Buttons("xg").Enabled = False
- .Buttons("sc").Enabled = False
- .Buttons("sx").Enabled = False
- .Buttons("FaceSet").Enabled = False
- End With
- End Sub
- Private Sub Toolfbjzt() 'Toolbar状态(非编辑状态)
- StTab.TabEnabled(0) = True
- StTab.Tab = 0
- Tree_List.Enabled = True
- CzxsGrid.Enabled = True
- Frame1.Enabled = False
- StTab.TabEnabled(1) = False
- StTab.TabEnabled(2) = False
- Lrzt = 0
- With SzToolbar
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- .Buttons("zj").Enabled = True
- .Buttons("xg").Enabled = True
- .Buttons("sc").Enabled = True
- .Buttons("sx").Enabled = True
- .Buttons("FaceSet").Enabled = True
- End With
- End Sub
- Private Sub BcCommand_Click() '保 存
- If Not Bclrsj Then
- Exit Sub
- End If
- If Lrzt = 2 Then
- Call Toolfbjzt
- End If
- End Sub
- Private Sub QxCommand_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- For jsqte = 0 To Max_Text_Index
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- Call Toolfbjzt
- End Sub
- Private Sub CzxsGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- FnBln_RefreshArray Col, Position, GridStr(), GridInf()
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button) '表格格式设置(通用)
- Select Case Button.Key
- Case "bcgs" '保存表格格式
- Call Bcwggs(CzxsGrid, GridCode, GridStr())
- Case "hfmrgs" '恢复默认格式
- Call Hfmrgs(CzxsGrid, GridCode, GridStr())
- Case "szxsxm" '设置显示项目
- Call Szxsxm(CzxsGrid, GridCode)
- End Select
- End Sub
- Private Sub bbyl(bbylte As Boolean) '报表打印预览
- Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
- Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
- Bbxbtgs = 1 '报 表 小 标 题 行 数
- Bbbwhgs = 0 '报 表 表 尾 行 数
- ReDim Bbxbt(1 To Bbxbtgs)
- ReDim bbxbtzzxs(1 To Bbxbtgs)
- If Bbbwhgs <> 0 Then
- ReDim Bbbwh(1 To Bbbwhgs)
- ReDim Bbbwhzzxs(1 To Bbbwhgs)
- End If
- Bbzbt = ReportTitle
- Bbxbt(1) = " "
- bbxbtzzxs(1) = 0 '报表行组织形式(0-居左 1-居中 2-居右)
- Call Scyxsjb(CzxsGrid) '生成报表数据
- Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
- If Not bbylte Then
- Unload DY_Tybbyldy
- End If
- End Sub
- '************以下为文本框录入处理程序(固定不变部分)*************'
- Private Sub Wbklrwbcl(Index As Integer) '文本框录入事后处理程序
- '以下为依据实际情况自定义部分[
- '在此填写文本框录入事后处理程序
- ']以上为依据实际情况自定义部分
- End Sub
- Private Sub LrText_Change(Index As Integer)
- '屏蔽程序改变控制
- If TextChangeLock Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = False '打开有效性判断锁
- '限制字段录入长度
- TextChangeLock = True '加锁(防止执行Lrtext_Change)
- Select Case Textint(Index, 1)
- Case 8 '金额型
- Call Sjgskz(LrText(Index), Xtjezws - Xtjexsws - 1, Xtjexsws)
- Case 9 '数量型
- Call Sjgskz(LrText(Index), Xtslzws - Xtslxsws - 1, Xtslxsws)
- Case 10 '单价型
- Call Sjgskz(LrText(Index), Xtdjzws - Xtdjxsws - 1, Xtdjxsws)
- Case Else '其他小数类型控制
- If Textint(Index, 6) <> 0 Or Textint(Index, 7) <> 0 Then
- Call Sjgskz(LrText(Index), Textint(Index, 6), Textint(Index, 7))
- End If
- End Select
- TextChangeLock = False '解锁
- End Sub
- Private Sub LrText_GotFocus(Index As Integer) '文本框得到焦点,显示相应信息
- Call TextShow(Index)
- CurTextIndex = Index
- End Sub
- Private Sub LrText_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) '字段按F2键提供帮助
- Select Case KeyCode
- Case vbKeyF2
- Call Text_Help(Index)
- End Select
- End Sub
- Private Sub LrText_KeyPress(Index As Integer, KeyAscii As Integer) '文本框录入事中控制
- Call InputFieldLimit(LrText(Index), Textint(Index, 1), KeyAscii)
- End Sub
- Private Sub LrText_LostFocus(Index As Integer) '文本框失去焦点进行有效性判断及相应处理
- If Not Textboolean(Index, 2) Then '事中判断
- Call TextYxxpd(Index)
- End If
- End Sub
- Private Sub Tree_List_Click()
- If Mid(Trim(Tree_List.SelectedItem.Key), 2, Len(Trim(Tree_List.SelectedItem.Key)) - 1) <> "" Then
- F_Sort.Caption = Tree_List.SelectedItem.Text
- F_Sort1.Caption = F_Sort.Caption
- ReportTitle = "" & F_Sort.Caption
- F_Sort.Tag = Trim(Mid(Trim(Tree_List.SelectedItem.Key), 2, Len(Trim(Tree_List.SelectedItem.Key)) - 1))
- Cxnrtcwg
- End If
- End Sub
- Private Sub Txt_TitleH_KeyPress(KeyAscii As Integer)
- If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> vbKeyBack Then KeyAscii = 0
- If Len(Txt_TitleH.Text) >= 3 And KeyAscii <> vbKeyBack Then KeyAscii = 0
- End Sub
- Private Sub Ydcommand1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single) '按钮提供帮助
- Call Text_Help(Index)
- End Sub
- Private Sub Text_Help(Index As Integer) '录入字段帮助
- If Not Ydcommand1(Index).Visible Then
- Exit Sub
- End If
- TextValiJudgeLock(Index) = True
- '先进行有效性判断
- If Not TextYxxpd(CurTextIndex) Then
- Exit Sub
- End If
- Call Drbmhelp(Textint(Index, 2), Textstr(Index, 4), Trim(LrText(Index).Text))
- If Len(Xtfhcs) <> 0 Then
- If Textint(Index, 3) = 1 Then
- LrText(Index).Text = Xtfhcsfz
- LrText(Index).Tag = Xtfhcs
- Else
- LrText(Index).Text = Xtfhcs
- LrText(Index).Tag = Xtfhcsfz
- End If
- End If
- TextValiJudgeLock(Index) = False
- LrText(Index).SetFocus
- End Sub
- Private Sub TextShow(Index As Integer) '文本框得到焦点,显示相应信息
- '填写文本框得到焦点,进行相应信息处理程序
- End Sub
- Private Sub Wbkcsh() '录入文本框初始化
- Dim jsqte As Integer
- '最大录入文本框索引值
- Max_Text_Index = Textvar(1)
- ReDim TextValiJudgeLock(Max_Text_Index)
- For jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(jsqte, 1))) <> 0 Then
- If Textboolean(jsqte, 1) Then
- If jsqte <> 0 Then
- Load Ydcommand1(jsqte)
- End If
- Ydcommand1(jsqte).Visible = True
- Ydcommand1(jsqte).Move LrText(jsqte).Left + LrText(jsqte).Width, LrText(jsqte).Top
- End If
- TextChangeLock = True
- LrText(jsqte).Text = ""
- LrText(jsqte).Tag = ""
- If Textint(jsqte, 5) <> 0 Then
- LrText(jsqte).MaxLength = Textint(jsqte, 5)
- End If
- TextChangeLock = False
- End If
- TextValiJudgeLock(jsqte) = True
- Next jsqte
- End Sub
- Private Function TextYxxpd(Index As Integer) As Boolean '文本框有效性判断
- Dim Sqlstr As String
- Dim Findrec As ADODB.Recordset
- If TextValiJudgeLock(Index) Then '文本框内容未曾改变不进行有效性判断
- TextYxxpd = True
- Exit Function
- End If
- If Trim(LrText(Index)) = "" Then
- LrText(Index).Tag = ""
- Call Wbklrwbcl(Index)
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- Exit Function
- End If
- Select Case Textint(Index, 4)
- Case 1 '编码型
- Sqlstr = Trim(Textstr(Index, 5))
- Sqlstr = Replace(Sqlstr, "@", "'" + Trim(LrText(Index).Text) + "'")
- Set Findrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- If Findrec.EOF Then
- Call Xtxxts(Trim(Textstr(Index, 6)), 0, 1)
- LrText(Index).SetFocus
- Exit Function
- Else
- Select Case Textint(Index, 3)
- Case 0
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- Case 1
- If Len(Trim(Textstr(Index, 3) & "")) <> 0 Then
- LrText(Index).Text = Trim(Findrec.Fields(Trim(Textstr(Index, 3))))
- End If
- If Len(Trim(Textstr(Index, 2))) <> 0 Then
- LrText(Index).Tag = Trim(Findrec.Fields(Trim(Textstr(Index, 2))))
- End If
- End Select
- End If
- Case 2 '日期型
- If IsDate(LrText(Index).Text) Then
- LrText(Index).Text = Format(LrText(Index).Text, "yyyy-mm-dd")
- Else
- Tsxx = "非法公历日期!(格式:" + Format(Date, "yyyy-mm-dd") + ")"
- Call Xtxxts(Tsxx, 0, 1)
- LrText(Index).SetFocus
- Exit Function
- End If
- Case 3 '其他类型
- End Select
- TextValiJudgeLock(Index) = True
- TextYxxpd = True
- End Function
- Sub Add_Tree()
- Dim R_List As New Recordset
- Dim R_Sort As New Recordset
- Tree_List.Nodes.Add , 4, "T", "项目类别", "xttb"
- R_Sort.Open "select * from Rs_ArSort", Cw_DataEnvi.DataConnect, adOpenStatic, adLockOptimistic
- With R_Sort
- Do While Not .EOF
- 'If .Fields("mjbz") Then
- Set nodX = Tree_List.Nodes.Add("T", 4, "T" & Trim(.Fields("ArSort")), "" & Trim(.Fields("ArName")), "gnqx")
- nodX.EnsureVisible
- 'End If
- .MoveNext
- Loop
- End With
- End Sub
- '************************* 自定义函数部分*******************
- Private Function TxtDataPass(tt As TextBox) As Boolean
- TxtDataPass = False
- On Error GoTo Cwcl
- With tt
- If Trim(.Text) = "" Then Call Xtxxts("行高度不能为空!", 0, 1): Exit Function
- If Trim(.Text) = "-" Then Call Xtxxts("非法字符!", 0, 1): Exit Function
- If Val(Trim(.Text)) > 500 Then Call Xtxxts("行高度不能大于500!", 0, 1): Exit Function
- If Val(Trim(.Text)) <= 0 Then Call Xtxxts("行高度不能为0!", 0, 1): Exit Function
- End With
- TxtDataPass = True
- Exit Function
- Cwcl:
- Call Xtxxts("行高度设置不合理,请查看相关帮助!", 0, 1)
- End Function
- Private Function CanModify() As Boolean
- '判断选中的档案项目是否可以修改
- Dim sSql As String
- Dim FieldName As String
- Dim tmpRs As New ADODB.Recordset
- CanModify = False
- FieldName = Trim(CzxsGrid.TextMatrix(CzxsGrid.Row, 0))
- sSql = "SELECT count(" & FieldName & ") as NUM FROM Rs_ArMain WHERE " & FieldName & " IS NOT NULL AND (" & FieldName & " <> '') "
- Set tmpRs = Cw_DataEnvi.DataConnect.Execute(sSql)
- ' 如果该项目已经有数据,则不能修改
- If tmpRs.Fields("num") > 0 Then
- Call Xtxxts("该类档案已经存入数据,欲修改该档案项目,请先到相关档案维护删除对应数据!", 0, 3)
- Exit Function
- End If
- CanModify = True
- End Function
- Private Sub FaceSet()
- '界面设置,用于调整用户档案在录入时的界面
- Dim tmpRs As New ADODB.Recordset
- Dim sSql As String
- Tree_List.Enabled = False
- StTab.Tab = 2
- Frame1.Enabled = False
- Fra_face.Enabled = True
- ' 设置标签页的状态
- StTab.TabEnabled(0) = False
- StTab.TabEnabled(1) = False
- StTab.TabEnabled(2) = True
- CzxsGrid.Enabled = False
- ' 设置工具栏状态
- With SzToolbar
- .Buttons("ymsz").Enabled = False
- .Buttons("dy").Enabled = False
- .Buttons("yl").Enabled = False
- .Buttons("zj").Enabled = False
- .Buttons("xg").Enabled = False
- .Buttons("sc").Enabled = False
- .Buttons("sx").Enabled = False
- .Buttons("FaceSet").Enabled = False
- End With
- With GsToolbar
- .Buttons("bcgs").Enabled = False
- .Buttons("hfmrgs").Enabled = False
- .Buttons("szxsxm").Enabled = False
- End With
- '首先更新数据库,使得网格列可以移动
- sSql = "UPDATE Xt_Grid SET explorerbar=2 WHERE System_Code='Rs_User' AND ColIndex = '000' "
- Cw_DataEnvi.DataConnect.Execute (sSql)
- ' 刷新网格
- GridCode = Trim(F_Sort.Tag)
- Call BzWgcsh(vsFlexGrid1, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- ' 针对当前网格进行特殊设置
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- vsFlexGrid1.ColHidden(Sydz("001", GridStr(), Szzls)) = True
- vsFlexGrid1.ColHidden(Sydz("002", GridStr(), Szzls)) = True
- ' 改写网格的标题列可以移动
- sSql = "SELECT * FROM Xt_Grid WHERE Grid_code= '" & F_Sort.Tag & "' AND ColIndex = '000'"
- Set tmpRs = Cw_DataEnvi.DataConnect.Execute(sSql)
- If Not tmpRs.EOF Then
- Txt_TitleH.Text = tmpRs.Fields("FixRowHeight")
- ' Txt_DataLineH.Text = tmpRs.Fields("DataRowHeight")
- End If
- vsFlexGrid1.AddItem ""
- Txt_TitleH.SetFocus
- End Sub
- Private Sub vsFlexGrid1_BeforeMoveColumn(ByVal Col As Long, Position As Long) '网格列发生移动时自动交换网格索引信息
- Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
- End Sub
- Private Sub Bcwggs_U(Bcgsgrid As vsFlexGrid, Wggsdm As String, GridStr() As String) '保存网格格式(包括网格列宽,网格列顺序)
- '自定义网格格式保存函数,在系统统一的网格格式保存函数基础上增加了数据行高度的设置保存
- '过程参数:Bcgsgrid 保存格式网格对象,Wggsdm 网格格式代码(网格参数),GridStr() 从中取网格列索引信息
- Dim RecTemp As New ADODB.Recordset '临时使用动态集
- Dim Qslzte As Integer '起始列值
- Dim Tsxx As String '系统信息提示
- Dim sSql As String
- Cw_DataEnvi.DataConnect.BeginTrans
- On Error GoTo Swcwcl
- If RecTemp.State = 1 Then RecTemp.Close
- RecTemp.Open "select * from xt_grid where Grid_Code='" + Trim(Wggsdm) + "' order by ColId", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- With RecTemp
- If Not .EOF Then
- Qslzte = .Fields("BeginCol")
- .MoveNext
- End If
- Do While Not .EOF
- For jsqte = Qslzte To Bcgsgrid.Cols - 1
- If Trim(.Fields("ColIndex")) = Trim(GridStr(jsqte, 1)) Then
- Exit For
- End If
- Next jsqte
- If jsqte <= Bcgsgrid.Cols - 1 Then
- .Fields("ColId") = jsqte - Qslzte + 1
- .Fields("ColWidth") = Bcgsgrid.ColWidth(jsqte)
- .Update
- End If
- .MoveNext
- Loop
- End With
- sSql = "UPDATE Xt_grid SET FixRowHeight= '" & Trim(Txt_TitleH.Text) & "'" & Chr$(10) _
- & "WHERE Grid_Code='" & Trim(Wggsdm) & "'"
- Cw_DataEnvi.DataConnect.Execute sSql
- Cw_DataEnvi.DataConnect.CommitTrans
- Tsxx = "表格格式保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Exit Sub
- Swcwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans
- Tsxx = "存盘过程中出现未知错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End Sub
- Private Sub FillTypeCbo()
- '填充类型下拉框的过程
- Cbo_ItmType.AddItem ("字符型")
- Cbo_ItmType.AddItem ("数字型")
- Cbo_ItmType.AddItem ("日期型")
- End Sub
- Private Sub FillAlignCbo()
- '填充排列方式下拉框的过程
- Cbo_Align.AddItem ("居左")
- Cbo_Align.AddItem ("居右")
- End Sub
- Private Function GetDataType() As Integer
- '将下拉框的类型转变成系统统一的代号
- Select Case Cbo_ItmType.Text
- Case "字符型"
- GetDataType = 0
- Case "数字型"
- GetDataType = 5
- Case "日期型"
- GetDataType = 7
- Case Else
- GetDataType = -1
- End Select
- End Function
- Private Function GetDataAlign() As Integer
- '将下拉框的类型转变成系统统一的代号
- Select Case Cbo_Align.ListIndex
- Case 1
- GetDataAlign = 6
- Case Else '不选对齐方式 默认居左
- GetDataAlign = 0
- End Select
- End Function
- Private Function LocateTypeCbo(Code As Integer)
- '填充类型下拉框
- With Cbo_ItmType
- Select Case Code
- Case 0
- .Text = .List(0)
- Case 5
- .Text = .List(1)
- Case 7
- .Text = .List(2)
- Case Else
- End Select
- End With
- End Function
- Private Function LocateAlignCbo(Code As Integer)
- With Cbo_Align
- Select Case Code
- Case 0
- .Text = .List(0)
- Case 6
- .Text = .List(1)
- Case Else
- End Select
- End With
- End Function
- Private Function ConvertCode2Type(Code As Integer) As String
- '把数据表里存储的类型代号翻译过来
- With Cbo_ItmType
- Select Case Code
- Case 0
- ConvertCode2Type = "字符型"
- Case 5
- ConvertCode2Type = "数字型"
- Case 7
- ConvertCode2Type = "日期型"
- Case Else
- End Select
- End With
- End Function
- Private Function ConvertCode2Align(Code As Integer) As String
- '把数据表里存储的对其方式翻译过来
- With Cbo_ItmType
- Select Case Code
- Case 0
- ConvertCode2Align = "居左"
- Case 6
- ConvertCode2Align = "居右"
- Case Else
- End Select
- End With
- End Function