frmcustomervisitinginsert.frm

来自「很好! 很实用! 免费!」· FRM 代码 · 共 281 行

FRM
281
字号
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmCustomerVisitingInsert 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "新增客户拜访"
   ClientHeight    =   6975
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   9960
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6975
   ScaleWidth      =   9960
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   495
      Left            =   5040
      TabIndex        =   11
      Top             =   6420
      Width           =   1575
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   6780
      TabIndex        =   10
      Top             =   6420
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Caption         =   "客户合同"
      Height          =   6015
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   9735
      Begin VB.TextBox txtResult 
         Height          =   1365
         Left            =   1290
         MultiLine       =   -1  'True
         TabIndex        =   17
         Text            =   "frmCustomerVisitingInsert.frx":0000
         Top             =   4380
         Width           =   8295
      End
      Begin ClassSystem.GCombo gcbVisiterID 
         Height          =   315
         Left            =   1320
         TabIndex        =   15
         Top             =   2430
         Width           =   3225
         _ExtentX        =   5689
         _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.InputNumber intFee 
         Height          =   345
         Left            =   6660
         TabIndex        =   13
         Top             =   1920
         Width           =   2505
         _ExtentX        =   4419
         _ExtentY        =   609
         BorderStyle     =   1
      End
      Begin VB.TextBox txtTransTitle 
         Height          =   345
         Left            =   1320
         TabIndex        =   3
         Top             =   1980
         Width           =   3225
      End
      Begin VB.TextBox txtSummary 
         Height          =   1245
         Left            =   1290
         MultiLine       =   -1  'True
         TabIndex        =   2
         Top             =   2970
         Width           =   8355
      End
      Begin MSComCtl2.DTPicker dtpTransDate 
         Height          =   345
         Left            =   6630
         TabIndex        =   4
         Top             =   1380
         Width           =   2565
         _ExtentX        =   4524
         _ExtentY        =   609
         _Version        =   393216
         Format          =   61079552
         CurrentDate     =   37570
      End
      Begin ClassSystem.GCombo gcbCustomerID 
         Height          =   315
         Left            =   1320
         TabIndex        =   5
         Top             =   1500
         Width           =   3225
         _ExtentX        =   5689
         _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 Label7 
         AutoSize        =   -1  'True
         Caption         =   "拜访结果"
         Height          =   195
         Left            =   330
         TabIndex        =   16
         Top             =   4350
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "拜访者"
         Height          =   195
         Left            =   390
         TabIndex        =   14
         Top             =   2460
         Width           =   540
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "拜访花费"
         Height          =   195
         Left            =   5760
         TabIndex        =   12
         Top             =   2010
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户名称"
         Height          =   195
         Left            =   330
         TabIndex        =   9
         Top             =   1530
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "拜访标题"
         Height          =   195
         Left            =   330
         TabIndex        =   8
         Top             =   2010
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "拜访摘要"
         Height          =   195
         Left            =   360
         TabIndex        =   7
         Top             =   3000
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "拜访日期"
         Height          =   195
         Left            =   5730
         TabIndex        =   6
         Top             =   1440
         Width           =   720
      End
   End
   Begin VB.CommandButton cmdApply 
      Caption         =   "应用"
      Height          =   495
      Left            =   8340
      TabIndex        =   0
      Top             =   6420
      Width           =   1455
   End
End
Attribute VB_Name = "frmCustomerVisitingInsert"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdApply_Click()
'新加客户访问
Dim objCustomerVisiting As New clsCustomerVisiting

    With objCustomerVisiting
        .m_ID = newGUID()
        .m_CustomerID = Me.gcbCustomerID.Item("ID")
        .m_Fee = Me.intFee.Text
        .m_Result = Me.txtResult.Text
        .m_Summary = Me.txtSummary.Text
        .m_TransDate = Me.dtpTransDate.value
        .m_TransTitle = Me.txtTransTitle.Text
        .m_VisiterID = Me.gcbVisiterID.Item("ID")
        If Not .Insert() Then
            MsgBox "插入失败,请检查数据合法性!", vbInformation, "新增客户访问"
        Else
            frmCustomerVisiting.RefreshData
        End If
    End With
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
'新加客户访问
Dim objCustomerVisiting As New clsCustomerVisiting

    With objCustomerVisiting
        .m_ID = newGUID()
        .m_CustomerID = Me.gcbCustomerID.Item("ID")
        .m_Fee = Me.intFee.Text
        .m_Result = Me.txtResult.Text
        .m_Summary = Me.txtSummary.Text
        .m_TransDate = Me.dtpTransDate.value
        .m_TransTitle = Me.txtTransTitle.Text
        .m_VisiterID = Me.gcbVisiterID.Item("ID")
        If Not .Insert() Then
            MsgBox "插入失败,请检查数据合法性!", vbInformation, "新增客户访问"
        Else
            Unload Me
            frmCustomerVisiting.RefreshData
        End If
    End With
    
End Sub


Private Sub Form_Load()
    Dim objCustomer As New clsCustomer
    Dim objEmployee As New clsEmployee
    'center the form
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
    
    
    If frmCustomerVisiting.sCustID = "" Then
        gcbCustomerID.RelativeList objCustomer.GetList("ID,Name", , "No"), "Name"
    Else
        gcbCustomerID.AddItem frmCustomerVisiting.sCustName
        gcbCustomerID.Item("ID", gcbCustomerID.NewIndex) = frmCustomerVisiting.sCustID
        gcbCustomerID.Enabled = False
    End If
    gcbCustomerID.ListIndex = 0
    
    Me.gcbVisiterID.RelativeList objEmployee.GetList("ID,Name", , "No"), "Name"
    
End Sub



⌨️ 快捷键说明

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