📄 frmstoreman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmstoreman
Caption = "仓库信息管理"
ClientHeight = 5940
ClientLeft = 60
ClientTop = 345
ClientWidth = 8445
Icon = "frmstoreman.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5940
ScaleWidth = 8445
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_back
Caption = "返回"
Height = 495
Left = 6360
TabIndex = 4
Top = 5280
Width = 1215
End
Begin VB.CommandButton cmd_del
Caption = "删除"
Height = 495
Left = 4560
MouseIcon = "frmstoreman.frx":0CCA
MousePointer = 99 'Custom
TabIndex = 3
Top = 5280
Width = 1215
End
Begin VB.CommandButton cmd_modi
Caption = "修改"
Height = 495
Left = 2760
MouseIcon = "frmstoreman.frx":0FD4
MousePointer = 99 'Custom
TabIndex = 2
Top = 5280
Width = 1215
End
Begin VB.CommandButton cmd_add
Caption = "添加"
Height = 495
Left = 960
MouseIcon = "frmstoreman.frx":12DE
MousePointer = 99 'Custom
TabIndex = 1
Top = 5280
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = -360
Top = 5640
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_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= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=stocks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "stocks"
OtherAttributes = ""
UserName = "sa"
Password = "sa"
RecordSource = "SELECT * FROM Client"
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
Bindings = "frmstoreman.frx":15E8
Height = 4575
Left = 120
TabIndex = 0
Top = 600
Width = 8175
_ExtentX = 14420
_ExtentY = 8070
_Version = 393216
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
End
Attribute VB_Name = "frmstoreman"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Refresh_Store()
Adodc1.RecordSource = "SELECT StoreId As 仓库编号, StoreName as 仓库名称," _
+ " Describe as 描述信息 FROM Storehouse ORDER BY StoreId"
Adodc1.Refresh
End Sub
Private Sub Cmd_Add_Click()
frmstoreedit.Modify = False
frmstoreedit.OriId = 0
frmstoreedit.Show 1
Refresh_Store
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub Cmd_Del_Click()
Dim TmpId As Long
If Adodc1.Recordset.BOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
p = Adodc1.Recordset.AbsolutePosition
'读取当前记录的客户单位信息
TmpId = Adodc1.Recordset.Fields(0)
'判断入库单中是否包含此仓库
If MyStorein.HaveStore(TmpId) = True Then
MsgBox "入库单中包含此仓库,不能删除"
Exit Sub
End If
'判断出库单中是否包含此仓库
If MyTakeout.HaveStore(TmpId) = True Then
MsgBox "出库单中包含此仓库,不能删除"
Exit Sub
End If
'判断此仓库是否存放有产品
If MyProInStore.HaveStore(TmpId) = True Then
MsgBox "此仓库中存放有产品,不能删除"
Exit Sub
End If
If MsgBox("是否删除当前行?", vbYesNo, "确认") = vbYes Then
MyStore.Delete (TmpId)
MsgBox "删除成功"
Refresh_Store
If p - 1 > 0 Then
Adodc1.Recordset.Move p - 1
End If
End If
End Sub
Private Sub Cmd_Modi_Click()
If Adodc1.Recordset.EOF = True Then
MsgBox "请选择记录"
Exit Sub
End If
p = Adodc1.Recordset.AbsolutePosition
'客户单位
frmstoreedit.OriId = Adodc1.Recordset.Fields(0)
frmstoreedit.OriName = Trim(Adodc1.Recordset.Fields(1))
frmstoreedit.txtstore = Trim(Adodc1.Recordset.Fields(1))
'描述信息
frmstoreedit.txtDescribe = Trim(Adodc1.Recordset.Fields(2))
frmstoreedit.Modify = True
frmstoreedit.Show 1
Refresh_Store
End Sub
Private Sub Form_Load()
Refresh_Store
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -