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

📄 frmcustomerpriceupdate.frm

📁 很好! 很实用! 免费!
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmCustomerPriceUpdate 
   Caption         =   "修改客户价格"
   ClientHeight    =   6945
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9930
   LinkTopic       =   "Form1"
   ScaleHeight     =   6945
   ScaleWidth      =   9930
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdApply 
      Caption         =   "应用"
      Height          =   495
      Left            =   8340
      TabIndex        =   13
      Top             =   6330
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "客户价格"
      Height          =   6015
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   9735
      Begin ClassSystem.InputNumber txtSchedule 
         Height          =   315
         Left            =   2040
         TabIndex        =   3
         Top             =   3150
         Width           =   2625
         _ExtentX        =   4630
         _ExtentY        =   556
         BorderStyle     =   1
      End
      Begin ClassSystem.InputNumber txtPrice2 
         Height          =   375
         Left            =   6330
         TabIndex        =   4
         Top             =   2640
         Width           =   2865
         _ExtentX        =   5054
         _ExtentY        =   661
         BorderStyle     =   1
      End
      Begin ClassSystem.InputNumber txtPrice1 
         Height          =   345
         Left            =   2040
         TabIndex        =   5
         Top             =   2670
         Width           =   2625
         _ExtentX        =   4630
         _ExtentY        =   609
         BorderStyle     =   1
      End
      Begin ClassSystem.GCombo cbCommodity 
         Height          =   315
         Left            =   6330
         TabIndex        =   6
         Top             =   2070
         Width           =   2895
         _ExtentX        =   5106
         _ExtentY        =   556
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         FontSize        =   8.25
         FontName        =   "MS Sans Serif"
         ListIndex       =   -1
         Text            =   ""
      End
      Begin ClassSystem.GCombo cbCustomer 
         Height          =   315
         Left            =   2010
         TabIndex        =   7
         Top             =   2100
         Width           =   2685
         _ExtentX        =   4736
         _ExtentY        =   556
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         FontSize        =   8.25
         FontName        =   "MS Sans Serif"
         ListIndex       =   -1
         Text            =   ""
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户名称"
         Height          =   195
         Left            =   1110
         TabIndex        =   12
         Top             =   2100
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "商品名称"
         Height          =   195
         Left            =   5250
         TabIndex        =   11
         Top             =   2100
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "批量进价/售价"
         Height          =   195
         Left            =   660
         TabIndex        =   10
         Top             =   2700
         Width           =   1155
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "批量进价/售价"
         Height          =   195
         Left            =   4980
         TabIndex        =   9
         Top             =   2700
         Width           =   1155
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "采购提前期"
         Height          =   195
         Left            =   870
         TabIndex        =   8
         Top             =   3210
         Width           =   900
      End
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   6780
      TabIndex        =   1
      Top             =   6330
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   495
      Left            =   5040
      TabIndex        =   0
      Top             =   6330
      Width           =   1575
   End
End
Attribute VB_Name = "frmCustomerPriceUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sPriceID As String
Private Function Saved() As Boolean
    Saved = True
    
    If cbCommodity.ListIndex = -1 Then Saved = False
End Function

Private Sub cbCommodity_Change()
Dim objTemp As New clsCustomerPrice
Dim rsTemp As ADODB.Recordset
    Set rsTemp = objTemp.GetList("ID,Price1,Price2,Schedule", "CustomerID=" + CheckString(cbCustomer.Item("ID", cbCustomer.ListIndex)) + " and CommodityID=" + CheckString(cbCommodity.Item("ID", cbCommodity.ListIndex)), "")
    
    txtPrice1.Text = rsTemp.Fields("Price1").value
    txtPrice2.Text = rsTemp.Fields("Price2").value
    txtSchedule.Text = rsTemp.Fields("Schedule").value
    sPriceID = rsTemp.Fields("ID").value
    
    Set rsTemp = Nothing
    Set objTemp = Nothing
End Sub

Private Sub cmdApply_Click()
    If Not Saved Then Exit Sub
    Call SaveData
End Sub
Private Sub SaveData()
    
Dim objPrice As New clsCustomerPrice
    With objPrice
        .m_ID = sPriceID
        .m_CommodityID = cbCommodity.Item("ID", cbCommodity.ListIndex)
        .m_CustomerID = cbCustomer.Item("ID", cbCustomer.ListIndex)
        .m_Price1 = txtPrice1.Text
        .m_Price2 = txtPrice2.Text
        .m_Schedule = txtSchedule.Text
        If .Update() Then
            Call frmCustomerPrice.RefreshData
        End If
    End With
End Sub
Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
   If Not Saved Then Exit Sub
   Call SaveData
   Unload Me
End Sub

Private Sub Form_Load()
Dim objCommodity As New clsCommodity
Dim objCustomer As New clsCustomer
    Call objCustomer.FillByID(frmCustomerPrice.ExcelGrid1.DataRecordset.Fields("CustomerID").value)
    cbCustomer.AddItem objCustomer.m_Name
    cbCustomer.Item("ID", cbCustomer.NewIndex) = objCustomer.m_ID
    cbCustomer.Enabled = False
    cbCustomer.ListIndex = 0
    
    
    Me.cbCommodity.RelativeList objCommodity.GetList("ID,Code,Item", "ID in (select CommodityID from CoCustomerPrice where CustomerID=" + CheckString(objCustomer.m_ID) + ")", "Code"), "Code,Item"
    
    cbCommodity.ListIndex = 0
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -