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

📄 退票.frm

📁 火车售票系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form5 
   Caption         =   "退票"
   ClientHeight    =   3390
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7545
   LinkTopic       =   "Form5"
   MDIChild        =   -1  'True
   ScaleHeight     =   3390
   ScaleWidth      =   7545
   Begin VB.TextBox Text13 
      DataField       =   "应退款"
      DataSource      =   "Adodc3"
      Height          =   270
      Left            =   6240
      TabIndex        =   17
      Top             =   3000
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.TextBox Text12 
      DataField       =   "票价"
      DataSource      =   "Adodc3"
      Height          =   270
      Left            =   6600
      TabIndex        =   16
      Top             =   2640
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.TextBox Text11 
      DataField       =   "退票时间"
      DataSource      =   "Adodc3"
      Height          =   270
      Left            =   6240
      TabIndex        =   15
      Top             =   2640
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.TextBox Text10 
      DataField       =   "票号"
      DataSource      =   "Adodc3"
      Height          =   270
      Left            =   5760
      TabIndex        =   14
      Top             =   2640
      Visible         =   0   'False
      Width           =   375
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   4800
      Top             =   2880
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   $"退票.frx":0000
      OLEDBString     =   $"退票.frx":0089
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "退票表"
      Caption         =   "Adodc3"
      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.TextBox Text9 
      DataField       =   "发车时间"
      DataSource      =   "Adodc2"
      Height          =   375
      Left            =   2160
      TabIndex        =   13
      Top             =   2760
      Visible         =   0   'False
      Width           =   495
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   2160
      Top             =   2400
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   $"退票.frx":0112
      OLEDBString     =   $"退票.frx":019B
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "发车时刻表"
      Caption         =   "Adodc2"
      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 Command1 
      Caption         =   "退票"
      Height          =   495
      Left            =   4560
      TabIndex        =   12
      Top             =   1920
      Width           =   1095
   End
   Begin VB.TextBox Text8 
      DataField       =   "退票否"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   360
      TabIndex        =   11
      Top             =   3000
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.TextBox Text7 
      DataField       =   "车次"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   1080
      TabIndex        =   10
      Top             =   3000
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.TextBox Text6 
      DataField       =   "票价"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   1200
      TabIndex        =   9
      Top             =   2280
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.TextBox Text5 
      DataField       =   "乘车日期"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   360
      TabIndex        =   8
      Top             =   2280
      Visible         =   0   'False
      Width           =   495
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   360
      Top             =   2640
      Visible         =   0   'False
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   $"退票.frx":0224
      OLEDBString     =   $"退票.frx":02AD
      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.TextBox Text4 
      Height          =   495
      Left            =   4440
      TabIndex        =   7
      Top             =   1080
      Width           =   1335
   End
   Begin VB.TextBox Text3 
      Height          =   495
      Left            =   4440
      TabIndex        =   6
      Top             =   240
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   1440
      TabIndex        =   3
      Top             =   1080
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   1440
      TabIndex        =   1
      Top             =   240
      Width           =   1455
   End
   Begin VB.Label Label4 
      Caption         =   "应退款:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3240
      TabIndex        =   5
      Top             =   1080
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "票价:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3240
      TabIndex        =   4
      Top             =   240
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "退票时间:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   120
      TabIndex        =   2
      Top             =   1080
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "票号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   1095
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc3.Recordset.AddNew
Text10.Text = Text1.Text
Text11.Text = Text2.Text
Text12.Text = Text3.Text
Text13.Text = Text4.Text
Adodc3.Recordset.Update
MsgBox "退票成功", 48, "成功"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub

Private Sub Text1_LostFocus()
Dim cc As String
Adodc1.Recordset.MoveFirst
Adodc2.Recordset.MoveFirst
cc = "票号='" & Text1.Text & "'"
If Text1.Text <> "" Then
  Adodc1.Recordset.Find cc
  Text3.Text = Text6.Text
  Text2.Text = Now
  cc = "车次='" & Text7.Text & "'"
  Adodc2.Recordset.Find cc
  If Not Adodc2.Recordset.EOF Then
    If Month(Text5.Text) > Month(Text2.Text) Then
       Text4.Text = Int(Val(Text6.Text) * 0.1 + 0.5)
    Else
      If Month(Text5.Text) = Month(Text2.Text) Then
         If Day(Text5.Text) > Day(Text2.Text) Then
           Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.1 + 0.5)
         Else
           If Day(Text5.Text) = Day(Text2.Text) Then
             If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) >= 120 Then
               Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.1 + 0.5)
             Else
               If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) >= 60 Then
                 Text4.Text = Val(Text6.Text) - Int(Val(Text6.Text) * 0.2 + 1)
               Else
                 If (Hour(Text9.Text) - Hour(Text2.Text)) * 60 + Minute(Text9.Text) - Minute(Text2.Text) < 5 Then
                   MsgBox "接近发车不能退票", 16, "错误"
                   Form5.Hide
                 Else
                   Text4.Text = Int(Val(Text6.Text) * 0.3 + 1)
                 End If
               End If
             End If
          Else
            MsgBox "车票过期不能退", 16, "错误"
            Form5.Hide
         End If
      End If
    Else
     MsgBox "车票过期不能退", 16, "错误"
     Form5.Hide
   End If
 End If
Else
 MsgBox "没有该票", 16, "错误"
End If
End If
End Sub

⌨️ 快捷键说明

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