?? frmnewequipment.frm
字號:
VERSION 5.00
Begin VB.Form frmNewequipment
BorderStyle = 4 'Fixed ToolWindow
Caption = "新設備操作"
ClientHeight = 4905
ClientLeft = 45
ClientTop = 315
ClientWidth = 6780
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4905
ScaleWidth = 6780
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmddelete
Caption = "調出"
Height = 375
Left = 1560
TabIndex = 32
Top = 4320
Width = 855
End
Begin VB.CommandButton cmdmodify
Caption = "修改"
Height = 375
Left = 4320
TabIndex = 29
Width = 855
End
Begin VB.CommandButton cmdquery
Caption = "查詢"
Height = 375
Left = 3240
TabIndex = 14
Top = 4320
Width = 855
End
Begin VB.Frame Frame1
Height = 4095
Left = 120
TabIndex = 15
Top = 120
Width = 6495
Begin VB.TextBox txtlinkman
Height = 270
Left = 2880
TabIndex = 31
Top = 2280
Width = 1455
End
Begin VB.TextBox txtmemo
Height = 1215
Left = 840
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 12
Top = 2760
Width = 5295
End
Begin VB.TextBox txttel
Height = 270
Left = 840
MaxLength = 12
TabIndex = 9
Top = 2280
Width = 1215
End
Begin VB.TextBox txtsaftmonth
Height = 270
Left = 5760
MaxLength = 2
TabIndex = 11
Top = 2280
Width = 255
End
Begin VB.TextBox txtsaftyear
Height = 270
Left = 5040
TabIndex = 10
Top = 2280
Width = 495
End
Begin VB.TextBox txtbargainor
Height = 270
Left = 840
TabIndex = 8
Top = 1800
Width = 5295
End
Begin VB.CommandButton cmdstroreidquery
Caption = "查詢"
Height = 300
Left = 5520
TabIndex = 6
Top = 840
Width = 600
End
Begin VB.ComboBox Cmbstoreid
Height = 300
Left = 4440
TabIndex = 5
Top = 840
Width = 855
End
Begin VB.TextBox txtccount
Height = 270
Left = 840
TabIndex = 3
Top = 840
Width = 735
End
Begin VB.TextBox txtvalue
Height = 270
Left = 2160
TabIndex = 4
Top = 840
Width = 1095
End
Begin VB.TextBox txtbrand
Height = 270
Left = 840
TabIndex = 7
Top = 1320
Width = 5295
End
Begin VB.CommandButton cmdconfigidquery
Caption = "查詢"
Height = 300
Left = 5520
TabIndex = 2
Top = 360
Width = 600
End
Begin VB.ComboBox CmbConfigid
Height = 300
Left = 4440
TabIndex = 1
Top = 360
Width = 855
End
Begin VB.TextBox txtname
Height = 270
Left = 840
TabIndex = 0
Top = 360
Width = 2415
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "聯系人"
Height = 180
Left = 2280
TabIndex = 30
Top = 2300
Width = 540
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "備注"
Height = 180
Left = 360
TabIndex = 28
Top = 2775
Width = 360
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "電話"
Height = 180
Left = 360
TabIndex = 27
Top = 2295
Width = 360
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "月"
Height = 180
Left = 6000
TabIndex = 26
Top = 2300
Width = 180
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "年"
Height = 180
Left = 5520
TabIndex = 25
Top = 2300
Width = 180
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "保修期"
Height = 180
Left = 4440
TabIndex = 24
Top = 2300
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "賣商"
Height = 180
Left = 360
TabIndex = 23
Top = 1815
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "存放地"
Height = 180
Left = 3765
TabIndex = 22
Top = 855
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "數量"
Height = 180
Left = 360
TabIndex = 21
Top = 855
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "單價"
Height = 180
Left = 1680
TabIndex = 20
Top = 855
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "品牌"
Height = 180
Left = 360
TabIndex = 19
Top = 1335
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "配置編號"
Height = 180
Left = 3600
TabIndex = 18
Top = 375
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "設備名"
Height = 180
Left = 240
TabIndex = 17
Top = 375
Width = 540
End
End
Begin VB.CommandButton cmdback
Caption = "返回"
Height = 375
Left = 5400
TabIndex = 16
Top = 4320
Width = 855
End
Begin VB.CommandButton cmdadd
Caption = "調入"
Height = 375
Left = 360
TabIndex = 13
Top = 4320
Width = 855
End
End
Attribute VB_Name = "frmNewequipment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmbConfigIDShow()
CmbConfigID.Clear
Connect "r"
sqlstr = "config"
rs.Open sqlstr
Do While Not rs.EOF
CmbConfigID.AddItem (rs.Fields("configid"))
rs.MoveNext
Loop
Disconnect
End Sub
Private Sub CmbStoreidShow()
cmbStoreID.Clear
Dim s As store
Dim storeids() As String
Set s = New store
storeids = s.GetStoreids()
If UBound(storeids) > 1 Then
For i = 1 To UBound(storeids) - 1
cmbStoreID.AddItem (storeids(i))
Next
End If
End Sub
Private Sub CmbConfigid_GotFocus()
CmbConfigIDShow
End Sub
Private Sub Cmbstoreid_GotFocus()
CmbStoreidShow
End Sub
Private Sub cmdAdd_Click()
Dim n As newequipment
Dim sl As slog
Set sl = New slog
Set n = New newequipment
If Me.cmdAdd.Caption = "調入" Then
Form_Init
txtname.SetFocus
Me.cmdAdd.Caption = "提交"
Me.CmdQuery.Enabled = False
CmdModify.Enabled = False
Me.cmdDelete.Enabled = False
Else
Me.cmdAdd.Caption = "調入"
Me.CmdQuery.Enabled = True
CmdModify.Enabled = True
Me.cmdDelete.Enabled = True
'把表單上的數據寫入類的屬性中
If txtname.Text = "" Then
MsgBox "無設備名稱"
Set n = Nothing
Exit Sub
End If
n.name = Trim(txtname.Text)
If CmbConfigID.Text = "" Then
MsgBox "無配置編號 "
Set n = Nothing
Exit Sub
End If
n.configid = CInt(CmbConfigID.Text)
n.buytime = Date
n.brand = txtBrand.Text
n.value = CCur(txtvalue.Text)
n.ccount = CInt(txtccount.Text)
n.bargainor = txtbargainor.Text
n.linkman = txtlinkman.Text
If txtsaftyear.Text <> "" Then
n.safttime = CInt(txtsaftyear.Text)
End If
If txtsaftmonth.Text <> "" Then
n.safttime = n.safttime + CInt(txtsaftmonth.Text) / 12
End If
n.tel = txttel.Text
n.memo = txtmemo.Text
If cmbStoreID.Text = "" Then
MsgBox "沒有選擇存放地點"
Set n = Nothing
Exit Sub
End If
n.STOREID = Trim(cmbStoreID.Text)
n.Insert
sl.STOREID = cmbStoreID.Text
sl.operator = "admin"
sl.move = True
sl.mtime = Date
sl.moveinfo = "設備名稱:" & n.name & "|配置類型:" & n.configid & "|單價:" & n.value & "|數量:" & n.ccount & "|存放地點:" & n.STOREID
sl.Insert
'往slog中寫入紀錄
End If
Set sl = Nothing
Set n = Nothing
End Sub
Private Sub CmdBack_Click()
If Me.cmdAdd.Caption = "提交" Then
Me.cmdAdd.Caption = "調入"
CmdModify.Enabled = True
Me.CmdQuery.Enabled = True
Me.cmdDelete.Enabled = True
ElseIf Me.CmdQuery.Caption = "提交" Then
Me.cmdAdd.Enabled = True
CmdModify.Enabled = True
Me.cmdDelete.Enabled = True
Me.CmdQuery.Caption = "查詢"
ElseIf Me.CmdModify.Caption = "提交" Then
Me.CmdModify.Caption = "修改"
cmdAdd.Enabled = True
CmdQuery.Enabled = True
Me.cmdDelete.Enabled = True
ElseIf Me.cmdDelete.Caption = "提交" Then
Me.cmdAdd.Enabled = True
Me.CmdModify.Enabled = True
Me.CmdQuery.Enabled = True
Me.cmdDelete.Caption = "調出"
Else
Unload Me
End If
End Sub
Private Sub cmdconfigidquery_Click()
frmconfig.Show
End Sub
Private Sub cmdDelete_Click()
' frmeselect.Visible = True '顯示查詢窗口
' Form_Paint
' If Me.cmdDelete.Caption = "調出" Then
' Me.cmdDelete.Caption = "提交"
' Me.cmdAdd.Enabled = False
' Me.CmdModify.Enabled = False
' Me.CmdQuery.Enabled = False
' Else
' Me.cmdDelete.Caption = "調出"
' Me.cmdAdd.Enabled = True
' Me.CmdModify.Enabled = True
' Me.CmdQuery.Enabled = True
' '修改該記錄條的數量字段,若數量字段<=0,則刪除該條記錄
'
'
' '往slog中寫入紀錄
'
'
' End If
Me.Hide
frmEquipment.Show
End Sub
Private Sub cmdModify_Click()
Dim n As newequipment
If Me.CmdModify.Caption = "修改" Then
CmdModify.Caption = "提交"
cmdAdd.Enabled = False
CmdQuery.Enabled = False
txtname.SetFocus
Else
Me.CmdModify.Caption = "修改"
cmdAdd.Enabled = True
CmdQuery.Enabled = True
'提交數據,記得刷新frmeselect
Set n = New newequipment
n.nid = CInt(Me.Frame1.Caption)
If txtname.Text = "" Then
MsgBox "無設備名稱"
Set n = Nothing
Exit Sub
End If
n.name = Trim(txtname.Text)
If CmbConfigID.Text = "" Then
MsgBox "無配置編號 "
Set n = Nothing
Exit Sub
End If
n.configid = CInt(CmbConfigID.Text)
n.buytime = Date
n.brand = txtBrand.Text
n.value = CCur(txtvalue.Text)
n.ccount = CInt(txtccount.Text)
n.bargainor = txtbargainor.Text
n.linkman = txtlinkman.Text
If txtsaftyear.Text <> "" Then
n.safttime = CInt(txtsaftyear.Text)
End If
If txtsaftmonth.Text <> "" Then
n.safttime = n.safttime + CInt(txtsaftmonth.Text) / 12
End If
n.tel = txttel.Text
n.memo = txtmemo.Text
If cmbStoreID.Text = "" Then
MsgBox "沒有選擇存放地點"
Set n = Nothing
Exit Sub
End If
n.STOREID = Trim(cmbStoreID.Text)
n.Modify
Set n = Nothing
End If
End Sub
Private Sub CmdQuery_Click()
If CmdQuery.Caption = "查詢" Then
Form_Init
CmdQuery.Caption = "提交"
Me.cmdAdd.Enabled = False
CmdModify.Enabled = False
Else
'讓frmeselect顯示所有新設備
frmeselect.Show
frmeselect.MHFGNewEquipment.Rows = 2
frmeselect.MHFGShow
CmdQuery.Caption = "查詢"
Me.cmdAdd.Enabled = True
CmdModify.Enabled = True
End If
End Sub
Private Sub cmdstroreidquery_Click()
frmStore.Show
End Sub
Private Sub Form_Load()
frmeselect.Show
frmeselect.Visible = False
CmbConfigIDShow
CmbStoreidShow
End Sub
Private Sub Form_Init()
Me.txtbargainor.Text = ""
Me.txtBrand.Text = ""
Me.txtccount.Text = ""
Me.txtvalue = ""
Me.txtmemo.Text = ""
Me.txtname.Text = ""
Me.txtsaftmonth.Text = ""
Me.txtsaftyear.Text = ""
Me.txtlinkman.Text = ""
Me.txttel.Text = ""
Me.CmbConfigID = ""
Me.cmbStoreID = ""
End Sub
Private Sub Form_Paint()
frmeselect.Top = Me.Top
frmeselect.Left = Me.Left + Me.Width
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload frmeselect
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -