我现在要在三周之内做一个BS模式的购物网,也就类似当当卓越那些,不用实现网上开店,但我数据库和网页那些内容都没怎么看,所以现在有点感觉无从下手,请问我现在要查些什么资料或资料书才能对怎么做购物网有个大致的了解啊,我手上只有本C#入门经典,最好能给我介绍点电子书有这方面实例的``或者大致跟我说说具体开发流程怎样,是用VS做网页,然后再做数据库,最后把它们联起来么`?
调试欢乐多
http://blog.bingo929.com
这本书这不错
先把他的思路理清 看数据库结构关系 很快的 磨刀不误砍柴工从数据库中调 就好了 用 DataSource 数据源控件就出来了
第二:购物车,这个东西我给你啦
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Session["bus"] != null)
{
BusTable = (DataTable)Session["bus"];//用grd去绑定你选中的数据,就是物品的表
GridViewBind();
}
}
} private void GridViewBind()//让你看到购物车
{
GridView1.DataSource = BusTable;
GridView1.DataBind();
} protected void ImageButton1_Click(object sender, ImageClickEventArgs e)//没用
{
Response.Redirect("WriteOrder.aspx");
} protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)//更该购买数量
{
string isbn = GridView1.DataKeys[e.RowIndex].Value.ToString();
int num = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].Cells[3].FindControl("txtnum")).Text);//取值 foreach (DataRow dr in BusTable.Rows)
{
if (dr["goodid"].ToString() == isbn)
{
dr["num"] = num;
dr["count"] = Convert.ToSingle(dr["goodprice"]) * num;
}
}
Session["bus"] = BusTable;
GridView1.EditIndex = -1;
GridViewBind();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
GridViewBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)//不买了,删掉
{
string isbn = GridView1.DataKeys[e.RowIndex].Value.ToString();
for (int i = 0; i < BusTable.Rows.Count; i++)
{
if (BusTable.Rows[i]["goodid"].ToString() == isbn)
{
BusTable.Rows[i].Delete();
break;
}
}
BusTable.AcceptChanges();
Session["bus"] = BusTable;
GridViewBind();
}
float sum = 0.0f;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)//总计你花多钱
{
if (GridView1.EditIndex == -1)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
sum = sum + Convert.ToSingle(e.Row.Cells[4].Text);
}
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[0].Text = "总计:";
e.Row.Cells[1].Text = sum.ToString();
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
((LinkButton)(e.Row.Cells[6].FindControl("LinkButton9"))).Attributes.Add("onclick", "return confirm('你确定要删除吗?')");
}
}
if (e.Row.RowType == DataControlRowType.DataRow)//是否是数据行
{
//高亮显示指定行
e.Row.Attributes.Add("onMouseOver", "Color=this.style.backgroundColor;this.style.backgroundColor='#fff000'");
e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor=Color");
}
}
剩下的就剩排版了 ,这就是对付什么课程设计的最简单方法 我上学那会这东东,一天就做完,呵呵
哥们加油吧!