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

📄 returncd.frm

📁 VB影碟出租系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         End
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "编号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   210
         Left            =   360
         TabIndex        =   24
         Top             =   600
         Width           =   615
      End
      Begin VB.Label Label3 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   360
         TabIndex        =   23
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label Label4 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "类别:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   3480
         TabIndex        =   22
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label Label5 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "数量:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   360
         TabIndex        =   21
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label Label6 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "日期:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   3480
         TabIndex        =   20
         Top             =   1800
         Width           =   735
      End
      Begin VB.Label LabelYJ 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   3480
         TabIndex        =   19
         Top             =   2640
         Visible         =   0   'False
         Width           =   3375
      End
   End
End
Attribute VB_Name = "ReturnCD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
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



Private Sub Form_Load()
SkyGzForm1.Caption = Me.Caption
SkyGzForm1.hWnd = Me.hWnd
End Sub

Private Sub Form_Resize()
SkyGzForm1.Left = 0
SkyGzForm1.Top = 0
Me.Width = SkyGzForm1.Width - 5
Me.Height = SkyGzForm1.Height
Call SkyGzForm1.SetRgn(Me, 5)
End Sub
Private Sub SkyGzForm1_UnloadClick()
Unload Me
End Sub

⌨️ 快捷键说明

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