毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 论文 >> 正文

ASP.NET电子客票系统 第7页

更新时间:2007-11-21:  来源:毕业论文

ASP.NET电子客票系统 第7页

5.11 客机信息管理界面

代码:

  Dim sql1 As String

        sql1 = "select * from 客机信息表"

        Dim selectcommand1 As SqlCommand = New SqlCommand(sql1, myconnection)

        Dim mycommand1 As New SqlDataAdapter(sql1, myconnection)

        Dim reader1 As SqlDataReader

        Dim ds1 As New DataSet

        myconnection.Open()

        reader1 = selectcommand1.ExecuteReader()

        myconnection.Close()

        mycommand1.Fill(ds1, "Literature")

        DataGrid1.DataSource = ds1.Tables("Literature").DefaultView

        DataGrid1.DataBind()

5.12 客机信息增添界面

 

代码:

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 = "select * from 客机信息表 where 客机编号= '" & plannum.Text & "'"

        Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)

        Dim reader As SqlDataReader

        Dim temp As String

        myconnection.Open()

        reader = selectcommand.ExecuteReader()

        temp = reader.Read()

        myconnection.Close()

        If LCase(temp) = "true" Then

            Response.Write("<script languaage='javascript'>alert('此客机已存在!')</script>")

        Else

            Dim sql1 As String

            sql1 = "insert into 客机信息表(客机编号,客机型号,购买日期,服役日期,经济舱座位数量,商务舱座位数量,头等舱座位数量) values ('" & plannum.Text.Trim & "','" & plankind.Text.Trim & "','" & buydate.Text.Trim & "','" & usedate.Text.Trim & "','" & jjc.Text.Trim & "','" & swc.Text.Trim & "','" & tdc.Text.Trim & "')"

            Dim selectcommand1 As SqlCommand = New SqlCommand(sql1, myconnection)

            myconnection.Open()

            selectcommand1.ExecuteNonQuery()

            myconnection.Close()

            Response.Write("<script languaage='javascript'>alert('增添成功!')</script>")

            plannum.Text = ""

            plankind.Text = ""

            buydate.Text = ""

            usedate.Text = ""

            jjc.Text = ""

            swc.Text = ""

            tdc.Text = ""

        End If

        myconnection.Close()

    End Sub

5.13 客机信息修改删除界面

5.14 客机信息修改界面

代码:代码与用户信息管管理和修改相似,这里略去。

5.2.3 航班信息管理

本功能有两个子功能,航线的增添、修改、删除和航线时刻的增添,用户通过这两个表搜索到航班信息。航班界面设计如图5.15 5.20 所示。

5.15 航线信息管理界面

代码:与客机信息管理相似这里略去。

5.16航线信息增添界面设计

代码:与客机信息增添相似这里略去。

5.17航线信息删除修改界面

5.18 航线信息修改界面设计

代码:与客机信息修改和删除相似这里略去。

5.19 航班信息管理界面设计

5.20 航班增添界面设计

代码:与客机信息管理和客机信息增添相似这里略去。

5.2.4 管理员管理界面

本功能有管理员增添和修改密码,增添管理员只有系统管理员才能增添。其他管理员只能修改密码。管理员管理界面如图5.21 5.22 所示。

5.21 增添管理员

代码:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        If adminid.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 sql As String

            sql = "select 管理员名 from 管理员表 where 管理员名='" & adminid.Text & "'"

            Dim selectcommand As SqlCommand = New SqlCommand(sql, myconnection)

            Dim reader As SqlDataReader

            Dim temp As String

            myconnection.Open()

            reader = selectcommand.ExecuteReader()

            temp = reader.Read()

            myconnection.Close()

            If LCase(temp) = "true" Then

                Response.Write("<script languaage='javascript'>alert('账号以存在!')</script>")

                adminid.Text = ""

                pwd1.Text = ""

                pwd2.Text = ""

            Else

                If pwd1.Text = "" Then

                    Response.Write("<script languaage='javascript'>alert('请输入密码!')</script>")

                Else

                    If pwd1.Text <> pwd2.Text Then

                        Response.Write("<script languaage='javascript'>alert('密码不正确!')</script>")

                        pwd1.Text = ""

                        pwd2.Text = ""

                    Else

                        Dim sql1 As String

                        sql1 = "insert into 管理员表(管理员名,权限,密码) values ('" & adminid.Text.Trim & "','" & DropDownList1.SelectedItem.Text.Trim & "','" & pwd1.Text.Trim & "')"

                        Dim selectcommand1 As SqlCommand = New SqlCommand(sql1, myconnection)

                        myconnection.Open()

                        selectcommand1.ExecuteNonQuery()

                        myconnection.Close()

                        Response.Write("<script languaage='javascript'>alert('注册成功!')</script>")

                        Session("用户名") = adminid.Text

                        Session("权限") = DropDownList1.SelectedItem.Text

                        Response.Redirect("管理主页.aspx")

                    End If

                End If

            End If

        End If

    End Sub

5.22 修改密码

代码:与用户修改密码相似这里略去。

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

ASP.NET电子客票系统 第7页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。