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

📄 transfer.frm

📁 vb做的银行管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form transfer1 
   Caption         =   "转帐"
   ClientHeight    =   4380
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7875
   LinkTopic       =   "Form1"
   ScaleHeight     =   4380
   ScaleWidth      =   7875
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Index           =   5
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   14
      Top             =   3480
      Width           =   2655
   End
   Begin VB.TextBox Text1 
      Height          =   270
      IMEMode         =   3  'DISABLE
      Index           =   4
      Left            =   1800
      PasswordChar    =   "*"
      TabIndex        =   13
      Top             =   3000
      Width           =   2655
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Index           =   3
      Left            =   1800
      TabIndex        =   12
      Top             =   2520
      Width           =   2655
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Index           =   2
      Left            =   1800
      TabIndex        =   11
      Top             =   2040
      Width           =   2655
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Index           =   1
      Left            =   1800
      TabIndex        =   10
      Top             =   1560
      Width           =   2655
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   5880
      TabIndex        =   9
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      Height          =   375
      Left            =   5880
      TabIndex        =   8
      Top             =   1440
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Index           =   0
      Left            =   1800
      TabIndex        =   7
      Top             =   1080
      Width           =   2655
   End
   Begin VB.Label Label7 
      Caption         =   "再次输入密码:"
      Height          =   375
      Left            =   240
      TabIndex        =   6
      Top             =   3480
      Width           =   1455
   End
   Begin VB.Label Label6 
      Caption         =   "密码:"
      Height          =   255
      Left            =   960
      TabIndex        =   5
      Top             =   3000
      Width           =   735
   End
   Begin VB.Label Label5 
      Caption         =   "转入人姓名:"
      Height          =   255
      Left            =   480
      TabIndex        =   4
      Top             =   2520
      Width           =   1215
   End
   Begin VB.Label Label4 
      Caption         =   "转出金额:"
      Height          =   255
      Left            =   480
      TabIndex        =   3
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Label Label3 
      Caption         =   "转入帐号:"
      Height          =   255
      Left            =   600
      TabIndex        =   2
      Top             =   2040
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "转出帐号:"
      Height          =   255
      Left            =   600
      TabIndex        =   1
      Top             =   1080
      Width           =   1335
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "转帐"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2640
      TabIndex        =   0
      Top             =   360
      Width           =   1935
   End
End
Attribute VB_Name = "transfer1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim str As String
Dim input1 As Boolean
Dim input2 As Boolean
input1 = False
input2 = False
str = "select * from account where AuserID='" & Text1(0).Text & "' Or AuserID = '" & Text1(2).Text & "'"
Set cn = New adodb.Connection
Dim rst As Recordset
Set rst = New Recordset
Dim dat1 As Date
Dim dat2 As Date
Dim lastmoney As Double
cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bank;Data Source=(local)"
cn.Open
'
'''''''''''''''''''''''''''
'保证不为空
''''''''''''''''''''''''''
For i = 0 To 5
 If Text1(i).Text = "" Then
 MsgBox "请把数据全部填上!"
 Exit Sub
 End If
 Next i
 If Text1(4).Text <> Text1(5).Text Then
 MsgBox "你输入的两次密码不一致!请重新输入!"
 cn.Close
 Exit Sub
 End If
 ''''''''''''''''''''''''''
 '查找此帐号
 '''''''''''''''''''''''''
 rst.Open str, cn, adOpenDynamic, adLockOptimistic
 rst.MoveFirst
Do While Not rst.EOF
 If Trim(rst!AuserID) = Text1(0).Text And Trim(rst!Apassword) = Text1(4).Text Then
    input1 = True
End If
If Trim(rst!AuserID) = Text1(2).Text And Trim(rst!Aname) = Text1(3).Text Then
   input2 = True
   End If
rst.MoveNext
Loop

If input1 = flase Or input2 = flase Then
MsgBox "查无此帐号!请重新输入!"
rst.Close
cn.Close
Exit Sub
End If

rst.Close
rst.Open "select * from account where AuserID='" & Text1(0).Text & "'", cn, adOpenDynamic, adLockOptimistic

''''''''''''''''''''''
'算出时间
''''''''''''''''''''
dat1 = Format(Date, yyyy, mm, dd)
dat2 = DateDiff("m", rst!lastdate, dat1)

'''''''''''''''''''''''''''
'算出所得利息
'''''''''''''''''''''''''''
permoney = CDbl(rst!percentage) * dat2
If (CDbl(rst!Endmoney) + permoney) < CDbl(Text1(1).Text) Then
MsgBox "现您的帐户没有这么多余额,请查询余额,转帐不成功!"
rst.Close
cn.Close
Exit Sub
Else
lastmoney = CDbl(rst!Endmoney) + permoney - CDbl(Text1(1).Text)
End If
''''''''''''''''''''''''''
'插入转出信息
'''''''''''''''''''''''''
rst.Fields("Endmoney") = lastmoney
rst.Fields("lastdate") = dat1
rst.Update
rst.Close

rst.Open "select * from account where AuserID='" & Text1(2).Text & "'", cn, adOpenDynamic, adLockOptimistic
dat2 = DateDiff("m", rst!lastdate, dat1)

'''''''''''''''''''''''''''
'算出所得利息
'''''''''''''''''''''''''''
permoney = CDbl(rst!percentage) * dat2
lastmoney = CDbl(rst!Endmoney) + permoney + CDbl(Text1(1).Text)
''''''''''''''''''''''''''
'插入转入信息
'''''''''''''''''''''''''
rst.Fields("Endmoney") = lastmoney
rst.Fields("lastdate") = dat1
rst.Update
rst.Close
cn.Close
MsgBox "转帐成功!"
Unload Me

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

⌨️ 快捷键说明

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