资源简介
采用C#语言和asp.net环境做的网上航空售票系统,包含用户和管理员两个权限,包含订票和购票等页面,整天布局简单
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace AirTicket
{
public partial class BookingInquiry : System.Web.UI.Page
{
string strCon = System.Configuration.ConfigurationManager.ConnectionStrings[“con“].ToString();//定义链接数据库
SqlConnection sqlcon;
SqlCommand sqlcom;
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
protected void GridView1_RowEditing(object sender GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bind();
}
//删除
protected void GridView1_RowDeleting(object sender GridViewDeleteEventArgs e)
{
string sqlstr = “delete from BookTicket where Oid=‘“ + GridView1.DataKeys[e.RowIndex].Value.ToString() + “‘“;
sqlcon = new SqlConnection(strCon);
sqlcom = new SqlCommand(sqlstr sqlcon);
sqlcon.Open();
sqlcom.ExecuteNonQuery();
sqlcon.Close();
bind();
}
//更新
protected void GridView1_RowUpdating(object sender GridViewUpdateEventArgs e)
{
sqlcon = new SqlConnection(strCon);
string sqlstr = “update BookTicket set OPlane=‘“
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim() + “‘OTicketype=‘“
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + “‘ObuyTime=‘“
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() + “‘Ousetime=‘“
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim() + “‘Omoney=‘“
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim() + “‘ where Oid=‘“
+ GridView1.DataKeys[e.RowIndex].Value.ToString() + “‘“;
sqlcom = new SqlCommand(sqlstr sqlcon);
sqlcon.Open();
sqlcom.ExecuteNonQuery();
sqlcon.Close();
GridView1.EditIndex = -1;
bind();
}
//取消
protected void GridView1_RowCancelingEdit(object sender GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind();
}
//绑定
public void bind()
{
string sqlstr = “select * from BookTicket“;
sqlcon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter(sqlstr sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds “BookTicket“);
GridView1.DataSource = myds;
GridVie
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-06-06 21:45 AirTicket\
目录 0 2011-06-06 11:53 AirTicket\AirTicket\
文件 567339 2011-06-06 21:45 AirTicket\AirTicket.zip
目录 0 2011-06-06 12:20 AirTicket\AirTicket\AirTicket\
文件 917 2011-05-30 17:14 AirTicket\AirTicket\AirTicket.sln
文件 77824 2011-06-06 22:58 AirTicket\AirTicket\AirTicket.suo
文件 9964 2011-06-06 12:22 AirTicket\AirTicket\AirTicket\AirTicket.csproj
文件 1169 2011-06-06 12:22 AirTicket\AirTicket\AirTicket\AirTicket.csproj.user
目录 0 2011-05-31 20:24 AirTicket\AirTicket\AirTicket\App_Code\
目录 0 2011-06-06 15:46 AirTicket\AirTicket\AirTicket\bin\
文件 36864 2011-06-06 21:37 AirTicket\AirTicket\AirTicket\bin\AirTicket.dll
文件 85504 2011-06-06 21:37 AirTicket\AirTicket\AirTicket\bin\AirTicket.pdb
文件 3059 2011-06-06 12:18 AirTicket\AirTicket\AirTicket\BookingInquiry.aspx
文件 3361 2011-06-06 12:17 AirTicket\AirTicket\AirTicket\BookingInquiry.aspx.cs
文件 818 2011-06-06 12:18 AirTicket\AirTicket\AirTicket\BookingInquiry.aspx.designer.cs
文件 5674 2011-06-06 17:55 AirTicket\AirTicket\AirTicket\BookTicket.aspx
文件 7028 2011-06-06 17:51 AirTicket\AirTicket\AirTicket\BookTicket.aspx.cs
文件 4325 2011-06-06 17:50 AirTicket\AirTicket\AirTicket\BookTicket.aspx.designer.cs
文件 4273 2011-05-30 17:19 AirTicket\AirTicket\AirTicket\Computer.aspx
文件 331 2011-05-30 17:18 AirTicket\AirTicket\AirTicket\Computer.aspx.cs
文件 805 2011-05-30 17:19 AirTicket\AirTicket\AirTicket\Computer.aspx.designer.cs
文件 17680 2011-06-06 21:36 AirTicket\AirTicket\AirTicket\ConfigEstablishment.aspx
文件 20527 2011-06-06 21:37 AirTicket\AirTicket\AirTicket\ConfigEstablishment.aspx.cs
文件 17922 2011-06-06 21:36 AirTicket\AirTicket\AirTicket\ConfigEstablishment.aspx.designer.cs
目录 0 2011-06-06 11:53 AirTicket\AirTicket\AirTicket\DB_51aspx\
目录 0 2011-06-06 11:53 AirTicket\AirTicket\AirTicket\image\
文件 9996 2011-05-13 12:57 AirTicket\AirTicket\AirTicket\image\20073111530369.jpg
文件 334 2011-05-13 12:57 AirTicket\AirTicket\AirTicket\image\bar.jpg
文件 290 2011-05-13 12:57 AirTicket\AirTicket\AirTicket\image\c.gif
文件 152 2011-05-13 12:57 AirTicket\AirTicket\AirTicket\image\center.gif
文件 4945 2011-05-13 12:57 AirTicket\AirTicket\AirTicket\image\from.gif
............此处省略54个文件信息
相关资源
- ASP.NET程序开发范例宝典 百度云
- asp.net FileUpload 上传进度条
- 很好用的一个asp.net反编译软件
- asp.net实现qq登陆
- 试题库管理系统毕业论文(C#)源程序
- 亮剑asp.net案例导航项目开发
- 亮剑ASP.NET项目开发案例导航-part03共三
- [源代码] 《领域驱动设计 (C# 2008 实
- ASP.NET+SQL Server 2008 实现的学生学籍管
- asp.net中最好的对SQLSERVER数据库进行操
- 安卓和asp.net通过webservice上传图片到服
- asp.net2.0
- ASP.net MVC vcard名片二维码自动生成
- asp.net 访问odbc informix源码及配置截图
- 一个简单的ASP.NET三层架构登陆模式
- asp.net 在线聊天室系统源代码.rar
- ppt课件:asp.netpdf格式
- C#多文件打包
- 好用的asp.net UI框架
- zw_ASP.NET通用权限管理系统源代码含文
- ASP.NET Core跨平台开发从入门到实战
- ASP.NET众筹网源码
- ASP.NET MVC5+EasyUI企业开发框架源码
- ASP.NET考勤管理系统(毕业设计)
- 进销存仓库管理系统ASP.Net网站
- 精通ASP.NET MVC 5 随书源码
- 基于ASP.NET网上服装销售系统源码
- asp.net+IIS+sqlserver选课系统毕业设计全
- ASP.net版校园零食网站
- 航空管理系统 asp.net
评论
共有 条评论