i-
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:9k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
- Begin VB.Form ZbqlFrm
- BorderStyle = 3 'Fixed Dialog
- Caption = "帐簿清理"
- ClientHeight = 4170
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4560
- HelpContextID = 501008
- Icon = "帐簿清理.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4170
- ScaleWidth = 4560
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin VB.CommandButton QxCommand
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 3365
- TabIndex = 0
- Top = 3810
- Width = 1120
- End
- Begin VB.CommandButton QdCommand
- Caption = "清理(&L)"
- Height = 300
- Left = 2165
- TabIndex = 2
- Top = 3810
- Width = 1120
- End
- Begin VSFlex8Ctl.VSFlexGrid CzxsGrid
- Height = 3675
- Left = 60
- TabIndex = 1
- Top = 60
- Width = 4425
- _ExtentX = 7805
- _ExtentY = 6482
- 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
- End
- Attribute VB_Name = "ZbqlFrm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**********************************************
- '* 模 块 名 称 :帐簿清理
- '* 功 能 描 述 :清除用户所选中数据表中的记录
- '* 程序员姓名 : 徐衍民
- '* 最后修改人 : 徐衍民
- '* 最后修改时间:2001/11/16
- '* 备 注:
- '**********************************************
- '自定义变量
- Dim rstemp As ADODB.Recordset '数据表动态集
- Dim Jsqte As Long '查询临时使用变量
- Dim rs As ADODB.Recordset '临时打开数据集变量
- '以下为固定使用变量(网格)
- 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)
- Private Sub Form_Load() '窗体装入
- '调入网格设置信息
- GridCode = "Gdzc_LedgerManage"
- Call BzWgcsh(CzxsGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
- Qslz = GridInf(1)
- Sjhgd = GridInf(2)
- Szzls = CzxsGrid.Cols - 1
- '填 充 网 格
- Call Cxnrtcwg
- End Sub
- Private Sub Cxnrtcwg() '查询内容填充网格
- Dim Sqlstr As String '查询连接串
- Sqlstr = "SELECT * FROM Gdzc_Ledgermanage Order By asin(whetherDelete)" '打开帐簿管理数据集
- Set Cxnrrec = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
- With Cxnrrec
- CzxsGrid.Rows = CzxsGrid.FixedRows
- If .EOF And .BOF Then
- CzxsGrid.Redraw = True
- Exit Sub
- End If
- Jsqte = CzxsGrid.FixedRows
- Do While Not .EOF
- CzxsGrid.AddItem ""
- Call Jltcwg(Cxnrrec, Jsqte) '调入填充网格子过程
- CzxsGrid.RowHeight(Jsqte) = Sjhgd '设置网格高度
- .MoveNext
- Jsqte = Jsqte + 1
- Loop
- End With
- End Sub
- Private Sub Jltcwg(Jlbrec As ADODB.Recordset, Rowjsq As Long) '记录内容填充网格
- With Jlbrec
- CzxsGrid.TextMatrix(Rowjsq, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("TableName") & "") '数据表名称
- CzxsGrid.TextMatrix(Rowjsq, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("TableDpiction") & "") '数据表描述
- If .Fields("whetherDelete") = True Then
- CzxsGrid.TextMatrix(Rowjsq, Sydz("003", GridStr(), Szzls)) = "√" '是否可以删除
- End If
- End With
- End Sub
- Private Sub QdCommand_Click() '确定,清空用户所选中的数据表
- If MsgBox("是否确定要删除所选中的数据表?", vbOKCancel + vbDefaultButton2 + vbQuestion, "百利/ERP5.0-固定资产") = vbOK Then
- Cw_DataEnvi.DataConnect.BeginTrans '事务处理
- On Error GoTo Cwcl
- With CzxsGrid
- For Jsqte = CzxsGrid.FixedRows To CzxsGrid.Rows - 1
- If CzxsGrid.TextMatrix(Jsqte, 3) = "√" Then
- Cw_DataEnvi.DataConnect.Execute ("delete " & Trim(CzxsGrid.TextMatrix(Jsqte, 1))) '执行删除操作
- End If
- Next Jsqte
- End With
- '将会计日历表中固定资产结帐标志赋成未结帐状态。
- Cw_DataEnvi.DataConnect.Execute ("update gy_kjrlb set gdzcjzbz='0' where gdzcjzbz='1'")
- '卡片清除后,将自定义文本框值赋成原始
- For Jsqte = 1 To 20
- Set rstemp = New ADODB.Recordset
- rstemp.Open "SELECT * From Xt_text_input WHERE system_code = 'gdzc' AND text_group_code = 'gdzc_cardjbcz' and text_name='自定义" & Jsqte & "'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If Not rstemp.EOF Then
- Set rs = New ADODB.Recordset
- rs.Open "select * from Gdzc_custom where fieldCode='zdy" & Jsqte & "' and FieldState='1'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
- If rs.EOF Then
- rstemp.Fields("Text_data_type") = 0
- rstemp.Fields("Text_Length") = 0
- rstemp.Fields("judge_type") = 0
- rstemp.Update
- End If
- rs.Close
- Set rs = Nothing
- End If
- rstemp.Close
- Set rstemp = Nothing
- Next Jsqte
- '将自定义属性表中是否有数据字段内容赋成空
- Cw_DataEnvi.DataConnect.Execute ("update gdzc_custom set whetherNull='0'")
- Cw_DataEnvi.DataConnect.CommitTrans '使用事务处理,执行物理删除
- Tsxx = "帐簿清理完毕!"
- Call Xtxxts(Tsxx, 0, 4)
- Unload Me
- Exit Sub
- Cwcl:
- Cw_DataEnvi.DataConnect.RollbackTrans '使用事务处理,恢复删除记录
- Tsxx = "帐簿清理过程中出现未知错误,程序自动恢复折旧前状态!"
- Call Xtxxts(Tsxx, 0, 1)
- Exit Sub
- End If
- End Sub
- Private Sub QxCommand_Click() '取 消
- Unload Me '退出当前窗体
- End Sub