+
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:42k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.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 JC_FrmProSetup
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Dialog
- Caption = "产品毛利率设置"
- ClientHeight = 6015
- ClientLeft = 675
- ClientTop = 720
- ClientWidth = 8520
- Icon = "基础设置_产品毛利率设置.frx":0000
- KeyPreview = -1 'True
- LinkTopic = "Form4"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6015
- ScaleWidth = 8520
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin TabDlg.SSTab StTab
- Height = 5370
- Left = 0
- TabIndex = 6
- Top = 645
- Width = 8520
- _ExtentX = 15028
- _ExtentY = 9472
- _Version = 393216
- Style = 1
- Tabs = 2
- TabHeight = 520
- TabCaption(0) = "列表视图"
- TabPicture(0) = "基础设置_产品毛利率设置.frx":1042
- Tab(0).ControlEnabled= -1 'True
- Tab(0).Control(0)= "CzxsGrid"
- Tab(0).Control(0).Enabled= 0 'False
- Tab(0).ControlCount= 1
- TabCaption(1) = "单张视图"
- TabPicture(1) = "基础设置_产品毛利率设置.frx":105E
- Tab(1).ControlEnabled= 0 'False
- Tab(1).Control(0)= "Frame1"
- Tab(1).ControlCount= 1
- Begin VB.Frame Frame1
- Height = 4905
- Left = -74925
- TabIndex = 7
- Top = 360
- Width = 8385
- Begin VB.TextBox LrText
- Height = 300
- Index = 2
- Left = 2250
- TabIndex = 2
- Text = "2"
- Top = 1110
- Width = 2685
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 1
- Left = 2250
- TabIndex = 1
- Text = "1"
- Top = 720
- Width = 2685
- End
- Begin VB.CommandButton BcCommand
- Caption = "保存(&S)"
- Height = 300
- Left = 1725
- TabIndex = 3
- Top = 1695
- Width = 1120
- End
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 2925
- TabIndex = 4
- Top = 1695
- Width = 1120
- End
- Begin VB.CommandButton Ydcommand1
- Height = 300
- Index = 0
- Left = 5820
- Picture = "基础设置_产品毛利率设置.frx":107A
- Style = 1 'Graphical
- TabIndex = 8
- Top = 435
- Visible = 0 'False
- Width = 300
- End
- Begin VB.TextBox LrText
- Height = 300
- Index = 0
- Left = 2250
- TabIndex = 0
- Text = "0"
- Top = 330
- Width = 2685
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "销售成本明细科目:"
- Height = 180
- Index = 2
- Left = 660
- TabIndex = 12
- Top = 1155
- Width = 1530
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "销售收入明细科目:"
- Height = 180
- Index = 0
- Left = 660
- TabIndex = 11
- Top = 765
- Width = 1530
- End
- Begin VB.Label TsLabel
- AutoSize = -1 'True
- Caption = "产品名称:"
- Height = 180
- Index = 1
- Left = 1350
- TabIndex = 9
- Top = 390
- Width = 810
- End
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 4950
- Left = 75
- TabIndex = 10
- Top = 360
- Width = 8370
- _cx = 5080
- _cy = 5080
- 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
- AutoSearchDelay = 2
- 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
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- End
- End
- Begin MSComctlLib.Toolbar SzToolbar
- Align = 1 'Align Top
- Height = 555
- Left = 0
- TabIndex = 13
- Top = 0
- Width = 8520
- _ExtentX = 15028
- _ExtentY = 979
- ButtonWidth = 820
- ButtonHeight = 926
- 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"
- ImageKey = "sz"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "打印"
- Key = "dy"
- ImageKey = "dy"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "预览"
- Key = "yl"
- ImageKey = "yl"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "增加"
- Key = "zj"
- ImageKey = "xz"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "xg"
- ImageKey = "xg"
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "sc"
- ImageKey = "sc"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "刷新"
- Key = "sx"
- ImageKey = "sx"
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Object.Visible = 0 'False
- Caption = "放弃"
- Key = "fq"
- ImageKey = "fq"
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "帮助"
- Key = "bz"
- ImageKey = "bz"
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "退出"
- Key = "fh"
- ImageKey = "tc"
- EndProperty
- EndProperty
- BorderStyle = 1
- Begin MSComctlLib.ImageList ImageList1
- Left = 5235
- Top = -45
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 29
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":1404
- Key = "sz"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":179E
- Key = "dy"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":1B38
- Key = "yl"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":1ED2
- Key = "xg"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":226C
- Key = "zh"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":2606
- Key = "sh"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":29A0
- Key = "bc"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":2D3A
- Key = "fq"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":30D4
- Key = "bz"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":346E
- Key = "tc"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":3808
- Key = "bcgs"
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":3BA2
- Key = "mrlk"
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":3F3C
- Key = "xsxm"
- EndProperty
- BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":42D6
- Key = "first"
- EndProperty
- BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":4670
- Key = "prev"
- EndProperty
- BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":4A0A
- Key = "next"
- EndProperty
- BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":4DA4
- Key = "last"
- EndProperty
- BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":513E
- Key = "xx"
- EndProperty
- BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":54D8
- Key = "define"
- EndProperty
- BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":5872
- Key = "exec"
- EndProperty
- BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":5C0C
- Key = "xz"
- EndProperty
- BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":5FA6
- Key = "sc"
- EndProperty
- BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":6340
- Key = "sx"
- EndProperty
- BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":66DA
- Key = "cx"
- EndProperty
- BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":6A74
- Key = "zd"
- EndProperty
- BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":6E0E
- Key = "dz"
- EndProperty
- BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":71A8
- Key = "ph"
- EndProperty
- BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":7542
- Key = "fz"
- EndProperty
- BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "基础设置_产品毛利率设置.frx":78DC
- Key = "dw"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar GsToolbar
- Height = 525
- Left = 6795
- TabIndex = 14
- Top = 0
- Width = 2475
- _ExtentX = 4366
- _ExtentY = 926
- ButtonWidth = 1455
- ButtonHeight = 926
- AllowCustomize = 0 'False
- 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"
- ImageKey = "bcgs"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "默认列宽"
- Key = "hfmrgs"
- ImageKey = "mrlk"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "显示项目"
- Key = "szxsxm"
- ImageKey = "xsxm"
- EndProperty
- EndProperty
- End
- End
- Begin VB.Label Lab_OperStatus
- BackColor = &H000080FF&
- Caption = "1"
- Height = 345
- Left = 9240
- TabIndex = 5
- Top = 840
- Visible = 0 'False
- Width = 345
- End
- End
- Attribute VB_Name = "JC_FrmProSetup"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*******************************************************
- '* 模 块 名 称 :基础设置-产品毛利率设置
- '* 功 能 描 述 :设置产品毛利率设置
- '* 程序员姓名 :魏永生
- '* 最后修改人 :
- '* 最后修改时间:2002/1/21
- '* 备 注:
- '*******************************************************
- Option Explicit
- Dim ReportTitle As String
- Dim Str_RightEdit As String '编辑(新增、修改、删除)权限索引
- Dim Int_CodeScheme() As Integer '会计科目编码方案
- Dim Int_CodeLev As Integer '会计科目编码级次
- Dim jdzygs As Integer '控件焦点转移个数
- Dim Lrzt As Integer '录入状态标志(0-非录入状态 1-增加 2-修改)
- '以下为固定使用变量(文本框)
- 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 Bln_Cancel As Boolean '取消按钮信息传递
- '以下为固定使用变量(网格)
- 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 ChangeCol As Long '交换前数据列值
- Private Sub Form_KeyPress(KeyAscii As Integer) '控 制 焦 点 转 移
- If DEBUG_FLAG = False Then On Error Resume Next
- 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()
- If DEBUG_FLAG = False Then On Error Resume Next
- '调入打印页面设置窗体
- XtReportCode = "cwfx_ProSetup"
- ReportTitle = "产品毛利率设置"
- Load Dyymctbl
- '以下为文本框处理程序
- TextGroupCode = "cwfx_ProSetup"
- Call Drwbkxx(TextGroupCode, Textvar(), Textboolean(), Textint(), Textstr()) '读入文本框录入信息
- Call Wbkcsh
- '调 入 网 格
- GridCode = "cwfx_ProSetup"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- Call Cxnrtcwg
- StTab.Tab = 0
- StTab.TabEnabled(1) = False
- Frame1.Enabled = False
- Lrzt = 0
- '编辑(新增、修改、删除)权限索引
- Str_RightEdit = "cwfx_Pro_Edit"
- End Sub
- Private Sub Cxnrtcwg() '查 询 内 容 填 充 网 格
- If DEBUG_FLAG = False Then On Error Resume Next
- Dim SqlStr As String
- Dim Jsqte As Long
- '查询连接串
- SqlStr = "SELECT * FROM cwfx_ProductGrossProfitSet "
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- With Cxnrrec
- If .EOF And .BOF Then
- Exit Sub
- End If
- CzxsGrid.Clear 1
- CzxsGrid.Rows = .RecordCount + CzxsGrid.FixedRows
- .MoveLast
- .MoveFirst
- Jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- If Jsqte >= CzxsGrid.Rows Then
- CzxsGrid.AddItem ""
- End If
- Call Jltcwg(Cxnrrec, Jsqte)
- CzxsGrid.RowHeight(Jsqte) = Sjhgd
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- TextChangeLock = False
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- If DEBUG_FLAG = False Then On Error Resume Next
- '[以下为自定义部分
- With CzxsGrid
- .TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = Trim(Jlbrec.Fields("Name"))
- .TextMatrix(Rowjsq, Sydz("004", GridStr(), Szzls)) = Trim(Jlbrec.Fields("IncomeCode"))
- .TextMatrix(Rowjsq, Sydz("005", GridStr(), Szzls)) = Trim(Jlbrec.Fields("CostCode"))
- End With
- '以上为自定义部分]
- End Sub
- Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- If DEBUG_FLAG = False Then On Error Resume Next
- 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" '修 改
- Call Xgdqjl
- Case "sc" '删 除
- Call Scdqjl
- Case "fq" '取 消
- Call Toolfbjzt
- Case "sx" '刷 新
- Call Cxnrtcwg
- Case "bz" '帮 助
- Call F1bz
- Case "fh" '退 出
- Unload Me
- End Select
- End Sub
- Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
- If DEBUG_FLAG = False Then On Error Resume Next
- '表格格式设置(通用)
- 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 CzxsGrid_DblClick() '修改当前编码记录
- Call Xgdqjl
- End Sub
- Private Function Bclrsj() As Boolean '判断录入数据有效性,并保存数据
- If DEBUG_FLAG = False Then On Error Resume Next
- Dim Jsqte As Integer
- Dim SqlStr As String
- 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 Textint(Jsqte, 9) = 0 Or Textint(Jsqte, 9) = 2 Then
- If Not TextYxxpd(Jsqte) Then
- Exit Function
- End If
- End If
- Next Jsqte
- If Lrzt = 1 Then '增 加
- With Cxnrrec
- If .State = 1 Then .Close
- .Open "SELECT * FROM cwfx_ProductGrossProfitSet WHERE Name='" & Trim(lrText(0).Text) & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If .EOF And .BOF Then
- .AddNew
- !Name = lrText(0).Text
- !InComeCode = lrText(1).Tag
- !costCode = lrText(2).Tag
- .Update
- Else
- Tsxx = "名称不能重复 !"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End If
- End With
- Tsxx = "保存完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Call Cshlrxx(1)
- Else 'lrzt =2 修改
- With Cxnrrec
- If .State = 1 Then .Close
- .Open "SELECT * FROM cwfx_ProductGrossProfitSet WHERE Name='" & lrText(0).Text & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not (.EOF And .BOF) Then
- !InComeCode = lrText(1).Tag
- !costCode = lrText(2).Tag
- .Update
- End If
- End With
- Call Toolfbjzt
- End If
- Call Cxnrtcwg
- SqlStr = "SELECT * FROM cwfx_ProductGrossProfitSet"
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(SqlStr)
- Exit Function
- Swcwcl:
- Tsxx = "存盘过程中出现错误,程序自动恢复保存前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Function
- End Function
- Private Sub BcCommand_Click() '保 存
- If DEBUG_FLAG = False Then On Error Resume Next
- If Not Bclrsj Then
- Exit Sub
- End If
- If Lrzt = 2 Then
- Call Toolfbjzt
- End If
- lrText(0).Enabled = True
- End Sub
- Private Sub QxCommand_Click() '取消
- If DEBUG_FLAG = False Then On Error Resume Next
- If Bln_Cancel Then
- Bln_Cancel = False
- Exit Sub
- End If
- Call Cancel
- lrText(0).Enabled = True
- End Sub
- Private Sub Cancel() '取消
- If DEBUG_FLAG = False Then On Error Resume Next
- '文本框加锁
- Dim Jsqte
- For Jsqte = 0 To Max_Text_Index
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- Call Toolfbjzt
- End Sub
- Private Sub Scdqjl() '删 除 当 前 记 录
- Dim yhAnswer As Integer
- '判断用户是否有此功能执行权限,如有则写上机日志(进入)
- If Not Security_Log(Str_RightEdit, Xtczybm, 1, True) Then
- Exit Sub
- End If
- If CzxsGrid.Row < CzxsGrid.FixedRows Then
- Exit Sub
- End If
- Tsxx = "请确认是否删除当前记录?"
- yhAnswer = Xtxxts(Tsxx, 2, 2)
- If yhAnswer = 2 Then
- Exit Sub
- End If
- On Error GoTo Cwcl
- '[以下需自定义部分
- Dim temRs As New ADODB.Recordset
- Set temRs = Cw_DataEnvi.DataConnect.Execute("delete from cwfx_ProductGrossProfitSet where Name='" & CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls)) & "'")
- '以上为自定义部分]
- 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 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
- Call Toolbjzt
- Lrzt = 2
- Call Cshlrxx(Lrzt)
- End Sub
- Private Function Cshlrxx(lrztxx As Integer) As Boolean '初始化录入字段信息
- If DEBUG_FLAG = False Then On Error Resume Next
- Dim Jsqte
- Dim SqlStr As String
- TextChangeLock = True '关闭Chang事件
- If lrztxx = 1 Then '新增
- For Jsqte = 0 To Max_Text_Index
- If Len(Trim(Textstr(Jsqte, 1))) <> 0 Then
- lrText(Jsqte).Text = ""
- lrText(Jsqte).Tag = ""
- End If
- TextValiJudgeLock(Jsqte) = True
- Next Jsqte
- Else 'lrztxx=2 修改
- Dim strName As String
- Dim temRs As New ADODB.Recordset
- strName = CzxsGrid.TextMatrix(CzxsGrid.Row, Sydz("003", GridStr(), Szzls))
- lrText(0).Enabled = False
- lrText(0).Locked = True
- With temRs
- If .State = adStateOpen Then .Close
- SqlStr = "SELECT * FROM cwfx_ProductGrossProfitSet WHERE Name='" & strName & "'"
- temRs.Open SqlStr, Cw_DataEnvi.DataConnect
- If Not (.EOF And .BOF) Then
- lrText(0).Text = Trim(!Name)
- lrText(1).Text = Trim(!InComeCode)
- lrText(1).Tag = Trim(!InComeCode)
- lrText(2).Text = Trim(!costCode)
- lrText(2).Tag = Trim(!costCode)
- Else
- Tsxx = "记录已被删除!"
- Call Xtxxts(Tsxx, 0, 1)
- End If
- temRs.Close
- Set temRs = Nothing
- End With
- End If
- TextChangeLock = False
- End Function
- Private Sub Toolbjzt() 'Toolbar状态(编辑状态)
- StTab.TabEnabled(1) = True
- StTab.Tab = 1
- Frame1.Enabled = True
- StTab.TabEnabled(0) = False
- 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
- End With
- End Sub
- Private Sub Toolfbjzt() 'Toolbar状态(非编辑状态)
- StTab.TabEnabled(0) = True
- StTab.Tab = 0
- CzxsGrid.Enabled = True
- Frame1.Enabled = False
- StTab.TabEnabled(1) = False
- Lrzt = 0
- With SzToolbar
- .Buttons("xg").Enabled = True
- .Buttons("sc").Enabled = True
- .Buttons("zj").Enabled = True
- .Buttons("ymsz").Enabled = True
- .Buttons("dy").Enabled = True
- .Buttons("yl").Enabled = True
- End With
- 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)
- '----------固定不变部分变量声明开始--------------------
- Dim Jsqte
- Dim Int_CodeLev
- Dim CodeLev
- Dim Str_Parent
- Dim RecTemp As New ADODB.Recordset
- '----------固定不变部分变量声明结束-------------------
- '屏蔽程序改变控制
- 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
- lrText(Index).SelStart = Len(lrText(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 Textint(Index, 9) = 0 Or Textint(Index, 9) = 1 Then '事中判断
- Call TextYxxpd(Index)
- End If
- 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 Textboolean(Index, 1) 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).Tag = Xtfhcsfz
- lrText(Index).Text = Xtfhcs
- Else
- lrText(Index).Tag = Xtfhcs
- lrText(Index).Text = 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 And Not Textboolean(Jsqte, 3) 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 Tsxx As String
- '---------------------------------
- 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