图5.6 付款退订页面
代码:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
num.Text = Request.QueryString("a2")
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql As String
sql = "select * from 订票信息表 where 订票编号= '" & num.Text & "'"
Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)
Dim reader As SqlDataReader
myconnection.Open()
reader = selectcommand.ExecuteReader()
reader.Read()
username.Text = reader.Item("客户姓名")
airnum.Text = reader.Item("航线编号")
takeuptime.Text = reader.Item("出发日期")
takeup.Text = reader.Item("出发城市")
takedown.Text = reader.Item("到达城市")
price.Text = reader.Item("舱位价格")
cangwei.Text = reader.Item("舱位类型")
myconnection.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql As String
sql = "update 订票信息表 set 是否结算='是' where 订票编号= '" & num.Text & "'"
Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)
myconnection.Open()
selectcommand.ExecuteNonQuery()
Response.Write("<script languaage='javascript'>alert('确认付款!')</script>")
Response.Redirect("付款退定.aspx")
myconnection.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql As String
sql = "delete from 订票信息表 where 订票编号= '" & num.Text & "'"
Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)
myconnection.Open()
selectcommand.ExecuteNonQuery()
myconnection.Close()
Response.Write("<script languaage='javascript'>alert('确认删除!')</script>")
Response.Redirect("付款退定.aspx")
End Sub
用户登录后可以通过该页查看自己注册资料,点击修改并可以对想要修改的项目进行修改。
用户资料修改界面设计如图5.7 图5.8 图5.9所示
图5.7 用户资料查看界面
代码:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
userid.Text = Session("用户编号")
username.Text = Session("用户名")
If userid.Text = "" Then
Response.Write("<script languaage='javascript'>alert('请先登陆!')</script>")
Response.Redirect("登陆.aspx")
Else
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql As String
sql = "select * from 客户信息表 where 用户名='" & userid.Text & "'"
Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)
Dim reader As SqlDataReader
myconnection.Open()
reader = selectcommand.ExecuteReader()
reader.Read()
zjleixing.Text = reader.Item("证件类型")
zjnum.Text = reader.Item("证件号码")
honenum.Text = reader.Item("联系电话")
mobel.Text = reader.Item("手机")
fax.Text = reader.Item("传真")
e_mail.Text = reader.Item("电子邮箱")
work.Text = reader.Item("工作单位")
addr.Text = reader.Item("通信地址")
postnum.Text = reader.Item("邮政编码")
End If
End Sub
图5.8 用户资料修改界面
代码:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql As String
sql = "update 客户信息表 set " & item.Text & "='" & TextBox1.Text.Trim & "' where 用户名= '" & Label1.Text & "'"
Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)
myconnection.Open()
selectcommand.ExecuteNonQuery()
myconnection.Close()
Response.Write("<script languaage='javascript'>alert('修改成功!')</script>")
Response.Redirect("个人资料管理.aspx")
End Sub
图5.9密码修改界面设计
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If oldpwd.Text = "" Then
Response.Write("<script languaage='javascript'>alert('请输入旧密码!')</script>")
Else
Dim myconnection As SqlConnection
myconnection = New SqlConnection("server=(local);uid=sa;password=123;database=电子客票")
Dim sql1 As String
sql1 = "select 登陆密码 from 客户信息表 where 用户名= '" & Label4.Text & "'and 登陆密码='" & oldpwd.Text & "'"
Dim selectcommand1 As SqlCommand = New SqlCommand(sql1, myconnection)
Dim reader1 As SqlDataReader
Dim temp1 As String
myconnection.Open()
reader1 = selectcommand1.ExecuteReader()
temp1 = reader1.Read()
myconnection.Close()
If LCase(temp1) <> "true" Then
Response.Write("<script languaage='javascript'>alert('旧密码不正确,请重新输入!')</script>")
oldpwd.Text = ""
Else
If newpwd1.Text <> newpwd2.Text Then
Response.Write("<script languaage='javascript'>alert('新密码密码不正确,请重新输入!')</script>")
newpwd1.Text = ""
newpwd2.Text = ""
Else
Dim sql2 As String
sql2 = "update 客户信息表 set 登陆密码='" & newpwd1.Text & "' where 用户名= '" & Label4.Text & "'"
Dim selectcommand2 As SqlCommand = New SqlCommand(sql2, myconnection)
myconnection.Open()
selectcommand2.ExecuteNonQuery()
Response.Write("<script languaage='javascript'>alert('修改成功!')</script>")
Response.Redirect("个人资料管理.aspx")
myconnection.Close()
End If
End If
End If
客机信息管理、航线信息管理、登机管理、管理员管理
不同的管理员有不同的权限,本系统设计了三种不同的管理员:系统管理员、登机管理员、航线管理员。其中航线管理员负责对客机信息和航线信息的添加、修改、删除,登记管理员负责在机场乘客登机操作,系统管理员权限最高兼有上诉两个管理员的功能。系统通过管理员登陆时来判断管理员的权限。管理员登陆界面设计如图5.10 所示,代码和用户登录相似这里略去。
图5.10 管理员登陆界面设计
管理员登陆以后如果是航线管理员或者是系统管理员,就可对客机和航线进行增添修改。客机信息管理如图5.11 至 图5.14所示。
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>