资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:16k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
- Begin VB.Form frm_report_manage
- BorderStyle = 1 'Fixed Single
- Caption = "报表管理"
- ClientHeight = 6360
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 10335
- HelpContextID = 1015002
- Icon = "报表管理.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6360
- ScaleWidth = 10335
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton Command3
- Caption = "清理(&L)"
- Height = 300
- Left = 7980
- TabIndex = 4
- Top = 5955
- Width = 1120
- End
- Begin VB.CommandButton Command2
- Cancel = -1 'True
- Caption = "返回(&R)"
- Height = 300
- Left = 9150
- TabIndex = 3
- Top = 5955
- Width = 1120
- End
- Begin VB.CommandButton Command1
- Caption = "删除(&D)"
- Height = 300
- Left = 6810
- TabIndex = 2
- Top = 5955
- Width = 1120
- End
- Begin VSFlex8Ctl.VSFlexGrid vsFlexGrid2
- Height = 5505
- Left = 4980
- TabIndex = 1
- Top = 300
- Width = 5280
- _ExtentX = 9313
- _ExtentY = 9710
- 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 = 2
- 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 VSFlex8Ctl.VSFlexGrid vsFlexGrid1
- Height = 5505
- Left = 90
- TabIndex = 0
- Top = 300
- Width = 4875
- _ExtentX = 8599
- _ExtentY = 9710
- 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.Label Label2
- Height = 195
- Left = 4980
- TabIndex = 6
- Top = 60
- Width = 4575
- End
- Begin VB.Label Label1
- Caption = "报表模板列表"
- Height = 195
- Left = 120
- TabIndex = 5
- Top = 60
- Width = 3975
- End
- End
- Attribute VB_Name = "frm_report_manage"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '***********************************************
- '* 模 块 名 称 :报表管理
- '* 功 能 描 述 :
- '* 程序员姓名 :奚俊峰
- '* 最后修改人 :奚俊峰
- '* 最后修改时间:2002/01/21
- '***********************************************
- Option Explicit
- Dim wgdmtemp As String
- Dim Qslz As Long
- Dim Sjhgd As Double
- Dim Szzls As Integer
- Dim wgszxx() As Variant '整个网格设置信息
- Dim wglxx() As String '网格列其他信息
- Dim Wblrxz() As Integer '文本框录入(事中)限制
- Dim Wbbjsx() As Boolean '(1-锁定某列使其不可编辑 2-是否提供帮助 3-是否列表框录入 4-字段不能为空控制)
- Dim wgdmtemp_bb As String
- Dim qslz_bb As Long
- Dim Sjhgd_bb As Double
- Dim Szzls_bb As Integer
- Dim wgszxx_bb() As Variant '整个网格设置信息
- Dim wglxx_bb() As String '网格列其他信息
- Dim Wblrxz_bb() As Integer '文本框录入(事中)限制
- Dim Wbbjsx_bb() As Boolean '(1-锁定某列使其不可编辑 2-是否提供帮助 3-是否列表框录入 4-字段不能为空控制)
- Private Sub Cxnrtcwg_bb()
- Dim Sqlstr As String
- Dim jsqte As Long
- Dim Cxnrrec As ADODB.Recordset
- '查询连接串
- vsFlexGrid2.Clear , flexClearData
- vsFlexGrid2.Rows = 1
- If vsFlexGrid1.Rows <= 1 Then
- Exit Sub
- End If
- Sqlstr = "select report_time,user_id,update_time,update_id from dzbb_bb where system_code='" _
- & Left(ls_xtbm, 2) & "' and report_model_id='" _
- & Trim(vsFlexGrid1.TextMatrix(1, Sydz("001", wglxx(), Szzls))) _
- & "' order by system_code,report_model_id,report_time DESC"
- Set Cxnrrec = Cw_DataEnvi.dataconnect.Execute(Sqlstr)
- With Cxnrrec
- If .EOF And .BOF Then
- vsFlexGrid2.Clear , flexClearData
- vsFlexGrid2.Rows = vsFlexGrid1.FixedRows
- vsFlexGrid2.Redraw = True
- vsFlexGrid1.Select 1, 0
- Exit Sub
- Else
- vsFlexGrid2.Redraw = False
- vsFlexGrid2.Rows = .RecordCount + vsFlexGrid2.FixedRows
- End If
- jsqte = vsFlexGrid2.FixedRows
- Do While Not .EOF
- If jsqte >= vsFlexGrid2.Rows Then
- vsFlexGrid2.AddItem ""
- End If
- Call Jltcwg_bb(Cxnrrec, jsqte)
- vsFlexGrid2.RowHeight(jsqte) = Sjhgd
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- vsFlexGrid2.Redraw = True
- vsFlexGrid1.Select 1, 0
- Set Cxnrrec = Nothing
- End Sub
- Private Sub Cxnrtcwg()
- Dim Sqlstr As String
- Dim jsqte As Long
- Dim Cxnrrec As ADODB.Recordset
- '查询连接串
- vsFlexGrid1.Clear , flexClearData
- vsFlexGrid1.Rows = 1
- Sqlstr = "select report_model_id,report_model_name,user_id,canmakdate from dzbb_bbmb where system_code='" & Left(ls_xtbm, 2) & "' order by system_code,report_model_id"
- Set Cxnrrec = Cw_DataEnvi.dataconnect.Execute(Sqlstr)
- With Cxnrrec
- If .EOF And .BOF Then
- vsFlexGrid1.Clear , flexClearData
- vsFlexGrid1.Rows = vsFlexGrid1.FixedRows
- vsFlexGrid1.Redraw = True
- Exit Sub
- Else
- vsFlexGrid1.Redraw = False
- vsFlexGrid1.Clear , flexClearData
- vsFlexGrid1.Rows = .RecordCount + vsFlexGrid1.FixedRows
- End If
- jsqte = vsFlexGrid1.FixedRows
- Do While Not .EOF
- If jsqte >= vsFlexGrid1.Rows Then
- vsFlexGrid1.AddItem ""
- End If
- Call Jltcwg(Cxnrrec, jsqte)
- vsFlexGrid1.RowHeight(jsqte) = Sjhgd
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- vsFlexGrid1.Redraw = True
- Set Cxnrrec = Nothing
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- '[以下为自定义部分
- With Jlbrec
- vsFlexGrid1.TextMatrix(Rowjsq, Sydz("001", wglxx(), Szzls)) = Trim(.Fields("report_model_id"))
- vsFlexGrid1.TextMatrix(Rowjsq, Sydz("002", wglxx(), Szzls)) = Trim(.Fields("report_model_name"))
- vsFlexGrid1.TextMatrix(Rowjsq, Sydz("003", wglxx(), Szzls)) = Trim(.Fields("user_id"))
- vsFlexGrid1.TextMatrix(Rowjsq, Sydz("004", wglxx(), Szzls)) = Trim(.Fields("canmakdate"))
- End With
- '以上为自定义部分]
- End Sub
- Private Sub Jltcwg_bb(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- '[以下为自定义部分
- With Jlbrec
- vsFlexGrid2.TextMatrix(Rowjsq, Sydz("001", wglxx_bb(), Szzls_bb)) = Trim(.Fields("report_time"))
- vsFlexGrid2.TextMatrix(Rowjsq, Sydz("002", wglxx_bb(), Szzls_bb)) = Trim(.Fields("user_id"))
- vsFlexGrid2.TextMatrix(Rowjsq, Sydz("003", wglxx_bb(), Szzls_bb)) = Trim(.Fields("update_time"))
- vsFlexGrid2.TextMatrix(Rowjsq, Sydz("004", wglxx_bb(), Szzls_bb)) = Trim(.Fields("update_id"))
- End With
- '以上为自定义部分]
- End Sub
- Private Sub Command1_Click()
- Dim lcmd_delete As ADODB.Command
- Dim ls_delete As String
- Dim ll_msg As Long
- If vsFlexGrid2.Rows = 1 Then
- Exit Sub
- End If
- ll_msg = MsgBox("确实要删除这张报表吗?", vbOKCancel + vbQuestion + vbDefaultButton2, "百利/ERP5.0-电子报表")
- If ll_msg = vbCancel Then Exit Sub
- Set lcmd_delete = New ADODB.Command
- ls_delete = "delete from dzbb_bb where system_code='" & Left(ls_xtbm, 2) _
- & "' and report_model_id='" & Trim(vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, 0)) _
- & "' and report_time='" & Trim(vsFlexGrid2.TextMatrix(vsFlexGrid2.Row, 0)) & "'"
- lcmd_delete.ActiveConnection = Cw_DataEnvi.dataconnect
- lcmd_delete.CommandText = ls_delete
- lcmd_delete.Execute
- Set lcmd_delete = Nothing
- vsFlexGrid2.RemoveItem (vsFlexGrid2.Row)
- End Sub
- Private Sub command2_Click()
- MDI_frame.mb_open_report = False
- MDI_frame.StatusBar1.Panels(2).Text = "操作状态:正在等待用户选择操作"
- Unload Me
- End Sub
- Private Sub Command3_Click()
- Dim lcmd_delete As ADODB.Command
- Dim ls_delete As String
- Dim ll_msg As Long
- If vsFlexGrid2.Rows = 1 Then
- Exit Sub
- End If
- XT_calendar.Show vbModal, Me
- If Xtfhcs = "" Then Exit Sub
- ll_msg = MsgBox("您将删除系统" & Left(ls_xtbm, 2) & "的日期" & Left(Xtfhcs, 4) & "年" & Mid(Xtfhcs, 6, 2) & "月" & Right(Xtfhcs, 2) & "日之前的所有名称为“" & vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, 1) & "”的报表," & "确实要删除吗?", vbYesNo + vbQuestion + vbDefaultButton2, "百利/ERP5.0-电子报表")
- If ll_msg = vbNo Then
- Xtfhcs = Empty
- Exit Sub
- End If
- Set lcmd_delete = New ADODB.Command
- ls_delete = "delete from dzbb_bb where system_code='" & Left(ls_xtbm, 2) _
- & "' and report_model_id='" & vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, 0) _
- & "' and report_time<='" & Xtfhcs & " 23:59:59" & "'"
- lcmd_delete.ActiveConnection = Cw_DataEnvi.dataconnect
- lcmd_delete.CommandText = ls_delete
- lcmd_delete.Execute
- Set lcmd_delete = Nothing
- Xtfhcs = Empty
- Cxnrtcwg_bb
- End Sub
- Private Sub Form_Load()
- Me.HelpContextID = "1015002"
- '调 入 网 格
- wgdmtemp = "dzbb_bbmb"
- Call BzWgcsh(vsFlexGrid1, wgdmtemp, wgszxx(), Wbbjsx(), Wblrxz(), wglxx())
- Qslz = wgszxx(1)
- Sjhgd = wgszxx(2)
- Szzls = vsFlexGrid1.Cols - 1
- '调入网格2
- wgdmtemp_bb = "dzbb_bb"
- Call BzWgcsh(vsFlexGrid2, wgdmtemp_bb, wgszxx_bb(), Wbbjsx_bb(), Wblrxz_bb(), wglxx_bb())
- qslz_bb = wgszxx_bb(1)
- Sjhgd_bb = wgszxx_bb(2)
- Szzls_bb = vsFlexGrid2.Cols - 1
- Call Cxnrtcwg
- Call vsFlexGrid1_SelChange
- MDI_frame.StatusBar1.Panels(2).Text = "操作状态:正在进行报表管理"
- End Sub
- Private Sub vsFlexGrid1_SelChange()
- Dim Sqlstr As String
- Dim jsqte As Long
- Dim Cxnrrec As ADODB.Recordset
- '查询连接串
- vsFlexGrid2.Clear , flexClearData
- vsFlexGrid2.Rows = 1
- If vsFlexGrid1.Rows <= 1 Then
- Exit Sub
- End If
- Label2.Caption = Trim(vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, 0)) & "-" & Trim(vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, 1))
- Sqlstr = "select report_time,user_id,update_time,update_id from dzbb_bb where system_code='" _
- & Left(ls_xtbm, 2) & "' and report_model_id='" _
- & Trim(vsFlexGrid1.TextMatrix(vsFlexGrid1.Row, Sydz("001", wglxx(), Szzls))) _
- & "' order by system_code,report_model_id,report_time"
- Set Cxnrrec = Cw_DataEnvi.dataconnect.Execute(Sqlstr)
- With Cxnrrec
- If .EOF And .BOF Then
- Exit Sub
- Else
- vsFlexGrid2.Redraw = False
- vsFlexGrid2.Rows = .RecordCount + vsFlexGrid2.FixedRows
- End If
- jsqte = vsFlexGrid2.FixedRows
- Do While Not .EOF
- If jsqte >= vsFlexGrid2.Rows Then
- vsFlexGrid2.AddItem ""
- End If
- Call Jltcwg_bb(Cxnrrec, jsqte)
- vsFlexGrid2.RowHeight(jsqte) = Sjhgd
- .MoveNext
- jsqte = jsqte + 1
- Loop
- End With
- vsFlexGrid2.Redraw = True
- Set Cxnrrec = Nothing
- End Sub