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

📄 contract.cls

📁 一个小的企业销售管理系统,希望对大家有所帮助有所帮助
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Contract"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public ContractId As String
Public Client As String
Public SignDate As String
Public Status As Integer
Public EmpName As String
Public DeliveryWay As String
Public DeliveryDate As String
Public SettleWay As Integer
Public Validation As String
Public Contents As String
Public Additional As String

Public Sub Init()
  ContractId = ""
  Client = ""
  SignDate = ""
  Status = 0
  EmpName = ""
  DeliveryWay = ""
  DeliveryDate = ""
  SettleWay = 0
  Validation = ""
  Contents = ""
  Additional = ""
End Sub

Public Sub GetInfo(ByVal TmpContractId As String)
  Dim rs As New ADODB.Recordset
  
  ContractId = TmpContractId
  If TmpContractId = "" Then
    Init
    Exit Sub
  End If
 
  SqlStmt = "SELECT * FROM Contract WHERE ContractId='" + Trim(TmpContractId) + "'"
  Set rs = QueryExt(SqlStmt)
  If Not rs.EOF Then
    '客户单位
    If IsNull(rs.Fields(1)) Then
      Client = ""
    Else
      Client = Trim(rs.Fields(1))
    End If
    ' 签约日期
    If IsNull(rs.Fields(2)) Then
      SignDate = ""
    Else
      SignDate = Trim(rs.Fields(2))
    End If
    ' 合同状态
    If IsNull(rs.Fields(3)) Then
      Status = ""
    Else
      Status = rs.Fields(3)
    End If
    ' 负责人姓名
    If IsNull(rs.Fields(4)) Then
      EmpName = ""
    Else
      EmpName = Trim(rs.Fields(4))
    End If
    ' 交货方式
    If IsNull(rs.Fields(5)) Then
      DeliveryWay = ""
    Else
      DeliveryWay = Trim(rs.Fields(5))
    End If
    ' 交货日期
    If IsNull(rs.Fields(6)) Then
      DeliveryDate = ""
    Else
      DeliveryDate = Trim(rs.Fields(6))
    End If
    ' 结算方式
    If IsNull(rs.Fields(7)) Then
      SettleWay = 0
    Else
      SettleWay = rs.Fields(7)
    End If
    ' 有效期限
    If IsNull(rs.Fields(8)) Then
      Validation = ""
    Else
      Validation = Trim(rs.Fields(8))
    End If
    ' 合同内容
    If IsNull(rs.Fields(9)) Then
      Contents = ""
    Else
      Contents = Trim(rs.Fields(9))
    End If
    ' 附加信息
    If IsNull(rs.Fields(10)) Then
      Additional = ""
    Else
      Additional = Trim(rs.Fields(10))
    End If
  Else
    Init
  End If
  rs.Close
End Sub

Public Function In_DB(ByVal TmpContractId As String) As Boolean
  Dim rs As New ADODB.Recordset
  
  SqlStmt = "SELECT Client FROM Contract WHERE ContractId='" + Trim(TmpContractId) + "'"
  Set rs = QueryExt(SqlStmt)
  If Not rs.EOF Then
    In_DB = True
  Else
    In_DB = False
  End If
  rs.Close
End Function

Public Sub Insert()
  SqlStmt = "INSERT INTO Contract VALUES('" + Trim(ContractId) + "','" _
            + Trim(Client) + "','" + Trim(SignDate) + "'," _
            + Trim(Str(Status)) + ",'" + Trim(EmpName) + "','" _
            + Trim(DeliveryWay) + "','" + Trim(DeliveryDate) _
            + "'," + Trim(Str(SettleWay)) + ",'" + Trim(Validation) _
            + "','" + Trim(Contents) + "','" + Trim(Additional) + "')"
  SQLExt (SqlStmt)
End Sub

'更新数据
Public Sub Update(ByVal TmpContractId As String)
  SqlStmt = "UPDATE Contract SET ContractId='" + Trim(ContractId) _
          + "',Client='" + Trim(Client) _
          + "',SignDate='" + Trim(SignDate) + "',EmpName='" + Trim(EmpName) _
          + "',DeliveryWay='" + Trim(DeliveryWay) + "',DeliveryDate='" _
          + Trim(DeliveryDate) + "',Validation='" + Trim(Validation) _
          + "',Contents='" + Trim(Contents) + "',Additional='" _
          + Trim(Additional) _
          + "' WHERE ContractId='" + Trim(TmpContractId) + "'"
  SQLExt (SqlStmt)
End Sub

'更新合同状态数据
Public Sub UpdateStatus(ByVal TmpContractId As String, _
                        ByVal TmpStatus As Integer)
  SqlStmt = "UPDATE Contract SET Status=" + Trim(Str(TmpStatus)) _
          + " WHERE ContractId='" + Trim(TmpContractId) + "'"
  SQLExt (SqlStmt)
End Sub






⌨️ 快捷键说明

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