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

📄 retbook.frm

📁 系统实现了图书的添加
💻 FRM
字号:
VERSION 5.00
Begin VB.Form retbook 
   Caption         =   "还书处理"
   ClientHeight    =   9060
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   10725
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9060
   ScaleWidth      =   10725
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Comm3 
      Caption         =   "返    回"
      Height          =   375
      Left            =   4320
      TabIndex        =   15
      Top             =   6000
      Width           =   975
   End
   Begin VB.CommandButton Comm2 
      Caption         =   "列罚款单"
      Height          =   375
      Left            =   2640
      TabIndex        =   14
      Top             =   6000
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Index           =   4
      Left            =   5760
      TabIndex        =   13
      Top             =   4560
      Width           =   735
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Index           =   3
      Left            =   4320
      TabIndex        =   12
      Top             =   4560
      Width           =   735
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Index           =   2
      Left            =   2520
      TabIndex        =   11
      Top             =   4560
      Width           =   735
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Index           =   1
      Left            =   5040
      TabIndex        =   10
      Top             =   3240
      Width           =   1815
   End
   Begin VB.Frame Frame2 
      Caption         =   "还书人信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2775
      Left            =   1440
      TabIndex        =   3
      Top             =   2760
      Width           =   5535
      Begin VB.TextBox Text2 
         Height          =   375
         Index           =   0
         Left            =   1080
         TabIndex        =   9
         Top             =   480
         Width           =   1815
      End
      Begin VB.Label Label5 
         Caption         =   "罚金"
         Height          =   495
         Left            =   3840
         TabIndex        =   8
         Top             =   1920
         Width           =   375
      End
      Begin VB.Label Label4 
         Caption         =   "可借书数"
         Height          =   375
         Left            =   1920
         TabIndex        =   7
         Top             =   1920
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "借书总数"
         Height          =   375
         Left            =   240
         TabIndex        =   6
         Top             =   1920
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "姓名"
         Height          =   375
         Left            =   3120
         TabIndex        =   5
         Top             =   600
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "借书证号"
         Height          =   375
         Left            =   240
         TabIndex        =   4
         Top             =   600
         Width           =   1335
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "输入图书编号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   1440
      TabIndex        =   0
      Top             =   600
      Width           =   5535
      Begin VB.CommandButton Comm1 
         Caption         =   "确    定"
         Height          =   375
         Left            =   4320
         TabIndex        =   2
         Top             =   360
         Width           =   855
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   600
         TabIndex        =   1
         Top             =   360
         Width           =   2295
      End
   End
End
Attribute VB_Name = "retbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rno As String
Public bno As String

Private Sub Comm1_Click()
    bno = Trim(Text1.Text)
    If bno <> "" Then
        Dim sqltxt As String
        sqltxt = "select * from borrow where 图书编号='" + bno + "'"
        Set brs = exesql(sqltxt)
        If brs.RecordCount = 0 Then
            MsgBox "该书不是从本图书馆所借,不能归还!", vbOKOnly, "信息提示"
        Else
        If Trim(brs.Fields("借书证号")) <> rno Then
            If rno <> "" Then
                dstr = "罚款单" + Chr(10) + Chr(13)
                dstr = dstr & "姓名:" & Trim(Text2(1).Text) + "(" + rno + _
                    ")罚款总额:" & str(Text2(4).Text) & "元"
                MsgBox dstr, vbOKOnly, "列罚款单"
            End If
            rno = Trim(brs.Fields("借书证号"))
            sqltxt = "select * from book where 图书编号='" + bno + "'"
            Set bs = exesql(sqltxt)
            rs.Fields("已借书数") = rs.Fields("已借书数") - 1
            Text2(0).Text = rno
            Text2(1) = rs.Fields("姓名")
            Text2(2) = rs.Fields("已借书数")
            Text2(3) = rs.Fields("借书总数") - rs.Fields("已借书数")
            If (Date - brs.Fields("借书日期") < rs.Fields("借书天数")) Then
                Text2(4).Text = (Date - brs.Fields("借书日期") - _
                    rs.Fields("借书天数")) * rs.Fields("过期罚款")
            End If
            MsgBox "过期罚款:" + str(rs.Fields("过期罚款"))
        Else
            rno = Trim(brs.Fields("借书证号"))
            sqltxt = "select * from book where 图书编号='" + bno + "'"
            Set bs = exesql(sqltxt)
            bs.Fields ("借否") - "否"
            bs.Update
            sqltxt = "select * from reader where 借书证号='" + bno + "'"
            Set ts = exesql(sqltxt)
            rs.Fields("已借书数") = rs.Fields("已借书数") - 1
            rs.Update
            If (Date - brs.Fields("借书日期") > rs.Fields("借书天数")) Then
                Text2(4).Text = Val(Text2(4).Text) + (Date - _
                    brs.Fields("借书日期") - rs.Fields("借书天数")) * _
                    rs.Fields("过期罚款")
            End If
        End If
        brs.Delete
        brs.Update
      End If
    Else
        MsgBox "图书编号不能为空!", vbOKOnly, "信息提示"
    End If
End Sub

Private Sub Comm2_Click()
    Dim dstr As String
    dstr = "罚款单" + Chr(10) + Chr(13)
    dstr = dstr & "姓名:" & Trim(Text2(1).Text) + "(" + Trim(Text2(0).Text) _
        + ") 罚款总额:" & str(Text2(4).Text) & "元"
    MsgBox dstr, vbOKOnly, "列罚款单"
End Sub

Private Sub Comm3_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    rno = ""
End Sub

⌨️ 快捷键说明

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