+Ӧ
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:7k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Begin VB.Form Dev_ItemSortAddItem
- BorderStyle = 1 'Fixed Single
- Caption = "设备类别项目选择"
- ClientHeight = 5040
- ClientLeft = 2850
- ClientTop = 1575
- ClientWidth = 5715
- HelpContextID = 12008
- Icon = "类别项目.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5040
- ScaleWidth = 5715
- Begin VSFlex8Ctl.VSFlexGrid VSFlexGrid1
- Height = 4140
- Left = 75
- TabIndex = 4
- Top = 450
- Width = 5565
- _cx = 9816
- _cy = 7302
- 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
- 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
- Begin VB.CommandButton Command2
- Caption = "取消(&C)"
- Height = 300
- Left = 4520
- TabIndex = 1
- Top = 4640
- Width = 1120
- End
- Begin VB.CommandButton Command1
- Caption = "确定(&O)"
- Height = 300
- Left = 3260
- TabIndex = 0
- Top = 4640
- Width = 1120
- End
- Begin VB.Label SortCode
- Caption = "Label2"
- Height = 285
- Left = 1080
- TabIndex = 3
- Top = 150
- Width = 1605
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "设备类别:"
- Height = 180
- Left = 75
- TabIndex = 2
- Top = 160
- Width = 810
- End
- End
- Attribute VB_Name = "Dev_ItemSortAddItem"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim add_item As New Recordset
- Dim Item_TF()
- Private Sub Command1_Click() '保存项目分类信息
- On Error Resume Next
- Dim Ssql As String
- Dim i As Integer: Dim CH As String
- Dim aDo_list As New Recordset
- With vsFlexGrid1
- For i = 0 To .Rows - 1
- If .TextMatrix(i, 2) = "√" Then
- Set aDo_list = Cw_DataEnvi.DataConnect.Execute("select * from DEV_ItemSortList where isid=" & Val(SortCode.Tag) & " and itemcode='" & .TextMatrix(i, 0) & "'")
- If aDo_list.RecordCount < 1 Then
- Ssql = "INSERT INTO DEV_ItemSortList(isid,itemcode,YNShow,tab,itemtop) VALUES (" & Val(SortCode.Tag) & ",'" & Trim(.TextMatrix(i, 0)) & "','1'," & i & ",0 )"
- Cw_DataEnvi.DataConnect.Execute Ssql
- End If
- aDo_list.Close
- Else
- Cw_DataEnvi.DataConnect.Execute "delete DEV_ItemSortList where isid=" & Val(SortCode.Tag) & " and itemcode='" & .TextMatrix(i, 0) & "'"
- End If
- Next i
- Unload Me
- End With
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
- Private Sub Form_Activate() '向网格填充项目信息
- On Error Resume Next
- Dim ado_Itemtf As New Recordset
- Dim i As Integer
- i = 1
- Set add_item = Cw_DataEnvi.DataConnect.Execute("select * from DEV_Item")
- vsFlexGrid1.Rows = add_item.RecordCount + 1
- Do While Not add_item.EOF
- vsFlexGrid1.TextMatrix(i, 0) = add_item!ItemCode
- vsFlexGrid1.TextMatrix(i, 1) = Trim(add_item!ItemChineseName)
- Set ado_Itemtf = Cw_DataEnvi.DataConnect.Execute("select * from DEV_ItemSortList where ItemCode='" & add_item!ItemCode & "' and isid=" & SortCode.Tag)
- If ado_Itemtf.RecordCount > 0 Then
- vsFlexGrid1.TextMatrix(i, 2) = "√"
- Else
- vsFlexGrid1.TextMatrix(i, 2) = ""
- End If
- ado_Itemtf.Close
- If add_item!YNRoot = 1 Then
- vsFlexGrid1.TextMatrix(i, 2) = "√"
- vsFlexGrid1.TextMatrix(i, 3) = "√"
- End If
- add_item.MoveNext
- i = i + 1
- Loop
- add_item.Close
- End Sub
- Private Sub vsFlexGrid1_DblClick() '选中项目
- With vsFlexGrid1
- If Trim(.TextMatrix(.Row, 3)) <> "" Then MsgBox "固定项目必须选定!", 16: Exit Sub
- If .TextMatrix(.Row, 2) = "" Then
- .TextMatrix(.Row, 2) = "√"
- Else
- .TextMatrix(.Row, 2) = ""
- End If
- End With
- End Sub
- Private Sub vsFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer) '选中项目
- If KeyCode = 32 Then
- vsFlexGrid1_DblClick
- End If
- End Sub