frmcustomercontractinsert.frm

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

FRM
314
字号
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmCustomerContractInsert 
   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 cmdApply 
      Caption         =   "应用"
      Height          =   495
      Left            =   8280
      TabIndex        =   19
      Top             =   6420
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "客户合同"
      Height          =   6015
      Left            =   60
      TabIndex        =   2
      Top             =   120
      Width           =   9735
      Begin VB.TextBox txtSummary 
         Height          =   1365
         Left            =   1260
         MultiLine       =   -1  'True
         TabIndex        =   4
         Top             =   2940
         Width           =   8355
      End
      Begin VB.TextBox txtTitle 
         Height          =   345
         Left            =   4980
         TabIndex        =   3
         Top             =   1470
         Width           =   4665
      End
      Begin ClassSystem.SelectFile seFConData 
         Height          =   375
         Left            =   1260
         TabIndex        =   5
         Top             =   4680
         Width           =   8055
         _ExtentX        =   14208
         _ExtentY        =   661
         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
      End
      Begin MSComCtl2.DTPicker dtpEdate 
         Height          =   375
         Left            =   4980
         TabIndex        =   6
         Top             =   2370
         Width           =   3015
         _ExtentX        =   5318
         _ExtentY        =   661
         _Version        =   393216
         Format          =   61079552
         CurrentDate     =   37570
      End
      Begin MSComCtl2.DTPicker dtpBDate 
         Height          =   345
         Left            =   1320
         TabIndex        =   7
         Top             =   2370
         Width           =   2565
         _ExtentX        =   4524
         _ExtentY        =   609
         _Version        =   393216
         Format          =   61079552
         CurrentDate     =   37570
      End
      Begin ClassSystem.GCombo gcbStatus 
         Height          =   315
         Left            =   4980
         TabIndex        =   8
         Top             =   1950
         Width           =   3015
         _ExtentX        =   5318
         _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 MSComCtl2.DTPicker dtpConDate 
         Height          =   345
         Left            =   1320
         TabIndex        =   9
         Top             =   1920
         Width           =   2565
         _ExtentX        =   4524
         _ExtentY        =   609
         _Version        =   393216
         Format          =   61079552
         CurrentDate     =   37570
      End
      Begin ClassSystem.GCombo gcbCustomerID 
         Height          =   315
         Left            =   1320
         TabIndex        =   10
         Top             =   1500
         Width           =   2565
         _ExtentX        =   4524
         _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 Label8 
         AutoSize        =   -1  'True
         Caption         =   "合同内容"
         Height          =   195
         Left            =   420
         TabIndex        =   18
         Top             =   4800
         Width           =   720
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "失效日期"
         Height          =   195
         Left            =   4110
         TabIndex        =   17
         Top             =   2430
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "生效日期"
         Height          =   195
         Left            =   330
         TabIndex        =   16
         Top             =   2460
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "合同状态"
         Height          =   195
         Left            =   4110
         TabIndex        =   15
         Top             =   1980
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "合同日期"
         Height          =   195
         Left            =   270
         TabIndex        =   14
         Top             =   2010
         Width           =   720
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "合同摘要"
         Height          =   195
         Left            =   330
         TabIndex        =   13
         Top             =   3000
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "合同标题"
         Height          =   195
         Left            =   4080
         TabIndex        =   12
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "客户名称"
         Height          =   195
         Left            =   330
         TabIndex        =   11
         Top             =   1530
         Width           =   720
      End
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   495
      Left            =   6720
      TabIndex        =   1
      Top             =   6420
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   495
      Left            =   4980
      TabIndex        =   0
      Top             =   6420
      Width           =   1575
   End
End
Attribute VB_Name = "frmCustomerContractInsert"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdApply_Click()
    '新加客户合同
Dim objCustomerContract As New clsCustomerContract

    With objCustomerContract
        .m_ID = newGUID()
        .m_BDate = Me.dtpBDate.value
        .m_ConData = Me.seFConData.Text
        .m_ConDate = Me.dtpConDate.value
        .m_CustomerID = Me.gcbCustomerID.Item("ID")
        .m_EDate = Me.dtpEdate.value
        .m_Status = Me.gcbStatus.Text
        .m_Summary = Me.txtSummary.Text
        .m_Title = Me.txtTitle.Text
        If Not .Insert() Then
            MsgBox "插入失败,请检查数据合法性!", vbInformation, "新增客户合同"
        Else
            frmCustomerContract.RefreshData
        End If
    End With
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
'新加客户合同
Dim objCustomerContract As New clsCustomerContract

    With objCustomerContract
        .m_ID = newGUID()
        .m_BDate = Me.dtpBDate.value
        .m_ConData = Me.seFConData.Text
        .m_ConDate = Me.dtpConDate.value
        .m_CustomerID = Me.gcbCustomerID.Item("ID")
        .m_EDate = Me.dtpEdate.value
        .m_Status = Me.gcbStatus.Text
        .m_Summary = Me.txtSummary.Text
        .m_Title = Me.txtTitle.Text
        If Not .Insert() Then
            MsgBox "插入失败,请检查数据合法性!", vbInformation, "新增客户合同"
        Else
            Unload Me
            frmCustomerContract.RefreshData
        End If
    End With
    
End Sub


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

⌨️ 快捷键说明

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