📄 frmdrawman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmDrawMan
Caption = "办公用品领用管理"
ClientHeight = 5505
ClientLeft = 60
ClientTop = 345
ClientWidth = 5850
LinkTopic = "Form1"
ScaleHeight = 5505
ScaleWidth = 5850
StartUpPosition = 2 '屏幕中心
Begin VB.CheckBox Check1
Caption = "全部"
Height = 255
Left = 2880
TabIndex = 8
Top = 158
Width = 855
End
Begin VB.CommandButton Cmd_Check
Caption = "领用确认"
Height = 495
Left = 4440
TabIndex = 7
Top = 3480
Width = 1335
End
Begin VB.CommandButton Cmd_Back
Caption = "返 回"
Height = 495
Left = 4440
TabIndex = 6
Top = 4440
Width = 1335
End
Begin VB.CommandButton Cmd_Del
Caption = "删 除"
Height = 495
Left = 4440
TabIndex = 5
Top = 2520
Width = 1335
End
Begin VB.CommandButton Cmd_List
Caption = "领用明细"
Height = 495
Left = 4440
TabIndex = 4
Top = 1560
Width = 1335
End
Begin VB.CommandButton Cmd_Add
Caption = "添 加"
Height = 495
Left = 4440
TabIndex = 3
Top = 600
Width = 1335
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 3840
Top = 5040
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 4815
Left = 120
TabIndex = 2
Top = 480
Width = 4095
_ExtentX = 7223
_ExtentY = 8493
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Ado_Dep
Height = 330
Left = 3960
Top = 0
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Ado_Dep"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo dco_Dep
Height = 330
Left = 1080
TabIndex = 1
Top = 120
Width = 1695
_ExtentX = 2990
_ExtentY = 582
_Version = 393216
Style = 2
Text = ""
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "部门名称"
Height = 180
Left = 120
TabIndex = 0
Top = 195
Width = 720
End
End
Attribute VB_Name = "FrmDrawMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Check1_Click()
If Check1.Value = 1 Then
dco_Dep.Enabled = False
dco_Dep.Text = ""
Else
dco_Dep.Enabled = True
End If
DataRefresh
End Sub
Private Sub Cmd_Add_Click()
FrmDrawEdit.txtDate = Date
FrmDrawEdit.Show 1
DataRefresh
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub DataRefresh()
Dim StrSearch As String
StrSearch = ""
If Check1.Value <> 1 Then
If Len(Trim(dco_Dep.Text)) > 0 Then
StrSearch = " And r.DepId=" + Trim(dco_Dep.BoundText)
End If
End If
Adodc1.ConnectionString = Conn
Adodc1.RecordSource = "Select r.Id,d.DepName AS 部门名称,r.CreateDate AS 领用日期," _
+ "IIF(r.Flag=0,'创建','领用') AS 状态,r.Flag From Draw r,Department d Where r.DepId=d.DepId " _
+ StrSearch + " Order By r.CreateDate DESC"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(0).Width = 0
DataGrid1.Columns(1).Width = 1600
DataGrid1.Columns(2).Width = 1400
DataGrid1.Columns(3).Width = 600
DataGrid1.Columns(4).Width = 0
End Sub
Private Sub Cmd_Check_Click()
If Adodc1.Recordset.EOF Then
MsgBox "请选择记录"
Exit Sub
End If
If Adodc1.Recordset.Fields(4) = 0 Then
'确认后更改领用单标志Flag值为1
MyDraw.UpdateFlag (Adodc1.Recordset.Fields(0))
'按照领用单明细更改当前库存数量
MyList.UpdateStore (Adodc1.Recordset.Fields(0))
DataRefresh
Else
MsgBox "已经领用"
End If
End Sub
Private Sub Cmd_Del_Click()
If Adodc1.Recordset.EOF Then
MsgBox "请选择记录"
Exit Sub
End If
'领用后的记录不允许删除
If Adodc1.Recordset.Fields(4) = 0 Then
MyDraw.Delete (Adodc1.Recordset.Fields(0))
'删除时同时要删除领用明细
MyList.DeleteByDId (Adodc1.Recordset.Fields(0))
MsgBox "删除成功"
DataRefresh
Else
MsgBox "领用后不允许删除记录"
End If
End Sub
Private Sub Cmd_List_Click()
If Adodc1.Recordset.EOF Then
MsgBox "请选择记录"
Exit Sub
End If
FrmListMan.OriId = Adodc1.Recordset.Fields(0)
FrmListMan.iFlag = Adodc1.Recordset.Fields(4)
FrmListMan.lbl_DepName = Adodc1.Recordset.Fields(1)
FrmListMan.Show 1
End Sub
Private Sub dco_Dep_Click(Area As Integer)
DataRefresh
End Sub
Private Sub Form_Load()
'装入部门信息
Ado_Dep.ConnectionString = Conn
Ado_Dep.RecordSource = "Select * From Department"
Ado_Dep.Refresh
Set dco_Dep.RowSource = Ado_Dep
dco_Dep.ListField = "DepName"
dco_Dep.BoundColumn = "DepId"
Check1.Value = 1
dco_Dep.Enabled = False
DataRefresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -