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

📄 frmcustomerbankcard.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F42BDC2B-FC9B-11D1-9ABD-444553540000}#4.0#0"; "ATLEDIT.OCX"
Object = "{F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#2.0#0"; "MSRDC20.OCX"
Begin VB.Form frmCustomerBankCard 
   BorderStyle     =   1  'Fixed Single
   Caption         =   " 单位开户银行"
   ClientHeight    =   4500
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6840
   HelpContextID   =   15009
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4500
   ScaleWidth      =   6840
   StartUpPosition =   2  '屏幕中心
   Begin MSRDC.MSRDC data1 
      Height          =   375
      Left            =   1320
      Top             =   3480
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      _Version        =   393216
      Options         =   0
      CursorDriver    =   0
      BOFAction       =   0
      EOFAction       =   0
      RecordsetType   =   1
      LockType        =   3
      QueryType       =   0
      Prompt          =   3
      Appearance      =   1
      QueryTimeout    =   30
      RowsetSize      =   100
      LoginTimeout    =   15
      KeysetSize      =   0
      MaxRows         =   0
      ErrorThreshold  =   -1
      BatchSize       =   15
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Enabled         =   -1  'True
      ReadOnly        =   0   'False
      Appearance      =   -1  'True
      DataSourceName  =   ""
      RecordSource    =   ""
      UserName        =   ""
      Password        =   ""
      Connect         =   ""
      LogMessages     =   ""
      Caption         =   "MSRDC1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.CommandButton cmdOK 
      Height          =   350
      Index           =   0
      Left            =   5550
      Style           =   1  'Graphical
      TabIndex        =   9
      Tag             =   "1001"
      Top             =   90
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Cancel          =   -1  'True
      Height          =   350
      Index           =   1
      Left            =   5550
      Style           =   1  'Graphical
      TabIndex        =   10
      Tag             =   "1002"
      Top             =   465
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "新增(&A)"
      Enabled         =   0   'False
      Height          =   350
      Index           =   2
      Left            =   1500
      TabIndex        =   4
      Top             =   1140
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "删除(&D)"
      Enabled         =   0   'False
      Height          =   350
      Index           =   3
      Left            =   2850
      TabIndex        =   5
      Top             =   1140
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "放弃(&U)"
      Enabled         =   0   'False
      Height          =   350
      Index           =   4
      Left            =   4200
      TabIndex        =   6
      Top             =   1140
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin AtlEdit.TEdit txtName 
      Height          =   300
      Index           =   0
      Left            =   1500
      TabIndex        =   1
      Top             =   420
      Width           =   3945
      _ExtentX        =   6959
      _ExtentY        =   529
      maxchar         =   30
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Text            =   ""
   End
   Begin AtlEdit.TEdit txtName 
      Height          =   300
      Index           =   1
      Left            =   1500
      TabIndex        =   3
      Top             =   735
      Width           =   3945
      _ExtentX        =   6959
      _ExtentY        =   529
      maxchar         =   30
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Text            =   ""
   End
   Begin MSFlexGridLib.MSFlexGrid msgBank 
      Bindings        =   "frmCustomerBankCard.frx":0000
      Height          =   2835
      Left            =   90
      TabIndex        =   8
      Top             =   1590
      Width           =   5355
      _ExtentX        =   9446
      _ExtentY        =   5001
      _Version        =   393216
      Cols            =   4
      FixedCols       =   0
      BackColorBkg    =   -2147483643
      GridColor       =   16777215
      GridColorFixed  =   16777215
      FocusRect       =   0
      GridLines       =   0
      SelectionMode   =   1
      AllowUserResizing=   1
      FormatString    =   "|开户银行名称              |开户银行帐号         |"
   End
   Begin VB.Label lblBank 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "开户银行列表(&L)"
      Height          =   180
      Index           =   4
      Left            =   150
      TabIndex        =   7
      Top             =   1380
      Width           =   1350
   End
   Begin VB.Label lblBank 
      BorderStyle     =   1  'Fixed Single
      Height          =   300
      Index           =   1
      Left            =   1500
      TabIndex        =   12
      Top             =   90
      Width           =   3945
   End
   Begin VB.Label lblBank 
      Caption         =   "单位"
      Height          =   285
      Index           =   0
      Left            =   150
      TabIndex        =   11
      Top             =   90
      Width           =   1305
   End
   Begin VB.Label lblBank 
      Caption         =   "开户银行帐号(&W)"
      Height          =   195
      Index           =   3
      Left            =   150
      TabIndex        =   2
      Top             =   795
      Width           =   1395
   End
   Begin VB.Label lblBank 
      Caption         =   "开户银行名称(&J)"
      Height          =   195
      Index           =   2
      Left            =   150
      TabIndex        =   0
      Top             =   480
      Width           =   1395
   End
End
Attribute VB_Name = "frmCustomerBankCard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''
'单位开户银行卡片
'
'作者:苏涛
'
'接口:DelCard(lngID); AddCard(Optional strName,Optional intModal); EditCard(lngID,Optional intModal)
'
'时间:1998-07-29
'
'''''''''''''''''''''''''''''''''''''''''
Option Explicit
Option Compare Text

Private mclsGrid As Grid
Private mblnIsList As Boolean
Private mblnIsChanged As Boolean
Private mblnBankIsAdd As Boolean        '开户银行新增
Private mblnBankCodeValid As Boolean
Private mblnIsInit As Boolean
Private mintRow As Integer
Private mlngCustomerID As Long
Private mlngCustomerBankID As Long

Public Function AddCard(lngCustomerID As Long, Optional strName As String = "", Optional intModal As Integer, _
    Optional ByVal IsList As Boolean = False) As Long
    Dim recCustomer As rdoResultset, strSql As String
    
    strSql = "SELECT * FROM Customer WHERE lngCustomerID=" & lngCustomerID
    Set recCustomer = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
    If recCustomer.EOF Then
        ShowMsg hwnd, "该单位不存在,不能对其发货地址进行编辑!", vbExclamation + MB_TASKMODAL, Caption
        Unload Me
    Else
        lblBank(1).Caption = Trim(recCustomer!strCustomerCode) & "  " _
            & Trim(recCustomer!strCustomerName)
        mlngCustomerID = lngCustomerID
        mlngCustomerBankID = 0
        Caption = "新增单位开户银行"
        cmdOk(2).Visible = True
        InitCard strName
        mblnIsList = IsList
        Show intModal
        AddCard = mlngCustomerBankID
    End If
    recCustomer.Close
End Function

Public Function DelCard(ByVal lngID As Long, Optional lnghWnd As Long = 0) As Boolean
    Dim strSql As String
'    Dim recSelect As rdoresultset
    Dim intMsgReturn As Integer
    Dim blnSQLExec As Boolean
    
    DelCard = False
'    strSQL = "SELECT * FROM Customer WHERE lngCustomerID=" & lngID
'    Set recSelect = gclsBase.BaseDB.openresultset(strSQL, rdopenstatic)
'    If recSelect.EOF Then
    If Not CheckIDUsed("CustomerBank", "lngCustomerBankID", lngID) Then
        intMsgReturn = ShowMsg(lnghWnd, "该单位开户银行不存在,不能删除!", _
            vbExclamation + vbOKOnly + MB_TASKMODAL, Caption)
'        recSelect.Close
'        frmCustomerList.IsShowCard(0) = False
        Exit Function
    End If
    If CodeUsed(lngID) Then
        intMsgReturn = ShowMsg(lnghWnd, "其它地方正在使用此单位开户银行,不能删除!", _
            vbExclamation + vbOKOnly + MB_TASKMODAL, Caption)
    Else
        intMsgReturn = ShowMsg(lnghWnd, "你确实要删除该单位开户银行吗!", _
            vbQuestion + vbOKCancel + MB_TASKMODAL, Caption)
        If intMsgReturn = vbOK Then
            strSql = "DELETE FROM CustomerBank WHERE lngCustomerBankID = " & lngID
            blnSQLExec = gclsBase.ExecSQL(strSql)
            If Not blnSQLExec Then
                intMsgReturn = ShowMsg(lnghWnd, "删除单位开户银行不成功!", _
                    vbExclamation + vbOKOnly + MB_TASKMODAL, Caption)
            Else
                gclsSys.SendMessage Me.hwnd, Message.msgCustomerBank
                DelCard = True
            End If
        End If
    End If
'    recSelect.Close
'    frmCustomerList.IsShowCard(0) = False
End Function

'检查开户银行是否合法
Private Sub CheckBankCode()
    Dim i As Integer

    For i = 1 To msgBank.Rows - 1
        If msgBank.RowHeight(i) <> 0 Then
            If mblnBankIsAdd Then
                If msgBank.TextMatrix(i, 1) = Trim$(txtName(0).Text) And _
                    msgBank.TextMatrix(i, 2) = Trim$(txtName(1).Text) Then Exit For
            Else
                If msgBank.TextMatrix(i, 1) = Trim$(txtName(0).Text) And _
                    msgBank.TextMatrix(i, 2) = Trim$(txtName(1).Text) And _
                    i <> mintRow Then Exit For
            End If
        End If
    Next i
    mblnBankCodeValid = (i >= msgBank.Rows)
End Sub

'判断记录是否被使用(可能有多张表会使用此编码)
Private Function CodeUsed(lngID As Long) As Boolean
    CodeUsed = CheckIDUsed("ItemActivity", "lngCustomerBankID", lngID)
End Function

'进入修改单位
Public Sub EditCard(lngCustomerID As Long, ByVal lngID As Long, _
    Optional intModal As Integer = 0)
    Dim recCustomer As rdoResultset, strSql As String
    

⌨️ 快捷键说明

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