con.Open();
SqlDataReader dr = cmd.ExecuteReader(); if (!dr.HasRows) {
DataSet ds = Db.ReSet(\
BookID='\
string bookname = ds.Tables[0].Rows[0][2].ToString(); string bookpoint = ds.Tables[0].Rows[0][5].ToString(); string bookprice = ds.Tables[0].Rows[0][6].ToString(); string booknum = \ Db.ChkSql(\
Bo_Shop(ShopName,ShopTitle,ShopBID,ShopPoint,ShopPrice,ShopNum) values('\+ strcarID + \+ bookname + \+ strbookID + \
+ bookpoint + \
} else {
Db.ChkSql(\
ShopName='\+ \
}
Response.Redirect(\ } else {
Response.Write(\您还没有登录,
请先登录再购买!');\
} }
26
4.3.2购物车管理,将需要购买的书籍放入个人购物车:
27
图书结算后台代码:
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
if (Session[\ {
Response.Write(\您未登陆!');\ Response.Redirect(\ } else
{ //向购物车中添加商品 bind(); } } }
protected void bind() {
string strcarID = Session[\ DataSet da=Db.ReSet(\
ShopName='\
float P_fl_Count = 0;
foreach (DataRow dr in da.Tables[0].Rows)
28
{
P_fl_Count += Convert.ToSingle(dr[5])*Convert.ToSingle(dr[6]); }
Label1.Text = P_fl_Count.ToString();
shopview.DataSource=da; shopview.DataBind(); }
在购物车中对个人图书进行结算后,查看个人订单:
4.3.3个人中心管理,个人信息的查询和修改
29
相关推荐: