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

📄 fortrainprice.frm

📁 这个是我们软件工程的课程设计成果
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   9
      Top             =   3120
      Width           =   1215
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   " 软座价格 "
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   840
      TabIndex        =   8
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   " 硬座价格"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4320
      TabIndex        =   7
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   " 列车类型"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   840
      TabIndex        =   6
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   " 目的站"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4320
      TabIndex        =   3
      Top             =   1680
      Width           =   855
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "起点站"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   2
      Top             =   960
      Width           =   735
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "车   次"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1200
      TabIndex        =   0
      Top             =   960
      Width           =   735
   End
   Begin VB.Image Image1 
      Height          =   11520
      Left            =   -5520
      Picture         =   "ForTrainPrice.frx":08CA
      Top             =   -1200
      Width           =   15360
   End
End
Attribute VB_Name = "ForTrainPrice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
 MsgBox "车次不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
End If

 If Text3.Text = "" Then
 MsgBox "目的站不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
  If Text4.Text = "" Then
 MsgBox "起点站不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
 If Text5.Text = "" Then
 MsgBox "列车类型不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 If Text6.Text = "" Then
 MsgBox "软座价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
 If Text6.Text <> "" Then
   If Not IsNumeric(Text6.Text) Then
      MsgBox "软座价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text6.SetFocus
      Text6.Text = ""
      Exit Sub
   End If
End If

 If Text7.Text = "" Then
 MsgBox "软卧上价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
 If Text7.Text <> "" Then
    If Not IsNumeric(Text7.Text) Then
      MsgBox "软卧上价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text7.SetFocus
      Text7.Text = ""
      Exit Sub
   End If
End If

 If Text8.Text = "" Then
 MsgBox "软卧下价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 End If
 
If Text8.Text <> "" Then
     If Not IsNumeric(Text8.Text) Then
      MsgBox "软卧下价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text8.SetFocus
      Text8.Text = ""
      Exit Sub
   End If
End If

 If Text9.Text = "" Then
 MsgBox "硬座价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
 If Text9.Text <> "" Then
       If Not IsNumeric(Text9.Text) Then
      MsgBox "硬座价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text9.SetFocus
      Text9.Text = ""
      Exit Sub
        End If
End If

If Text10.Text = "" Then
 MsgBox "硬卧上价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
 If Text10.Text <> "" Then
      If Not IsNumeric(Text10.Text) Then
      MsgBox "硬卧上价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text10.SetFocus
      Text10.Text = ""
      Exit Sub
        End If
End If

 If Text11.Text = "" Then
 MsgBox "硬卧中价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
If Text11.Text <> "" Then
      If Not IsNumeric(Text11.Text) Then
      MsgBox "硬卧中价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text11.SetFocus
      Text11.Text = ""
      Exit Sub
     End If
End If

 If Text12.Text = "" Then
 MsgBox "硬卧下价格不能为空!!!", vbOKOnly + vbExclamation, "提示"
 Exit Sub
 End If
 
If Text12.Text <> "" Then
    If Not IsNumeric(Text12.Text) Then
      MsgBox "硬卧下价格应为数字!!!", vbOKOnly + vbExclamation, "提示"
      Text12.SetFocus
      Text12.Text = ""
      Exit Sub
     End If
End If
If ForTrianInfo.AddOrModify = False Then
  ForTrianInfo.Adodc1.Recordset.Delete
End If

  'Adodc1.RecordSource = "Insert into 车票价格表 values('" & Text1.Text _
 '& "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text _
 '& "','" & Text8.Text & "','" & Text9.Text & "','" & Text10.Text & "','" & Text11.Text _
' & "','" & Text12.Text & "')"
'ForTrianInfo.Adodc1.RecordSource = "select * from 车票价格表"
'ForTrianInfo.Adodc1.Refresh
Adodc1.RecordSource = "select * from 车票价格表 where 车次='" & Text1.Text & "'"
   Adodc1.Refresh
  If Adodc1.Recordset.EOF = False Or Adodc1.Recordset.BOF = False Then
    MsgBox "您输入的车次有重复!请输入其它编号!!!"
    Text1.SetFocus
    Exit Sub
  End If
  
  Adodc1.Refresh
  Adodc1.Recordset.AddNew
  Adodc1.Recordset("车次") = Trim(Text1.Text)
  Adodc1.Recordset("列车类型") = Trim(Text3.Text)
  Adodc1.Recordset("起点站") = Trim(Text4.Text)
  Adodc1.Recordset("目的站") = Trim(Text5.Text)
  Adodc1.Recordset("硬座价格") = Trim(Text6.Text)
  Adodc1.Recordset("软座价格") = Trim(Text7.Text)
  Adodc1.Recordset("硬卧上价格") = Trim(Text8.Text)
  Adodc1.Recordset("硬卧中价格") = Trim(Text9.Text)
  Adodc1.Recordset("硬卧下价格") = Trim(Text10.Text)
  Adodc1.Recordset("软卧上价格") = Trim(Text11.Text)
  Adodc1.Recordset("软卧下价格") = Trim(Text12.Text)
  Adodc1.Recordset.Update
  Adodc1.Refresh
  MsgBox "信息添加成功!!!", vbOKOnly + vbExclamation, "提示"
  Text1.Text = ""
 Text3.Text = ""
 Text4.Text = ""
 Text5.Text = ""
 Text6.Text = ""
 Text7.Text = ""
 Text8.Text = ""
 Text9.Text = ""
 Text10.Text = ""
 Text11.Text = ""
 Text12.Text = ""
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Form_Load()
Text1.Text = ""

Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""

End Sub

⌨️ 快捷键说明

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