📄 frmconproductedit.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmConProductEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑合同产品信息"
ClientHeight = 4905
ClientLeft = 45
ClientTop = 345
ClientWidth = 6510
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4905
ScaleWidth = 6510
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3385
MouseIcon = "FrmConProductEdit.frx":0000
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 5
Top = 4320
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 1825
MouseIcon = "FrmConProductEdit.frx":030A
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 4
Top = 4320
Width = 1300
End
Begin VB.Frame Frame1
Height = 3855
Left = 240
TabIndex = 6
Top = 240
Width = 6015
Begin MSComCtl2.DTPicker DTDate
Height = 270
Left = 4320
TabIndex = 22
Top = 2115
Width = 1455
_ExtentX = 2566
_ExtentY = 476
_Version = 393216
Format = 24838145
CurrentDate = 38690
End
Begin VB.TextBox txtMemo
Height = 1095
Left = 1320
MaxLength = 100
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 2640
Width = 4455
End
Begin VB.ComboBox ComboProId
Height = 300
Left = 1320
Style = 2 'Dropdown List
TabIndex = 0
Top = 180
Width = 1455
End
Begin VB.TextBox txtUnitPrice
Height = 270
Left = 1320
MaxLength = 20
TabIndex = 1
Top = 1635
Width = 1455
End
Begin VB.TextBox txtQuantity
Height = 270
Left = 4320
MaxLength = 50
TabIndex = 2
Top = 1635
Width = 1455
End
Begin VB.Label Lable16
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注"
Height = 180
Left = 240
TabIndex = 21
Top = 2640
Width = 360
End
Begin VB.Label lblAmount
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblAmount"
Height = 180
Left = 1320
TabIndex = 20
Top = 2160
Width = 810
End
Begin VB.Label Label13
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "交货日期"
Height = 180
Left = 3240
TabIndex = 19
Top = 2160
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "订货金额"
Height = 180
Left = 240
TabIndex = 18
Top = 2160
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品数量"
Height = 180
Left = 3240
TabIndex = 17
Top = 1680
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品单价"
Height = 180
Left = 240
TabIndex = 16
Top = 1680
Width = 720
End
Begin VB.Label lblUnit
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblUnit"
Height = 180
Left = 4320
TabIndex = 15
Top = 1200
Width = 630
End
Begin VB.Label lblStyle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblStyle"
Height = 180
Left = 1320
TabIndex = 14
Top = 1200
Width = 720
End
Begin VB.Label lblMark
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblMark"
Height = 180
Left = 4320
TabIndex = 13
Top = 720
Width = 630
End
Begin VB.Label lblProName
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "lblProName"
Height = 180
Left = 1320
TabIndex = 12
Top = 720
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "计量单位"
Height = 180
Left = 3240
TabIndex = 11
Top = 1200
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品型号"
Height = 180
Left = 240
TabIndex = 10
Top = 1200
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品编号"
Height = 180
Left = 240
TabIndex = 9
Top = 240
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品名称"
Height = 180
Left = 240
TabIndex = 8
Top = 720
Width = 720
End
Begin VB.Label Label12
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品商标"
Height = 180
Left = 3240
TabIndex = 7
Top = 720
Width = 720
End
End
End
Attribute VB_Name = "FrmConProductEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As String
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim TmpId As String
If ComboProId.Text = "" Then
MsgBox "请选择产品编号"
Exit Sub
End If
If Val(txtUnitPrice) < 0 Then
MsgBox "产品单价应大于0"
Exit Sub
End If
If Val(txtQuantity) < 0 Then
MsgBox "产品数量应大于0"
Exit Sub
End If
TmpId = TrimStr(ComboProId.Text)
'判断产品编号是否已经存在
If Modify = False Or OriId <> TmpId Then
If MyConPro.In_DB(MyContract.ContractId, TmpId) = True Then
MsgBox "合同编号 - " + MyContract.ContractId + " - 产品编号 - " + txtId + " - 已经存在,请重新输入"
ComboProId.SetFocus
Exit Sub
End If
End If
With MyConPro
.ContractId = MyContract.ContractId
.ProId = ComboProId.Text
.UnitPrice = Val(txtUnitPrice)
.Quantity = Val(txtQuantity)
.DeliveryDate = Format(DTDate.Value, "yyyy-mm-dd")
.Memo = MakeStr(txtMemo)
If Modify = False Then
.Insert
Else
Call .Update(MyContract.ContractId, OriId)
End If
End With
Unload Me
End Sub
Private Sub ComboProId_Click()
MyPro.GetInfo (ComboProId.Text)
lblProName = MyPro.ProName
lblMark = MyPro.ProMark
lblStyle = MyPro.ProStyle
lblUnit = MyPro.ProUnit
End Sub
Private Sub Form_Load()
MyPro.Load_ProId
'把产品编号添加到ComboProId中
i = 0
Do While Arr_ProId(i) <> ""
ComboProId.AddItem Arr_ProId(i)
i = i + 1
Loop
If Modify = False Then
If ComboProId.ListCount > 0 Then
ComboProId.ListIndex = 0
End If
Else
If OriId <> "" And InCombo(OriId, ComboProId) = True Then
ComboProId.Text = OriId
End If
End If
lblAmount = Val(txtUnitPrice) * Val(txtQuantity)
End Sub
Private Sub txtName_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
Private Sub txtQuantity_Change()
lblAmount = Val(txtUnitPrice) * Val(txtQuantity)
End Sub
Private Sub txtQuantity_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub txtUnitPrice_Change()
lblAmount = Val(txtUnitPrice) * Val(txtQuantity)
End Sub
Private Sub txtUnitPrice_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -