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

📄 frmreturnedit.frm

📁 图书管理系统,采用VB+SQL,含最好的代码和数据库备份.
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmReturnEdit 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑图书归还信息"
   ClientHeight    =   5175
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9660
   Icon            =   "FrmReturnEdit.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5175
   ScaleWidth      =   9660
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Lost 
      Caption         =   "丢 失"
      Height          =   375
      Left            =   5160
      TabIndex        =   18
      Top             =   4560
      Width           =   1215
   End
   Begin VB.CommandButton Cmd_GoOn 
      Caption         =   "续 借"
      Height          =   375
      Left            =   3000
      TabIndex        =   17
      Top             =   4560
      Width           =   1215
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   7680
      Top             =   1440
      Visible         =   0   'False
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Cmd_Return 
      Caption         =   "归 还"
      Height          =   375
      Left            =   840
      TabIndex        =   16
      Top             =   4560
      Width           =   1215
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "FrmReturnEdit.frx":0442
      Height          =   2775
      Left            =   120
      TabIndex        =   15
      Top             =   1560
      Width           =   9375
      _ExtentX        =   16536
      _ExtentY        =   4895
      _Version        =   393216
      AllowUpdate     =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame3 
      Caption         =   "借阅人信息"
      Height          =   1335
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   9375
      Begin VB.TextBox txtAddDays 
         Enabled         =   0   'False
         Height          =   330
         Left            =   5760
         TabIndex        =   19
         Top             =   825
         Width           =   615
      End
      Begin VB.TextBox txtBCount 
         Enabled         =   0   'False
         Height          =   330
         Left            =   8520
         TabIndex        =   14
         Top             =   825
         Width           =   615
      End
      Begin VB.TextBox txtCardType 
         Enabled         =   0   'False
         Height          =   330
         Left            =   7440
         TabIndex        =   12
         Top             =   360
         Width           =   1095
      End
      Begin VB.TextBox txtMaxDays 
         Enabled         =   0   'False
         Height          =   330
         Left            =   3480
         TabIndex        =   10
         Top             =   825
         Width           =   615
      End
      Begin VB.TextBox txtMaxCount 
         Enabled         =   0   'False
         Height          =   330
         Left            =   1320
         TabIndex        =   8
         Top             =   825
         Width           =   615
      End
      Begin VB.TextBox txtName 
         Enabled         =   0   'False
         Height          =   330
         Left            =   4440
         TabIndex        =   6
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton Cmd_SchCard 
         Caption         =   "查 找"
         Height          =   375
         Left            =   2600
         TabIndex        =   4
         Top             =   360
         Width           =   855
      End
      Begin VB.TextBox txtCardNo 
         Height          =   330
         Left            =   1320
         TabIndex        =   3
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "最多续借天数"
         Height          =   180
         Left            =   4440
         TabIndex        =   20
         Top             =   900
         Width           =   1080
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         Caption         =   "已经借阅数量"
         Height          =   180
         Left            =   7080
         TabIndex        =   13
         Top             =   900
         Width           =   1080
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Caption         =   "类型"
         Height          =   180
         Left            =   6840
         TabIndex        =   11
         Top             =   420
         Width           =   360
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         Caption         =   "最多借阅天数"
         Height          =   180
         Left            =   2280
         TabIndex        =   9
         Top             =   900
         Width           =   1080
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "最大借阅数量"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   120
         TabIndex        =   7
         Top             =   900
         Width           =   1080
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "姓名"
         Height          =   180
         Left            =   3960
         TabIndex        =   5
         Top             =   420
         Width           =   360
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "借阅证编号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   120
         TabIndex        =   2
         Top             =   420
         Width           =   900
      End
   End
   Begin VB.CommandButton Cmd_Exit 
      Cancel          =   -1  'True
      Caption         =   "返 回"
      Height          =   400
      Left            =   7320
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   4560
      Width           =   1300
   End
End
Attribute VB_Name = "FrmReturnEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cmd_Exit_Click()
  Unload Me
End Sub

'图书续借
Private Sub Cmd_GoOn_Click()
  '使用Adodc1.Recordset.EOF判断当前是否选择了记录
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '初始化FrmReturnDetail窗体
  FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0)  '编号
  FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
  FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
  FrmReturnDetail.txtGDate = Date
  '最大续借天数
  FrmReturnDetail.nAddDays = Val(txtAddDays)
  '图书续借应归还日期为续借日期加上允许的最大续借天数
  FrmReturnDetail.txtReturnDate = CStr(DateAdd("d", Val(txtAddDays), Date))
  FrmReturnDetail.txtRRDate = ""
  FrmReturnDetail.txtForfeit = 0
  FrmReturnDetail.cob_Status.Text = "续借"
  FrmReturnDetail.Show 1
  GridRefresh
End Sub

Private Sub Cmd_Lost_Click()
  '使用Adodc1.Recordset.EOF判断当前是否选择了记录
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '初始化FrmReturnDetail窗体
  FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0)  '编号
  FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
  FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
  FrmReturnDetail.txtReturnDate = Adodc1.Recordset.Fields(4)
  FrmReturnDetail.txtGDate = ""
  FrmReturnDetail.txtRRDate = Date
  FrmReturnDetail.txtForfeit = 0
  FrmReturnDetail.cob_Status.Text = "丢失"
  FrmReturnDetail.Show 1
  '更改借阅数量
  If FrmReturnDetail.ClickOK Then
    txtBCount = Val(txtBCount) - 1
  End If
  GridRefresh
End Sub


Private Sub Cmd_Return_Click()
  '使用Adodc1.Recordset.EOF判断当前是否选择了记录
  If Adodc1.Recordset.EOF = True Then
    MsgBox "请选择记录"
    Exit Sub
  End If
  '初始化FrmReturnDetail窗体
  FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0)  '编号
  FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
  FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
  FrmReturnDetail.txtReturnDate = Adodc1.Recordset.Fields(4)
  FrmReturnDetail.txtGDate = ""
  FrmReturnDetail.txtRRDate = Date
  FrmReturnDetail.txtForfeit = 0
  FrmReturnDetail.cob_Status.Text = "归还"
  FrmReturnDetail.Show 1
  '更改借阅数量
  If FrmReturnDetail.ClickOK Then
    txtBCount = Val(txtBCount) - 1
  End If
  GridRefresh
End Sub

Private Sub Cmd_SchCard_Click()
  '根据输入的借阅证号查找相关信息
  If Len(Trim(txtCardNo)) = 0 Then
    MsgBox ("请输入借阅证号")
    txtCardNo.SetFocus
    Exit Sub
  End If
  '判断此借阅证号是否存在
  If MyCards.GetInfo(Trim(txtCardNo)) = False Then
    MsgBox ("没有这个借阅证号,请重新输入")
    txtCardNo.SetFocus
    Exit Sub
  Else
    txtName = MyCards.Name
    '根据类型查找类型信息
    If MyCardType.GetInfo(MyCards.TypeId) = True Then
      txtCardType = MyCardType.TypeName
      txtMaxCount = MyCardType.MaxCount
      txtMaxDays = MyCardType.MaxDays
      txtAddDays = MyCardType.AddDays
    Else
      MsgBox ("此借阅证的类型已经不存在,请重新输入")
      Exit Sub
    End If
    '在借阅记录中查找该借阅证借阅数量
    txtBCount = MyBorrowList.GetBorrowCount(Trim(txtCardNo))
  End If
  GridRefresh
End Sub

Private Sub Form_Load()
  GridRefresh
End Sub
Private Sub GridRefresh()
  '设置ADO控件的连接字符串
  Adodc1.ConnectionString = conn
  '设置数据源
  Adodc1.RecordSource = "SELECT l.Id AS 编号,l.BookNo AS 图书编号,b.BookName AS 图书名称," _
      + "l.BorrowCount AS 借阅数量,l.ReturnDate AS 应归还日期,l.GDate AS 续借日期," _
      + "l.RealReturnDate AS 实际归还日期,l.Forfeit AS 罚金,l.Status AS 状态" _
      + " FROM BorrowList l,BookInfo b,Borrow w " _
      + " WHERE l.BookNo=b.BookNo AND w.CardNo='" + Trim(txtCardNo) + "' AND " _
      + "w.BorrowNo=l.BorrowNo AND l.Status NOT IN ('丢失','归还')"
  Adodc1.Refresh
  DataGrid1.Columns(0).Width = 800
  DataGrid1.Columns(1).Width = 1200
  DataGrid1.Columns(2).Width = 1400
  DataGrid1.Columns(3).Width = 1200
  DataGrid1.Columns(4).Width = 1200
End Sub

⌨️ 快捷键说明

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