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

📄 frm_saleedit.frm

📁 Visual Basic + Oracle 9i数据库应用系统开发与实例(企业购销存管理系统)界面简洁,数据库完整,还不错~适合学生利用和使用!
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Height          =   270
         Left            =   4320
         MaxLength       =   20
         TabIndex        =   1
         Top             =   2040
         Width           =   1455
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "邮政编码"
         Height          =   180
         Left            =   3240
         TabIndex        =   18
         Top             =   1215
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "通信地址"
         Height          =   180
         Left            =   240
         TabIndex        =   17
         Top             =   1215
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "客户单位"
         Height          =   180
         Left            =   240
         TabIndex        =   16
         Top             =   360
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "客户类别"
         Height          =   180
         Left            =   240
         TabIndex        =   15
         Top             =   780
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "联系人"
         Height          =   180
         Left            =   3240
         TabIndex        =   14
         Top             =   780
         Width           =   540
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "联系电话"
         Height          =   180
         Left            =   240
         TabIndex        =   13
         Top             =   1635
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "传真电话"
         Height          =   180
         Left            =   3240
         TabIndex        =   12
         Top             =   1635
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "开户银行"
         Height          =   180
         Left            =   240
         TabIndex        =   11
         Top             =   2085
         Width           =   720
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "银行帐户"
         Height          =   180
         Left            =   3240
         TabIndex        =   10
         Top             =   2085
         Width           =   720
      End
   End
End
Attribute VB_Name = "Frm_SaleEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
'客户信息
Public OriClt As String
Public OriCltType As Integer
'产品信息
Public OriType1, OriType2 As String
Public OriPro As String
'类型(销售单/销售退货单)
Public OriType As String

Private Sub Fill_Clt()
  If ComboClt.Text = "" Then
    txtContact = ""
    txtAddr = ""
    txtCode = ""
    txtPhone = ""
    txtFax = ""
    txtBank = ""
    txtAccount = ""
  Else
    MyClt.GetInfo (MyClt.GetId(ComboClt.Text))
    txtContact = MyClt.Contact
    txtAddr = MyClt.Address
    txtCode = MyClt.Postcode
    txtPhone = MyClt.Phone
    txtFax = MyClt.Fax
    txtBank = MyClt.Bank
    txtAccount = MyClt.BankAccount
  End If
End Sub

Private Sub Fill_Pro()
  If ComboPro.Text = "" Then
    txtStyle = ""
    txtUnit = ""
    txtPrice = ""
    txtMin = ""
    txtMax = ""
  Else
    MyPro.GetInfo (MyPro.GetId(ComboPro.Text))
    txtStyle = MyPro.ProStyle
    txtUnit = MyPro.ProUnit
    txtPrice = MyPro.ProPrice
    txtMin = MyPro.ProLow
    txtMax = MyPro.ProHigh
  End If
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
  
  Check = True
End Function

Private Sub Cmd_OK_Click()
  Dim TmpId As Long
  
  If Check = False Then
    Exit Sub
  End If
  
  With MySales
  .SaleType = OriType
  .ProId = MyPro.GetId(ComboPro.Text)
  .ProPrice = Val(txtPrice1)
  .ProNum = Val(txtNum)
  .ProAmount = Val(txtAmount)
  .ClientId = MyClt.GetId(ComboClt.Text)
  .EmpName = CurUser.EmpName
  .OptDate = Format(Now, "yyyy-mm-dd")
  
  If Modify = False Then
    .Insert
  Else
    .Update (OriId)
  End If
  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 ComboType_Click()
  '装入客户数据
  MyClt.Load_Client (ComboType.ListIndex + 1)
  ComboClt.Clear
  i = 0
  Do While Arr_Client(i) <> ""
    ComboClt.AddItem Arr_Client(i)
    i = i + 1
  Loop
  If ComboClt.ListCount > 0 Then
    ComboClt.ListIndex = 0
  End If
 
  Fill_Clt
End Sub

Private Sub ComboType1_Click()
  '装入二级类目
  TmpType = MyProType.GetId(ComboType1.Text)
  MyProType.Load_by_Upper (TmpType)
  ComboType2.Clear
  i = 0
  Do While Arr_ProType(i) <> ""
    ComboType2.AddItem Arr_ProType(i)
    i = i + 1
  Loop
  If ComboType2.ListCount > 0 Then
    ComboType2.ListIndex = 0
  End If
  '装入产品名称
  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 ComboType2_Click()
  '装入产品名称
  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 = Frm_SaleMan.Adodc1.Recordset.Fields(0)
    lblStatus = Frm_SaleMan.ComboType.Text
    '读取产品名称和类目
    OriPro = Trim(Frm_SaleMan.Adodc1.Recordset.Fields(1))
    MyPro.GetInfo (MyPro.GetId(Trim(Frm_SaleMan.Adodc1.Recordset.Fields(1))))
    OriType2 = MyProType.GetName(MyPro.TypeId)
    MyProType.GetInfo (MyPro.TypeId)
    OriType1 = MyProType.GetName(MyProType.UpperId)
    ComboPro.Enabled = False
    ComboType1.Enabled = False
    ComboType2.Enabled = False
    
    txtPrice1 = Frm_SaleMan.Adodc1.Recordset.Fields(3)
    txtNum = Frm_SaleMan.Adodc1.Recordset.Fields(4)
    txtAmount = Frm_SaleMan.Adodc1.Recordset.Fields(5)
    OriClt = Trim(Frm_SaleMan.Adodc1.Recordset.Fields(6))
    MyClt.GetInfo (MyClt.GetId(Trim(Frm_SaleMan.Adodc1.Recordset.Fields(6))))
    OriCltType = MyClt.ClientType
    ComboClt.Enabled = False
    ComboType.Enabled = False
    
    lblEmpName = Trim(Frm_SaleMan.Adodc1.Recordset.Fields(7))
    lblOptDate = Trim(Frm_SaleMan.Adodc1.Recordset.Fields(8))
  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
  
  '装入产品信息
  '装入一级类目
  MyProType.Load_by_Upper (0)
  i = 0
  ComboType1.Clear
  Do While Arr_ProType(i) <> ""
    ComboType1.AddItem Arr_ProType(i)
    i = i + 1
  Loop
  If OriType1 = "" Then
    If ComboType1.ListCount > 0 Then
      ComboType1.ListIndex = 0
    End If
  Else
    If InCombo(OriType1, ComboType1) = True Then
      ComboType1.Text = OriType1
    End If
  End If
  '装入二级类目
  TmpType = MyProType.GetId(ComboType1.Text)
  MyProType.Load_by_Upper (TmpType)
  ComboType2.Clear
  i = 0
  Do While Arr_ProType(i) <> ""
    ComboType2.AddItem Arr_ProType(i)
    i = i + 1
  Loop
  If OriType2 = "" Then
    If ComboType2.ListCount > 0 Then
      ComboType2.ListIndex = 0
    End If
  Else
    If InCombo(OriType2, ComboType2) = True Then
      ComboType2.Text = OriType2
    End If
  End If
  '装入产品名称
  TmpType = MyProType.GetId(ComboType2.Text)
  MyPro.Load_by_Type (TmpType)
  i = 0
  ComboPro.Clear
  Do While Arr_Product(i) <> ""
    ComboPro.AddItem Arr_Product(i)
    i = i + 1
  Loop
  If OriPro = "" Then
    If ComboPro.ListCount > 0 Then
      ComboPro.ListIndex = 0
    End If
  Else
    If InCombo(OriPro, ComboPro) = True Then
      ComboPro.Text = OriPro
    End If
  End If
  Fill_Pro
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 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 + -