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

📄 frmtrainedit.frm

📁 本系统包括用户管理
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   240
         TabIndex        =   17
         Top             =   761
         Width           =   720
      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            =   3240
         TabIndex        =   16
         Top             =   761
         Width           =   720
      End
      Begin VB.Label Label6 
         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            =   240
         TabIndex        =   15
         Top             =   1650
         Width           =   720
      End
      Begin VB.Label Label8 
         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            =   3240
         TabIndex        =   14
         Top             =   1650
         Width           =   720
      End
      Begin VB.Label Label10 
         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            =   240
         TabIndex        =   13
         Top             =   1207
         Width           =   720
      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            =   3240
         TabIndex        =   12
         Top             =   1207
         Width           =   720
      End
   End
   Begin VB.CommandButton Cmd_Cancel 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   400
      Left            =   3662
      MouseIcon       =   "FrmTrainEdit.frx":0442
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   2880
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Ok 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   1292
      MouseIcon       =   "FrmTrainEdit.frx":074C
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   2880
      Width           =   1300
   End
End
Attribute VB_Name = "FrmTrainEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriId As Long
Public OriTno, OriSstation, OriEstation As String

Private Function Check() As Boolean
  If Trim(txtTno) = "" Then
    MsgBox "请输入火车车次"
    txtTno.SetFocus
    Check = False
    Exit Function
  End If
  If Trim(txtSstation) = "" Then
    MsgBox "请输入始发车站"
    txtSstation.SetFocus
    Check = False
    Exit Function
  End If
  If Trim(txtEstation) = "" Then
    MsgBox "请输入抵达车站"
    txtEstation.SetFocus
    Check = False
    Exit Function
  End If
  
  Check = True
End Function

Private Sub Cmd_OK_Click()
  If Check = False Then
    Exit Sub
  End If
  
  With MyTrain
  .Tno = MakeStr(txtTno)
  .Sstation = MakeStr(txtSstation)
  .Estation = MakeStr(txtEstation)
  .Stime = MakeStr(txtStime)
  .Etime = MakeStr(txtEtime)
  .PriceYz = Val(txtPriceYz)
  .PriceRz = Val(txtPriceRz)
  .PriceYw = Val(txtPriceYw)
  .PriceRw = Val(txtPriceRw)
  
  '判断火车信息是否存在
  If Modify = False Or OriTno <> Trim(txtTno) Or _
     OriSstation <> Trim(txtSstation) Or OriEstation <> Trim(txtEstation) Then
    If .In_DB(MakeStr(txtTno), MakeStr(txtSstation), MakeStr(txtEstation)) = True Then
      MsgBox "当前数据已经存在,请重新输入"
      txtTno.SetFocus
      txtTno.SelStart = 0
      txtTno.SelLength = Len(txtTno)
      Exit Sub
    End If
  End If
  If Modify = False Then
    .Insert
  Else
    .Update (OriId)
  End If
    
  End With
  Unload Me
End Sub

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub txtEstation_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtEtime_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtPriceRw_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Single(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtPriceRz_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Single(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtPriceYw_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Single(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtPriceYz_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
  If In_Single(KeyAscii) = False Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtSstation_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtStime_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

Private Sub txtTno_KeyPress(KeyAscii As Integer)
  EnterTAB (KeyAscii)
End Sub

⌨️ 快捷键说明

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