📄 frmcommodityupdate.frm
字号:
_ExtentX = 1508
_ExtentY = 556
BorderStyle = 1
End
Begin ClassSystem.InputNumber txtSaleTax
Height = 315
Left = 6240
TabIndex = 19
Top = 2160
Width = 1095
_ExtentX = 1931
_ExtentY = 556
BorderStyle = 1
End
Begin ClassSystem.InputNumber txtPurchaseTax
Height = 315
Left = 4440
TabIndex = 20
Top = 2160
Width = 975
_ExtentX = 1720
_ExtentY = 556
BorderStyle = 1
End
Begin ClassSystem.InputNumber txtSaleBatch
Height = 315
Left = 2640
TabIndex = 21
Top = 2160
Width = 1095
_ExtentX = 1931
_ExtentY = 556
BorderStyle = 1
End
Begin ClassSystem.InputNumber txtPurchaseBatch
Height = 315
Left = 840
TabIndex = 22
Top = 2160
Width = 855
_ExtentX = 1508
_ExtentY = 556
BorderStyle = 1
End
Begin VB.Label lblClass
AutoSize = -1 'True
Caption = "商品类"
Enabled = 0 'False
Height = 195
Left = 120
TabIndex = 50
Top = 360
Width = 540
End
Begin VB.Label lblCode
AutoSize = -1 'True
Caption = "商品编号"
Height = 195
Left = 2760
TabIndex = 49
Top = 360
Width = 720
End
Begin VB.Label lblGrade
AutoSize = -1 'True
Caption = "评级"
Height = 195
Left = 5400
TabIndex = 48
Top = 360
Width = 360
End
Begin VB.Label lbStatus
AutoSize = -1 'True
Caption = "状态"
Height = 195
Left = 6960
TabIndex = 47
Top = 360
Width = 360
End
Begin VB.Label lblManufacture
AutoSize = -1 'True
Caption = "制造商"
Height = 195
Left = 120
TabIndex = 46
Top = 840
Width = 540
End
Begin VB.Label lblItem
AutoSize = -1 'True
Caption = "型号"
Height = 195
Left = 6120
TabIndex = 45
Top = 840
Width = 360
End
Begin VB.Label lblPArea
AutoSize = -1 'True
Caption = "产地"
Height = 195
Left = 120
TabIndex = 44
Top = 1320
Width = 360
End
Begin VB.Label lblPurchaseBatch
AutoSize = -1 'True
Caption = "采购批量"
Height = 195
Left = 120
TabIndex = 43
Top = 2280
Width = 720
End
Begin VB.Label lblSaleBatch
AutoSize = -1 'True
Caption = "销售批量"
Height = 195
Left = 1800
TabIndex = 42
Top = 2280
Width = 720
End
Begin VB.Label lblPurchaseTax
AutoSize = -1 'True
Caption = "进项税"
Height = 195
Left = 3840
TabIndex = 41
Top = 2280
Width = 540
End
Begin VB.Label lblSaleTax
AutoSize = -1 'True
Caption = "销项税"
Height = 195
Left = 5520
TabIndex = 40
Top = 2280
Width = 540
End
Begin VB.Label lblPackage
AutoSize = -1 'True
Caption = "商品包装"
Height = 195
Left = 3840
TabIndex = 39
Top = 1320
Width = 720
End
Begin VB.Label lblUnit
AutoSize = -1 'True
Caption = "单位"
Height = 195
Left = 120
TabIndex = 38
Top = 1800
Width = 360
End
Begin VB.Label lblWeight
AutoSize = -1 'True
Caption = "重量"
Height = 195
Left = 1800
TabIndex = 37
Top = 1800
Width = 360
End
Begin VB.Label lblWeightUnit
AutoSize = -1 'True
Caption = "重量单位"
Height = 195
Left = 3000
TabIndex = 36
Top = 1800
Width = 720
End
Begin VB.Label lblCubage
AutoSize = -1 'True
Caption = "体积"
Height = 195
Left = 4680
TabIndex = 35
Top = 1800
Width = 360
End
Begin VB.Label lblCubageUnit
AutoSize = -1 'True
Caption = "体积单位"
Height = 195
Left = 6120
TabIndex = 34
Top = 1800
Width = 720
End
Begin VB.Label lblPurchasePrice
AutoSize = -1 'True
Caption = "最高进价"
Height = 195
Left = 2400
TabIndex = 33
Top = 2880
Width = 720
End
Begin VB.Label lblSalePrice
AutoSize = -1 'True
Caption = "最低售价"
Height = 195
Left = 3960
TabIndex = 32
Top = 2880
Width = 720
End
Begin VB.Line Line1
X1 = 2160
X2 = 7680
Y1 = 3240
Y2 = 3240
End
End
Attribute VB_Name = "frmCommodityUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public sClassID As String
Public sItemID As String
Public sClassNo As String
Private Sub ShowData()
Dim objCommodity As New clsCommodity
Call objCommodity.FillByID(sItemID)
With objCommodity
sClassID = .m_ClassID
sClassNo = .m_ClassNo
txtCode.Text = .m_Code
txtCubage.Text = .m_Cubage
txtCubageUnit.Text = .m_CubageUnit
txtDescription.Text = .m_Description
cbGrade.Text = .m_Grade
sItemID = .m_ID
If .m_Inventory = "要检测" Then
ckInventory.value = 1
Else
ckInventory.value = 0
End If
txtItem.Text = .m_Item
txtManufacture.Text = .m_Manufacture
If .m_New = "新品" Then
ckNew.value = 1
Else
ckNew.value = 0
End If
txtPackage.Text = .m_Package
txtPArea.Text = .m_PArea
sfPhoto1.Text = .m_Photo1
Photo1.Picture = LoadPicture(sfPhoto1.Text)
sfPhoto2.Text = .m_Photo2
Photo2.Picture = LoadPicture(sfPhoto2.Text)
txtPurchaseBatch.Text = .m_PurchaseBatch
txtPurchasePrice.Text = .m_PurchasePrice
txtPurchaseTax.Text = .m_PurchaseTax
txtSaleBatch.Text = .m_SaleBatch
txtSalePrice.Text = .m_SalePrice
txtSaleTax.Text = .m_SaleTax
cbStatus.Text = .m_Status
txtUnit.Text = .m_Unit
txtWeight.Text = .m_Weight
txtWeightUnit.Text = .m_WeightUnit
Text1.Text = .m_F11
Text2.Text = .m_F12
Text3.Text = .m_F13
Text4.Text = .m_F14
Text5.Text = .m_F15
Text6.Text = .m_F16
Text7.Text = .m_F17
Text8.Text = .m_F18
Text9.Text = .m_F19
Text10.Text = .m_F20
End With
Set objCommodity = Nothing
End Sub
Private Function SaveData() As Boolean
Dim objCommodity As New clsCommodity
With objCommodity
.m_ClassID = sClassID
.m_ClassNo = sClassNo
.m_Code = txtCode.Text
.m_Cubage = txtCubage.Text
.m_CubageUnit = txtCubageUnit.Text
.m_Description = txtDescription.Text
.m_Grade = cbGrade.Text
.m_ID = sItemID
If ckInventory.value Then
.m_Inventory = "要检测"
Else
.m_Inventory = "不检测"
End If
.m_Item = txtItem.Text
.m_Manufacture = txtManufacture.Text
If ckNew.value Then
.m_New = "新品"
Else
.m_New = "原有"
End If
.m_Package = txtPackage.Text
.m_PArea = txtPArea.Text
.m_Photo1 = sfPhoto1.Text
.m_Photo2 = sfPhoto2.Text
.m_PurchaseBatch = txtPurchaseBatch.Text
.m_PurchasePrice = txtPurchasePrice.Text
.m_PurchaseTax = txtPurchaseTax.Text
.m_SaleBatch = txtSaleBatch.Text
.m_SalePrice = txtSalePrice.Text
.m_SaleTax = txtSaleTax.Text
.m_Status = cbStatus.Text
.m_Unit = txtUnit.Text
.m_Weight = txtWeight.Text
.m_WeightUnit = txtWeightUnit.Text
.m_F11 = Text1.Text
.m_F12 = Text2.Text
.m_F13 = Text3.Text
.m_F14 = Text4.Text
.m_F15 = Text5.Text
.m_F16 = Text6.Text
.m_F17 = Text7.Text
.m_F18 = Text8.Text
.m_F19 = Text9.Text
.m_F20 = Text10.Text
If .Update() Then
SaveData = True
Else
SaveData = False
End If
End With
Set objCommodity = Nothing
End Function
Private Sub cmdApply_Click()
If SaveData() Then
Call frmCommodity.RefreshData
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If SaveData() Then
Unload Me
Call frmCommodity.RefreshData
End If
End Sub
Private Sub Form_Load()
cbGrade.AddItem "A"
cbGrade.AddItem "B"
cbGrade.AddItem "C"
cbGrade.ListIndex = 0
cbStatus.AddItem "潜在"
cbStatus.AddItem "正式"
cbStatus.AddItem "淘汰"
cbStatus.ListIndex = 0
sfPhoto1.Filter = "JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif| BMP (*.bmp)|*.bmp "
sfPhoto2.Filter = "JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif| BMP (*.bmp)|*.bmp "
Dim rsPro As New ADODB.Recordset
Dim sSQL As String
sSQL = "select [Name], [FieldName] from bcCommodityClassProperty where ClassID=" + CheckString(sClassID) + " order by FieldName"
Set rsPro = g_cn.Execute(sSQL)
Do While Not rsPro.EOF
Select Case rsPro.Fields("FieldName").value
Case "F11"
Text1.Visible = True
Label1.Visible = True
Label1.Caption = rsPro.Fields("Name").value
Case "F12"
Text2.Visible = True
Label2.Visible = True
Label2.Caption = rsPro.Fields("Name").value
Case "F13"
Text3.Visible = True
Label3.Visible = True
Label3.Caption = rsPro.Fields("Name").value
Case "F14"
Text4.Visible = True
Label4.Visible = True
Label4.Caption = rsPro.Fields("Name").value
Case "F15"
Text5.Visible = True
Label5.Visible = True
Label5.Caption = rsPro.Fields("Name").value
Case "F16"
Text6.Visible = True
Label6.Visible = True
Label6.Caption = rsPro.Fields("Name").value
Case "F17"
Text7.Visible = True
Label7.Visible = True
Label7.Caption = rsPro.Fields("Name").value
Case "F18"
Text8.Visible = True
Label8.Visible = True
Label8.Caption = rsPro.Fields("Name").value
Case "F19"
Text9.Visible = True
Label9.Visible = True
Label9.Caption = rsPro.Fields("Name").value
Case "F20"
Text10.Visible = True
Label10.Visible = True
Label10.Caption = rsPro.Fields("Name").value
End Select
rsPro.MoveNext
Loop
Call ShowData
End Sub
Private Sub sfPhoto1_SelectFile()
Photo1.Picture = LoadPicture(sfPhoto1.Text)
End Sub
Private Sub sfPhoto2_SelectFile()
Photo2.Picture = LoadPicture(sfPhoto2.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -