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

📄 foruserticket.frm

📁 这个是我们软件工程的课程设计成果
💻 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 ForUserTicket 
   Caption         =   "用户订票信息"
   ClientHeight    =   6930
   ClientLeft      =   60
   ClientTop       =   435
   ClientWidth     =   10005
   LinkTopic       =   "Form1"
   ScaleHeight     =   6930
   ScaleWidth      =   10005
   StartUpPosition =   2  'CenterScreen
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   3120
      Top             =   240
      Visible         =   0   'False
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=train;Data Source=CHENYIDAN"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=train;Data Source=CHENYIDAN"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   " select * from 用户订票表单"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.PictureBox Picture1 
      BorderStyle     =   0  'None
      Height          =   495
      Left            =   120
      Picture         =   "ForUserTicket.frx":0000
      ScaleHeight     =   495
      ScaleWidth      =   495
      TabIndex        =   12
      Top             =   120
      Width           =   495
   End
   Begin VB.Frame Frame3 
      BackColor       =   &H00FFC0FF&
      Caption         =   "查询条件"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   240
      TabIndex        =   7
      Top             =   4080
      Width           =   9255
      Begin VB.TextBox Text4 
         BackColor       =   &H00FFC0C0&
         Height          =   375
         Left            =   3000
         TabIndex        =   17
         Text            =   "Text4"
         Top             =   480
         Width           =   1695
      End
      Begin VB.TextBox Text3 
         BackColor       =   &H00C0FFC0&
         Enabled         =   0   'False
         Height          =   405
         Left            =   7680
         TabIndex        =   15
         Text            =   "Text3"
         Top             =   480
         Width           =   1095
      End
      Begin VB.TextBox Text2 
         BackColor       =   &H00C0FFC0&
         Enabled         =   0   'False
         Height          =   375
         Left            =   5400
         TabIndex        =   11
         Text            =   "Text2"
         Top             =   480
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFC0C0&
         Height          =   375
         Left            =   840
         TabIndex        =   9
         Text            =   "Text1"
         Top             =   480
         Width           =   1455
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFC0FF&
         Caption         =   "元"
         Height          =   375
         Left            =   8880
         TabIndex        =   18
         Top             =   480
         Width           =   255
      End
      Begin VB.Label Label4 
         BackColor       =   &H00FFC0FF&
         Caption         =   "车票编号"
         Height          =   375
         Left            =   2280
         TabIndex        =   16
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label3 
         BackColor       =   &H00FFC0FF&
         Caption         =   "补交金额"
         Height          =   375
         Left            =   6720
         TabIndex        =   14
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label2 
         BackColor       =   &H00FFC0FF&
         Caption         =   "姓  名"
         Height          =   375
         Left            =   4800
         TabIndex        =   10
         Top             =   480
         Width           =   495
      End
      Begin VB.Label Label1 
         BackColor       =   &H00FFC0FF&
         Caption         =   "证件号码"
         Height          =   375
         Left            =   120
         TabIndex        =   8
         Top             =   480
         Width           =   855
      End
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00FFC0FF&
      Caption         =   "操作"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   240
      TabIndex        =   1
      Top             =   5400
      Width           =   9255
      Begin VB.CommandButton Command5 
         BackColor       =   &H00C0E0FF&
         Caption         =   "领票"
         Height          =   495
         Left            =   2040
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   360
         Width           =   1335
      End
      Begin VB.CommandButton Command4 
         BackColor       =   &H00C0E0FF&
         Caption         =   "更新"
         Height          =   495
         Left            =   5760
         MaskColor       =   &H00C0E0FF&
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   360
         Width           =   1335
      End
      Begin VB.CommandButton Command3 
         BackColor       =   &H00C0E0FF&
         Caption         =   "退出"
         Height          =   495
         Left            =   7560
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Command2 
         BackColor       =   &H00C0E0FF&
         Caption         =   "删除"
         Height          =   495
         Left            =   3960
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   360
         Width           =   1215
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0E0FF&
         Caption         =   "查询"
         Height          =   495
         Left            =   360
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   360
         Width           =   1215
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFC0FF&
      Caption         =   "用户订票信息"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3015
      Left            =   240
      TabIndex        =   0
      Top             =   720
      Width           =   9255
      Begin MSDataGridLib.DataGrid DataGrid1 
         Bindings        =   "ForUserTicket.frx":030A
         Height          =   2295
         Left            =   240
         TabIndex        =   2
         Top             =   480
         Width           =   8655
         _ExtentX        =   15266
         _ExtentY        =   4048
         _Version        =   393216
         AllowUpdate     =   0   'False
         BackColor       =   12648447
         Enabled         =   -1  'True
         ColumnHeaders   =   -1  'True
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            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
   End
   Begin VB.Image Image1 
      Height          =   11520
      Left            =   -3600
      Picture         =   "ForUserTicket.frx":031F
      Top             =   -480
      Width           =   15360
   End
End
Attribute VB_Name = "ForUserTicket"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public SaleOrBookSale As Boolean '是"领票"还是"售票"

Private Sub Command1_Click()
If Text1.Text = "" And Text4.Text = "" Then
 MsgBox ("请输入证件号 或者 车票编号!!!")
 Exit Sub
 ElseIf Text1.Text = "" And Text4.Text <> "" Then
 Adodc1.RecordSource = "Select * from 用户订票表单 where 车票编号 =  '" & Text4.Text _
   & "'"
Adodc1.Refresh
 ElseIf Text1.Text <> "" And Text4.Text = "" Then
    Adodc1.RecordSource = "Select * from 用户订票表单 where 有效证件号 =  '" & Text1.Text _
   & "'"
 Adodc1.Refresh
 Else
    Adodc1.RecordSource = "Select * from 用户订票表单 where 有效证件号 =  '" & Text1.Text _
   & "' and  车票编号 =  '" & Text4.Text & "' "
 Adodc1.Refresh
End If
If Adodc1.Recordset.EOF = False Or Adodc1.Recordset.BOF = False Then
 Text1.Text = Adodc1.Recordset.Fields(13)
 Text2.Text = Adodc1.Recordset.Fields(14)
 Text3.Text = Adodc1.Recordset.Fields(17)
 Text4.Text = Adodc1.Recordset.Fields(5)
End If
End Sub

Private Sub Command2_Click()
Dim i As Integer
i = MsgBox("确定删除该记录??", vbYesNo + vbExclamation, "提示")
If i = vbYes Then
   If DataGrid1.SelBookmarks.Count <> 0 Then
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
   End If
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
 Adodc1.RecordSource = " select 车票编号,有效证件号,姓名,联系方式,地址,预付金额,未付金额 from 用户订票表单"
 Adodc1.Refresh
End Sub

Private Sub Command5_Click()
If Adodc1.Recordset.EOF = True Or Adodc1.Recordset.BOF = True Then
  MsgBox "无效车票!", vbYesNo + vbExclamation, "提示"
  Exit Sub
End If
 SaleOrBookSale = True
 
 SaleTicket.Text1 = Adodc1.Recordset.Fields(5)
 SaleTicket.Text2 = Adodc1.Recordset.Fields(0)
 SaleTicket.Text3 = Adodc1.Recordset.Fields(1)
 SaleTicket.Text4 = Adodc1.Recordset.Fields(2)
 SaleTicket.Text5 = Adodc1.Recordset.Fields(3)
 SaleTicket.Text6 = Adodc1.Recordset.Fields(4)
 SaleTicket.Text7 = Adodc1.Recordset.Fields(6)
 SaleTicket.Text8 = Adodc1.Recordset.Fields(7)
 SaleTicket.Text9 = Adodc1.Recordset.Fields(8)
 SaleTicket.Text10 = Adodc1.Recordset.Fields(9)
 
SaleTicket.Show
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

End Sub

⌨️ 快捷键说明

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