⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtakeoutedit.frm

📁 本系统为汽车销售系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Text            =   " "
         Top             =   1560
         Width           =   1575
      End
      Begin VB.TextBox txtcode 
         Height          =   375
         Left            =   3480
         TabIndex        =   6
         Text            =   " "
         Top             =   960
         Width           =   1335
      End
      Begin VB.TextBox txtcontact 
         DataSource      =   "select contact from client"
         Height          =   615
         Left            =   840
         TabIndex        =   4
         Text            =   " "
         Top             =   2280
         Width           =   3855
      End
      Begin VB.ComboBox Comboclt 
         DataSource      =   "Adodc1"
         Height          =   300
         Left            =   960
         TabIndex        =   2
         Top             =   360
         Width           =   3855
      End
      Begin VB.Label Label5 
         Caption         =   "联系电话"
         Height          =   255
         Left            =   2640
         TabIndex        =   9
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   "通信地址"
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   2520
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "邮政编码"
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   1680
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "联 系 人"
         Height          =   375
         Left            =   120
         TabIndex        =   3
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "客户单位"
         Height          =   375
         Left            =   120
         TabIndex        =   1
         Top             =   480
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmtakeoutedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriId As Long
'客户信息
Public OriClt As String
Public OriCltType As Integer
'产品信息
Public OriType1, OriType2 As String
Public OriPro As String
'仓库信息
Public OriStore As String

Private Sub Fill_Clt()
  If Comboclt.Text = "" Then
    txtcontact = ""
    txtaddr = ""
    txtcode = ""
    txtphone = ""
  Else
    MyClt.GetInfo (MyClt.GetId(Comboclt.Text))
    txtcontact = MyClt.Contact
    txtaddr = MyClt.Address
    txtcode = MyClt.Postcode
    txtphone = MyClt.Phone
  End If
End Sub

Private Sub Fill_Pro()
  If Combopro.Text = "" Then
    txtStyle = ""
    txtunit = ""
    txtprice = ""
  Else
    MyPro.GetInfo (MyPro.GetId(Combopro.Text))
    txtunit = MyPro.ProUnit
    txtprice = MyPro.ProPrice
  End If
  
  Fill_Pronum
End Sub

Private Sub Fill_Pronum()
  Dim TmpProId, TmpStoreId As Long
  TmpProId = MyPro.GetId(Combopro.Text)
  TmpStoreId = MyStore.GetId(Combostore.Text)
  lblNum = MyProInStore.GetSumPro(TmpStoreId, TmpProId)
End Sub

Private Function Check() As Boolean
  If Trim(Comboclt.Text) = "" Then
    MsgBox "请选择客户单位"
    Check = False
    Exit Function
  End If
  If Trim(Combopro.Text) = "" Then
    MsgBox "请选择产品名称"
    Check = False
    Exit Function
  End If
  If txtnum = "" Then
    MsgBox "请输入产品数量"
    txtnum.SetFocus
    Check = False
    Exit Function
  End If
  If Combostore.Text = "" Then
    MsgBox "请选择存储的仓库"
    Check = False
    Exit Function
  End If
  If Val(txtnum) > Val(lblNum) Then
    MsgBox "出库数量不能大于库存数量"
    Exit Function
  End If
  
  Check = True
End Function

Private Sub cmd_ok_Click()
  Dim TmpId As Long
  Dim TmpNum As Integer
  
  If Check = False Then
    Exit Sub
  End If
  
  With MyTakeout
  .ProId = MyPro.GetId(Combopro.Text)
  .ProPrice = Val(txtprice1)
  .ProNum = Val(txtnum)
  .ClientId = MyClt.GetId(Comboclt.Text)
  .StoreId = MyStore.GetId(Combostore.Text)
  .empname = CurUser.empname
  .OptDate = Format(Now, "yyyy-mm-dd")
  
  .Insert
  
  '从仓库中提取产品
  Call MyProInStore.LoadPro(.StoreId, .ProId)
  TmpNum = Val(txtnum)
  i = 0
  Do While TmpNum > 0
    If TmpNum > Arr_StoreProNum(i) Then
      TmpNum = TmpNum - Arr_StoreProNum(i)
      MyProInStore.ProNum = 0
    Else
      MyProInStore.ProNum = Arr_StoreProNum(i) - TmpNum
      TmpNum = 0
    End If
    MyProInStore.Update (Arr_StoreProId(i))
    i = i + 1
  Loop
  
  MsgBox "完成出库操作"
  End With
  
  Unload Me
End Sub

Private Sub cmd_cancel_Click()
  Unload Me
End Sub

Private Sub ComboClt_Click()
  Fill_Clt
End Sub

Private Sub ComboPro_Click()
  Fill_Pro
End Sub

Private Sub ComboStore_Click()
  Fill_Pronum
End Sub





  '装入产品名称
  TmpType = MyProType.GetId(ComboType2.Text)
  MyPro.Load_by_Type (TmpType)
  Combopro.Clear
  i = 0
  Do While Arr_Product(i) <> ""
    Combopro.AddItem Arr_Product(i)
    i = i + 1
  Loop
  If Combopro.ListCount > 0 Then
    Combopro.ListIndex = 0
  End If
  Fill_Pro
End Sub


Private Sub Form_Load()
  Dim TmpType As Long
  Dim i As Integer
  
  If Modify = True Then
    OriId = frmtakeoutman.Adodc1.Recordset.Fields(0)
    If InCombo(Trim(frmtakeoutman.Adodc1.Recordset.Fields(2)), ComboTakeoutType) = True Then
      ComboTakeoutType.Text = Trim(frmtakeoutman.Adodc1.Recordset.Fields(2))
    End If
    '读取产品名称和类目
    OriPro = Trim(frmtakeoutman.Adodc1.Recordset.Fields(3))
    MyPro.GetInfo (MyPro.GetId(Trim(frmtakeoutman.Adodc1.Recordset.Fields(3))))
    OriType2 = MyProType.GetName(MyPro.TypeId)
    MyProType.GetInfo (MyPro.TypeId)
    OriType1 = MyProType.GetName(MyProType.UpperId)
    Combopro.Enabled = False
   
    
    ComboCreateDate.Text = Trim(frmtakeoutman.Adodc1.Recordset.Fields(5))
    txtprice1 = frmtakeoutman.Adodc1.Recordset.Fields(6)
    txtnum = frmtakeoutman.Adodc1.Recordset.Fields(7)
    OriClt = Trim(frmtakeoutman.Adodc1.Recordset.Fields(8))
    MyClt.GetInfo (MyClt.GetId(Trim(frmtakeoutman.Adodc1.Recordset.Fields(8))))
    Comboclt.Enabled = False
    ComboType.Enabled = False
    txtprice1.Enabled = False
    ComboTakeoutType.Enabled = False
    ComboCreateDate.Enabled = False
        
    OriStore = Trim(frmtakeoutman.Adodc1.Recordset.Fields(9))
    lblEmpName = Trim(frmtakeoutman.Adodc1.Recordset.Fields(10))
    lbloptDate = Trim(frmtakeoutman.Adodc1.Recordset.Fields(11))
    Combostore.Enabled = False
  End If
  
  '装入客户数据
  'ComboType.ListIndex = OriCltType - 1
  MyClt.Load_Client (OriCltType)
  i = 0
  Comboclt.Clear
  Do While Arr_Client(i) <> ""
    Comboclt.AddItem Arr_Client(i)
    i = i + 1
  Loop
  If Modify = False Then
    If Comboclt.ListCount > 0 Then
      Comboclt.ListIndex = 0
    End If
  Else
    If InCombo(OriClt, Comboclt) = True Then
      Comboclt.Text = OriClt
    End If
  End If
  Fill_Clt
  
 
End Sub


Private Sub txtNum_Change()
  txtAmount = Val(txtprice1) * Val(txtnum)
End Sub

Private Sub txtNum_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Int(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtPos_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtPrice1_Change()
  txtAmount = Val(txtprice1) * Val(txtnum)
End Sub

Private Sub txtPrice1_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 + -