📄 warehousesingleform.frm
字号:
VERSION 5.00
Begin VB.Form WarehouseSingleForm
Caption = "仓库资料"
ClientHeight = 3645
ClientLeft = 60
ClientTop = 345
ClientWidth = 5250
LinkTopic = "Form1"
ScaleHeight = 3645
ScaleWidth = 5250
Begin VB.ComboBox Combo1
Height = 300
Left = 3360
TabIndex = 14
Top = 120
Width = 1455
End
Begin VB.TextBox T_memo
Height = 975
Left = 960
MaxLength = 200
TabIndex = 13
Text = "Text1"
Top = 1800
Width = 3855
End
Begin VB.TextBox T_address
Height = 375
Left = 960
MaxLength = 10
TabIndex = 12
Text = "Text1"
Top = 1200
Width = 3855
End
Begin VB.TextBox T_no
Height = 375
Left = 3360
MaxLength = 5
TabIndex = 11
Text = "Text1"
Top = 600
Width = 1455
End
Begin VB.TextBox T_tell
Height = 375
Left = 960
MaxLength = 30
TabIndex = 10
Text = "Text1"
Top = 600
Width = 1455
End
Begin VB.TextBox T_name
Height = 375
Left = 960
MaxLength = 10
TabIndex = 9
Text = "Text1"
Top = 120
Width = 1455
End
Begin VB.CommandButton c_save
Caption = "保 存"
Height = 375
Left = 3600
TabIndex = 8
Top = 3120
Width = 735
End
Begin VB.CommandButton c_cancel
Caption = "取 消"
Height = 375
Left = 4440
TabIndex = 7
Top = 3120
Width = 735
End
Begin VB.CommandButton c_new
Caption = "新 增"
Height = 375
Left = 2760
TabIndex = 6
Top = 3120
Width = 735
End
Begin VB.Line Line1
X1 = 0
X2 = 5280
Y1 = 3000
Y2 = 3000
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "备 注:"
Height = 180
Index = 5
Left = 120
TabIndex = 5
Top = 1920
Width = 810
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "仓库编号:"
Height = 180
Index = 4
Left = 2460
TabIndex = 4
Top = 720
Width = 810
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "联系电话:"
Height = 180
Index = 3
Left = 120
TabIndex = 3
Top = 720
Width = 810
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "负责人:"
Height = 180
Index = 2
Left = 2640
TabIndex = 2
Top = 240
Width = 630
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "仓库地址:"
Height = 180
Index = 0
Left = 120
TabIndex = 1
Top = 1320
Width = 810
End
Begin VB.Label TsLabel
AutoSize = -1 'True
Caption = "仓库名称:"
Height = 255
Index = 1
Left = 120
TabIndex = 0
Top = 240
Width = 855
End
End
Attribute VB_Name = "WarehouseSingleForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 块 名 称 :仓库资料管理用户操作界面
'* 功 能 描 述 :仓库资料管理用户操作界面
'* 程序员姓名 : 陈齐国
'* 最后修改人 : 陈齐国
'* 最后修改时间:2005/08/22
'**************************************
Option Explicit
Public m_operatorType As Integer ' 操作类型 0 - 新增 1 - 修改
Public m_warehouseId As String ' 修改时其它窗体传递过来的参数
Private m_warehouseDAO As WarehouseDAO ' 数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Private m_productcheckrecordDAO As productcheckrecordDAO
Private f As String
Private Sub c_cancel_Click()
Unload Me
End Sub
Private Sub c_new_Click()
Check
If m_operatorType = 0 Then
If f = "0" Then
Call NewWarehouse
clear
Else
Exit Sub
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Call ModifyWarehouse
clear
m_operatorType = 0
Else
Exit Sub
End If
End If
End Sub
Private Sub c_save_Click()
Check
If m_operatorType = 0 Then
If f = "0" Then
Call NewWarehouse
Else
Exit Sub
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Call ModifyWarehouse
Else
Exit Sub
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Set m_warehouseDAO = New WarehouseDAO
Set m_recordset = New ADODB.Recordset
Set m_productcheckrecordDAO = New productcheckrecordDAO
m_productcheckrecordDAO.employee_showname m_recordset, WAREHOUSE_SINGLE '获得检验员列表
Combo1.clear
With m_recordset
Do While Not .EOF
Combo1.AddItem Trim(.Fields("职员名称"))
.MoveNext
Loop
End With
m_recordset.Close
Combo1.text = Trim(MainForm.g_application.m_userName)
Me.Height = 4050
Me.Width = 5370
SetToCenter Me
If m_operatorType = 0 Then
Me.caption = "仓库资料_新增"
clear
Else
Me.caption = "仓库资料_修改"
c_new.Visible = False
FindByIdRefresh
End If
End Sub
'**************************************
'* 功 能 描 述 :新增仓库数据处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub NewWarehouse()
'
Dim ret As Boolean
Call Check
ret = m_warehouseDAO.NewWarehouse(m_recordset, Trim(T_name.text), _
Trim(T_address.text), Trim(Combo1.text), _
Trim(T_tell.text), Trim(T_no.text), Trim(T_memo.text))
End Sub
'**************************************
'* 功 能 描 述 :修改仓库处理函数
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub ModifyWarehouse()
'
Dim ret As Boolean
Call Check
ret = m_warehouseDAO.ModifyWarehouse(m_recordset, Trim(T_name.text), _
Trim(T_address.text), Trim(Combo1.text), _
Trim(T_tell.text), Trim(T_no.text), Trim(T_memo.text), m_warehouseId)
End Sub
'**************************************
'* 功 能 描 述 :检验数据的合法性
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub Check()
'
f = "0"
If Trim(T_name.text) = "" Then
MainForm.g_msgText = "仓库名称不能为空!"
HMsgBox MainForm.g_msgText, 0, 1
T_name.SetFocus
f = "1"
End If
If Trim(Combo1.text) = "" Then
MainForm.g_msgText = "仓库负责人不能为空!"
HMsgBox MainForm.g_msgText, 0, 1
Combo1.SetFocus
f = "1"
End If
End Sub
'**************************************
'* 功 能 描 述 :根据仓库ID找到仓库资料并显示在界面上
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub FindByIdRefresh()
Dim ret As Boolean
ret = m_warehouseDAO.FindById(m_recordset, m_warehouseId)
If ret Then
With m_recordset
T_name.text = Trim(.Fields("仓库名称"))
T_address.text = Trim(.Fields("仓库地址"))
Combo1.text = Trim(.Fields("仓库负责人"))
T_tell.text = Trim(.Fields("电话"))
T_no.text = Trim(.Fields("仓库编码"))
T_memo.text = Trim(.Fields("备注"))
m_recordset.Close
End With
Else
MainForm.g_msgText = "仓库编码不正确,请重新操作!"
HMsgBox MainForm.g_msgText, 0, 1
Unload Me
End If
End Sub
'**************************************
'* 功 能 描 述 :清除界面上文本框里的所有内容
'* 输 入 参 数 :无
'* 输 出 能 数 :无
'**************************************
Private Sub clear()
T_name.text = ""
T_address.text = ""
T_tell.text = ""
T_no.text = ""
T_memo.text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -