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

📄 returncd.frm

📁 VB+ACCESS2000编写的VCD出租管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Begin VB.Label Label4 
         Caption         =   "影碟类别:"
         Height          =   375
         Left            =   360
         TabIndex        =   7
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "影碟名称:"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   360
         Width           =   975
      End
   End
   Begin VB.Frame Frame1 
      Height          =   735
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   8055
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFFF&
         Height          =   375
         Left            =   1320
         TabIndex        =   2
         Top             =   240
         Width           =   2175
      End
      Begin VB.Label Label2 
         Caption         =   "<输入编号后按回车键>"
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   3840
         TabIndex        =   3
         Top             =   360
         Width           =   1935
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "影碟编号:"
         Height          =   180
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   900
      End
   End
   Begin VB.Label LabelYJ 
      AutoSize        =   -1  'True
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   240
      Left            =   3960
      TabIndex        =   25
      Top             =   1200
      Visible         =   0   'False
      Width           =   120
   End
End
Attribute VB_Name = "ReturnCD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim LSum As Integer
Private Sub Command1_Click()
Dim SQL As String
Dim sum As Integer
If Text1.Text = "" Then
    MsgBox "对不起,请先输入影碟编号后按回车键!", vbInformation + vbOKOnly, "警告"
    Text1.Text = ""
    Text1.SetFocus
    Exit Sub
End If
If Frame3.Visible = True Then
    SQL = "update viplentinfo set 还碟时间= #" & Date & "# where 影碟编号= """ & Text1.Text & """"
    OpenDBFile
    gCon.Execute SQL
    CloseDBFile
    
    SQL = "select 还剩盘数 from vipinfo where 会员ID=""" & TxtVip.Text & """"
    OpenDBFile
    OpenRS (SQL)
    If Not gRst.EOF Then
        sum = gRst("还剩盘数")
    End If
    CloseRS
End If
If Frame4.Visible = True Then
    SQL = "update lentinfo set 还碟时间=#" & Date & "#,影碟租金=" & TxtL.Text & ",超出天数= " & TxtD.Text & ",罚款=" & TxtF.Text & " where 影碟编号=""" & Text1.Text & """"
    OpenDBFile
    gCon.Execute SQL
    CloseDBFile
End If
LSum = LSum + 1
SQL = "update cdinfo set 借出次数=" & LSum & ",是否借出= 0 where 影碟编号=""" & Text1.Text & """"
OpenDBFile
gCon.Execute SQL
CloseDBFile

If Frame3.Visible = True Then
    MsgBox "操作成功,该会员还剩:" & sum & "盘影碟可租!", vbInformation + vbOKOnly, "提示"
    Text1.Text = ""
    Text1.SetFocus
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    TxtVip.Text = ""
    Frame3.Visible = False
    LabelYj.Visible = False
    Frame4.Visible = False
End If
If Frame4.Visible = True Then
    MsgBox "操作成功," & LabelYj.Caption & ",结算返回!", vbInformation + vbOKOnly, "提示"
    Text1.Text = ""
    Text1.SetFocus
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    TxtL.Text = ""
    TxtD.Text = ""
    TxtF.Text = ""
    LabelYj.Caption = ""
    Frame3.Visible = False
    LabelYj.Visible = False
    Frame4.Visible = False
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub text1_keypress(keyascii As Integer)
Dim SQL As String
Dim Tmp As Integer
Dim Tmps As Integer
If keyascii = "13" And Text1.Text <> "" Then
  SQL = "select 是否借出 from cdinfo where 影碟编号=""" & Text1.Text & """"
  OpenDBFile
  OpenRS (SQL)
  If Not gRst.EOF Then
      If gRst("是否借出") <> -1 Then
         MsgBox "对不起,该影碟尚未借出,请重新输入需还的影碟编号!", vbInformation + vbOKOnly, "提示"
         Text1.SetFocus
         Text1.SelStart = 0
         Text1.SelLength = Len(Text1.Text)
         CloseRS
         Exit Sub
      End If
   End If
   CloseRS
   
    SQL = "select * from cdinfo,lentinfo,cdtype where cdinfo.影碟编号=lentinfo.影碟编号 and cdinfo.影碟类别=cdtype.影碟类别 and lentinfo.影碟编号=""" & Text1.Text & """"
    OpenDBFile
    OpenRS (SQL)
    If Not gRst.EOF Then
        Text2.Text = gRst("lentinfo.影碟名称")
        Text3.Text = gRst("cdinfo.影碟类别")
        Text4.Text = gRst("光碟数量")
        Text5.Text = gRst("借碟时间")
        LSum = gRst("借出次数")
        TxtL.Text = gRst("cdtype.影碟租金")
        Tmps = CStr(Date - gRst("借碟时间"))
        Tmp = gRst("借出天数")
        If CInt(Tmps) - CInt(Tmp) > 0 Then
            TxtD.Text = CInt(Tmps) - CInt(Tmp)
            TxtF.Text = gRst("cdtype.罚款") * TxtD.Text
        Else
            TxtD.Text = "0"
            TxtF.Text = "0"
        End If
        Frame4.Visible = True
        LabelYj.Visible = True
        LabelYj.Caption = "应退押金:" & gRst("所交押金") & "元" & " 应交租金:" & CInt(TxtL.Text) + CInt(TxtF.Text) & "元"
        Frame3.Visible = False
        CloseRS
    Else
        CloseRS
        SQL = "select * from cdinfo,viplentinfo where  cdinfo.影碟编号=viplentinfo.影碟编号 and viplentinfo.影碟编号=""" & Text1.Text & """"
        OpenDBFile
        OpenRS (SQL)
        If Not gRst.EOF Then
               Text2.Text = gRst("影碟名称")
               Text3.Text = gRst("影碟类别")
               Text4.Text = gRst("光碟数量")
               LSum = gRst("借出次数")
               Text5.Text = gRst("借碟时间")
               TxtVip.Text = gRst("会员编号")
               Frame3.Visible = True
               LabelYj.Visible = False
               Frame4.Visible = False
               CloseRS
        Else
               CloseRS
               MsgBox "对不起你所输入的影碟编号不存在,请重新输入!", vbInformation + vbOKOnly, "警告"
               Text1.SetFocus
               Text1.SelStart = 0
               Text1.SelLength = Len(Text1.Text)
               Text2.Text = ""
               Text3.Text = ""
               Text4.Text = ""
               Text5.Text = ""
               Frame3.Visible = False
               LabelYj.Visible = False
               Frame4.Visible = False
               Exit Sub
        End If
    End If
ElseIf keyascii = "13" And Text1.Text = "" Then
    MsgBox "对不起,请先输入影碟编号后按回车键!", vbInformation + vbOKOnly, "警告"
    Text1.Text = ""
    Text1.SetFocus
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Frame3.Visible = False
    LabelYj.Visible = False
    Frame4.Visible = False
End If
End Sub


⌨️ 快捷键说明

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