一、源码特点
ASP.NET 公交查询系统是一套完善的web设计管理系统,系统具有完整的源代码和数据库 支持二次换乘,系统主要采用B/S模式开发。开发环境为vs2010,数据库为sqlserver2008,使
用c#语言开发。
asp.net公交查询系统VS开发sqlserver数据库w
二、功能介绍
(1)用户管理:对用户信息进行添加、删除、修改和查看
(2)公告管理:对公告信息进行添加、删除、修改和查看
(3)站点管理:对站点信息进行添加、删除、修改和查看
(4)路线管理:对路线信息进行添加、删除、修改和查看
(5)路线站点管理:对路线站点信息进行添加、删除、修改和查看
(6)公交查询,可以支持线路查询,也支持站点查询,并且支持二次换乘
设计线路
L1(s1,s2,s3,s4,s5)
L2(s6,s7,s8,s5,s9)
L3(s9,s10,s11,s12,s13)
测试 例子
s1 到 s4
一次换乘
测试
s1 到 s9
二次换乘
s1 到s13
三、注意事项
1、管理员账号:admin 密码:admin
2、开发环境为vs2010,数据库为sqlserver2008,使用c#语言开发。
3、数据库文件名netgjcx.mdf
4.登录地址:login.aspx
换乘算法
{
MessageBox.Show(this.Page, "终点站点不能为空");
return;
}
DataSet ds = new DataSet();
string sql = "select a.lx as lx from (select lx from lxzd where zd = '" + zd1 + "') A, (select lx from lxzd where zd = '" + zd2 + "') B where A.lx = B.lx ";
//Response.Write(sql);
ds = DBHelper.query(sql);
string lx="";
int j = 0;
string str = "";
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{ //直达
str = str + "第" + (i + 1) + "方案,起始站点:" + zd1 + "乘坐" + ds.Tables[0].Rows[i]["lx"].ToString() + " ,在"+zd2+"下车"+ "\r\n";
j++;
}
this.Label2.Text = str;
if (j == 0)
{ //一次换成
sql = "select a.zd from ";
sql = sql + " ( select distinct zd from lxzd where lx in (select lx from lxzd where zd = '" + zd1 + "') )A,";
sql = sql + " ( select distinct zd from lxzd where lx in (select lx from lxzd where zd = '" + zd2 + "') )B";
sql = sql + " where A.zd= B.zd";
ds = DBHelper.query(sql);
str="";
int c = 0;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
sql = "select a.lx as lx from (select lx from lxzd where zd = '" + zd1 + "') A, (select lx from lxzd where zd = '" + ds.Tables[0].Rows[i]["zd"].ToString() + "') B where A.lx = B.lx";
//根据编号得到相应的记录
SqlDataReader sdr = DBHelper.GetReader(sql);
if (sdr.Read())
{
lx = sdr["lx"].ToString();//分析
}
sdr.Close();
str = str + "第" + (i + 1) + "方案,起始站点:" + zd1 + "乘坐" + lx + " ,在" + ds.Tables[0].Rows[i]["zd"].ToString() + "下车,换乘";
sql = "select a.lx as lx from (select lx from lxzd where zd = '" + zd2 + "') A, (select lx from lxzd where zd = '" + ds.Tables[0].Rows[i]["zd"].ToString() + "') B where A.lx = B.lx";