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

📄 frm_orderedit.frm

📁 Visual Basic + Oracle 9i数据库应用系统开发与实例(企业购销存管理系统)界面简洁,数据库完整,还不错~适合学生利用和使用!
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Height          =   180
         Left            =   240
         TabIndex        =   12
         Top             =   420
         Width           =   720
      End
      Begin VB.Label Label23 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "商品单价"
         Height          =   180
         Left            =   3240
         TabIndex        =   11
         Top             =   420
         Width           =   720
      End
      Begin VB.Label lblStatus 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "lblStatus"
         Height          =   180
         Left            =   1320
         TabIndex        =   10
         Top             =   420
         Width           =   810
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "采购日期"
         Height          =   180
         Left            =   3240
         TabIndex        =   9
         Top             =   900
         Width           =   720
      End
      Begin VB.Label Label27 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "经办人"
         Height          =   180
         Left            =   240
         TabIndex        =   8
         Top             =   900
         Width           =   540
      End
      Begin VB.Label lblOptDate 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "OptDate"
         Height          =   180
         Left            =   4320
         TabIndex        =   7
         Top             =   900
         Width           =   630
      End
      Begin VB.Label lblEmpName 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "EmpName"
         Height          =   180
         Left            =   1320
         TabIndex        =   6
         Top             =   900
         Width           =   630
      End
   End
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   6390
      MouseIcon       =   "Frm_OrderEdit.frx":0CF0
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   4440
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确 定"
      Height          =   400
      Left            =   4230
      MouseIcon       =   "Frm_OrderEdit.frx":0FFA
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   4440
      Width           =   1300
   End
End
Attribute VB_Name = "Frm_OrderEdit"
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 MyOrders
  .OrderType = 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()
  '根据用户选择的客户类型,把此类型中的所有客户名称读取到数组Arr_Client()中
  MyClt.Load_Client (ComboType.ListIndex + 1)
  '依次把数组Arr_Client()中的客户名称添加到ComboClt组合框中
  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
    '从采购单管理窗体Frm_OrderMan的当前选择采购单中,读取采购单编号
    OriId = Frm_OrderMan.Adodc1.Recordset.Fields(0)
    '读取并显示客户类别
    lblStatus = Frm_OrderMan.ComboType.Text
    OriClt = Trim(Frm_OrderMan.Adodc1.Recordset.Fields(6))
    MyClt.GetInfo (MyClt.GetId(Trim(Frm_OrderMan.Adodc1.Recordset.Fields(6))))
    OriCltType = MyClt.ClientType
    '客户信息不能修改
    ComboClt.Enabled = False
    ComboType.Enabled = False
    '读取产品名称和类目
    '从采购单管理窗体Frm_OrderMan的当前选择采购单中,读取采购产品的名称
    OriPro = Trim(Frm_OrderMan.Adodc1.Recordset.Fields(1))
    '读取采购产品的信息
    MyPro.GetInfo (MyPro.GetId(Trim(Frm_OrderMan.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_OrderMan.Adodc1.Recordset.Fields(3)
    txtNum = Frm_OrderMan.Adodc1.Recordset.Fields(4)
    txtAmount = Frm_OrderMan.Adodc1.Recordset.Fields(5)
    '读取经办人和采购日期
    lblEmpName = Trim(Frm_OrderMan.Adodc1.Recordset.Fields(7))
    lblOptDate = Trim(Frm_OrderMan.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 + -