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

📄 returnadd.frm

📁 本程序是vb+access做的图书管管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form freturnmodify 
   Caption         =   "Form1"
   ClientHeight    =   3915
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5910
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3915
   ScaleWidth      =   5910
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   3360
      TabIndex        =   5
      Top             =   2880
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   1200
      TabIndex        =   4
      Top             =   2880
      Width           =   1215
   End
   Begin VB.TextBox Tborrowid 
      Height          =   495
      Left            =   2520
      TabIndex        =   3
      Top             =   600
      Width           =   2175
   End
   Begin VB.TextBox Treturntime 
      Height          =   495
      Left            =   2520
      TabIndex        =   2
      Top             =   1680
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "借书编号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   720
      TabIndex        =   1
      Top             =   600
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "还书日期:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   720
      TabIndex        =   0
      Top             =   1680
      Width           =   1215
   End
End
Attribute VB_Name = "freturnmodify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public isadd As Boolean

Private Sub Command1_Click()
    Dim strsql As String
    Dim bdate, rdate As Date

If isadd Then
        strsql = "insert into return(borrowid,returntime) values('" & Trim(Tborrowid) & "','" & Trim(Treturntime) & "')"
    If runsql(strsql) = True Then
        Dim lstitem As ListItem
        strsql = "select * from return where borrowid='" & Tborrowid.Text & "'"
        runsql (strsql)
        Set lstitem = freturncheck.lvw4.ListItems.add(, "k_" & Tborrowid.Text, Tborrowid.Text)
        lstitem.SubItems(1) = rct.Fields("returntime").Value
        
        strsql = "select a.returntime,b.returntime from borrow a,return b"
        runsql (strsql)
        bdate = rct.Fields(0)
        rdate = rct.Fields(1)
        If rdate > bdate Then
            MsgBox "超期" & rdate - bdate & "天,应缴纳罚金:¥" & (rdate - bdate) * 1.5
        End If
    End If
Else
    strsql = "update return set borrowid='" & Trim(Tborrowid) & "',returntime='" & Trim(Treturntime) & "' where borrowid='" & Trim(Tborrowid) & "'"
    If runsql(strsql) = True Then
        strsql = "select * from return where borrowid='" & Trim(Tborrowid) & "'"
        runsql (strsql)
        freturncheck.lvw4.SelectedItem.Text = Trim(Tborrowid)
        freturncheck.lvw4.SelectedItem.SubItems(1) = Trim(Treturntime)
        Unload Me
        strsql = "select a.returntime,b.returntime from borrow a,return b"
        runsql (strsql)
        bdate = rct.Fields(0)
        rdate = rct.Fields(1)
        If rdate > bdate Then
            MsgBox "超期" & rdate - bdate & "天,应缴纳罚金:¥" & (rdate - bdate) * 1.5
        End If
    End If
 End If
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
If isadd Then
     Me.Caption = "增加还书记录"
Else
    Me.Caption = "修改还书记录"
End If
Treturntime.Text = Date
End Sub

⌨️ 快捷键说明

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