frmcommodityinsert.frm
来自「很好! 很实用! 免费!」· FRM 代码 · 共 824 行 · 第 1/2 页
FRM
824 行
Left = 840
TabIndex = 17
Top = 2160
Width = 855
_ExtentX = 1508
_ExtentY = 556
BorderStyle = 1
End
Begin VB.CheckBox ckInventory
Caption = "检测库存销售"
Height = 255
Left = 6240
TabIndex = 15
Top = 2820
Width = 1455
End
Begin VB.TextBox txtPArea
Height = 315
Left = 840
TabIndex = 14
Top = 1200
Width = 3015
End
Begin VB.TextBox txtItem
Height = 315
Left = 6600
TabIndex = 12
Top = 720
Width = 3135
End
Begin VB.TextBox txtManufacture
Height = 315
Left = 840
TabIndex = 10
Top = 720
Width = 5055
End
Begin VB.CheckBox ckNew
Caption = "新品"
Height = 255
Left = 9000
TabIndex = 8
Top = 300
Width = 735
End
Begin VB.ComboBox cbStatus
Height = 315
Left = 7440
TabIndex = 7
Top = 240
Width = 1335
End
Begin VB.ComboBox cbGrade
Height = 315
Left = 5880
TabIndex = 5
Top = 240
Width = 975
End
Begin VB.TextBox txtCode
Height = 315
Left = 3600
TabIndex = 3
Top = 240
Width = 1575
End
Begin VB.TextBox txtClass
Enabled = 0 'False
Height = 315
Left = 840
TabIndex = 1
Top = 240
Width = 1815
End
Begin VB.Line Line1
X1 = 2160
X2 = 7680
Y1 = 3240
Y2 = 3240
End
Begin VB.Label lblSalePrice
AutoSize = -1 'True
Caption = "最低售价"
Height = 195
Left = 3960
TabIndex = 38
Top = 2880
Width = 720
End
Begin VB.Label lblPurchasePrice
AutoSize = -1 'True
Caption = "最高进价"
Height = 195
Left = 2400
TabIndex = 36
Top = 2880
Width = 720
End
Begin VB.Label lblCubageUnit
AutoSize = -1 'True
Caption = "体积单位"
Height = 195
Left = 6120
TabIndex = 34
Top = 1800
Width = 720
End
Begin VB.Label lblCubage
AutoSize = -1 'True
Caption = "体积"
Height = 195
Left = 4680
TabIndex = 32
Top = 1800
Width = 360
End
Begin VB.Label lblWeightUnit
AutoSize = -1 'True
Caption = "重量单位"
Height = 195
Left = 3000
TabIndex = 30
Top = 1800
Width = 720
End
Begin VB.Label lblWeight
AutoSize = -1 'True
Caption = "重量"
Height = 195
Left = 1800
TabIndex = 27
Top = 1800
Width = 360
End
Begin VB.Label lblUnit
AutoSize = -1 'True
Caption = "单位"
Height = 195
Left = 120
TabIndex = 26
Top = 1800
Width = 360
End
Begin VB.Label lblPackage
AutoSize = -1 'True
Caption = "商品包装"
Height = 195
Left = 3840
TabIndex = 24
Top = 1320
Width = 720
End
Begin VB.Label lblSaleTax
AutoSize = -1 'True
Caption = "销项税"
Height = 195
Left = 5520
TabIndex = 23
Top = 2280
Width = 540
End
Begin VB.Label lblPurchaseTax
AutoSize = -1 'True
Caption = "进项税"
Height = 195
Left = 3840
TabIndex = 20
Top = 2280
Width = 540
End
Begin VB.Label lblSaleBatch
AutoSize = -1 'True
Caption = "销售批量"
Height = 195
Left = 1800
TabIndex = 18
Top = 2280
Width = 720
End
Begin VB.Label lblPurchaseBatch
AutoSize = -1 'True
Caption = "采购批量"
Height = 195
Left = 120
TabIndex = 16
Top = 2280
Width = 720
End
Begin VB.Label lblPArea
AutoSize = -1 'True
Caption = "产地"
Height = 195
Left = 120
TabIndex = 13
Top = 1320
Width = 360
End
Begin VB.Label lblItem
AutoSize = -1 'True
Caption = "型号"
Height = 195
Left = 6120
TabIndex = 11
Top = 840
Width = 360
End
Begin VB.Label lblManufacture
AutoSize = -1 'True
Caption = "制造商"
Height = 195
Left = 120
TabIndex = 9
Top = 840
Width = 540
End
Begin VB.Label lbStatus
AutoSize = -1 'True
Caption = "状态"
Height = 195
Left = 6960
TabIndex = 6
Top = 360
Width = 360
End
Begin VB.Label lblGrade
AutoSize = -1 'True
Caption = "评级"
Height = 195
Left = 5400
TabIndex = 4
Top = 360
Width = 360
End
Begin VB.Label lblCode
AutoSize = -1 'True
Caption = "商品编号"
Height = 195
Left = 2760
TabIndex = 2
Top = 360
Width = 720
End
Begin VB.Label lblClass
AutoSize = -1 'True
Caption = "商品类"
Enabled = 0 'False
Height = 195
Left = 120
TabIndex = 0
Top = 360
Width = 540
End
End
Attribute VB_Name = "frmCommodityInsert"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public sClassID As String
Public sClassNo As String
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 = newGUID()
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 .Insert() 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
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 + =
减小字号Ctrl + -
显示快捷键?