欢迎来到天天文库
浏览记录
ID:40802778
大小:1.37 MB
页数:11页
时间:2019-08-07
《图书商城截图》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、网站页面网站重要代码:Login.aspx重要代码:stringno=TextBox1.Text;stringpwd=TextBox2.Text;SqlCommandmyCommand=sqlConnection1.CreateCommand();myCommand.CommandText="select*frommemberInfowhere账号='"+no+"'and密码='"+pwd+"'";sqlDataAdapter1.SelectCommand=myCommand;dataSet11.C
2、lear();intn=sqlDataAdapter1.Fill(dataSet11,"memberInfo");if(n==1){Session["Login"]="true";Session["memberNo"]=no;Session["memberName"]=dataSet11.Tables["memberInfo"].Rows[0]["姓名"].ToString();Session["LoginEmplOrMember"]="会员";Response.Redirect("Shopping
3、.aspx");}else{Label9.Text="";}Shopping.aspx重要代码:privatevoidDataGrid1_ItemCommand(objectsource,System.Web.UI.WebControls.DataGridCommandEventArgse){Session["ISBN"]=e.Item.Cells[1].Text;Session["bookName"]=e.Item.
4、Cells[2].Text;if(e.CommandName=="buy"){stringISBN=e.Item.Cells[1].Text;stringSM=e.Item.Cells[2].Text;doubleDJ=double.Parse(e.Item.Cells[4].Text);ShopCartView.Sort="ISBN";intn=ShopCartView.Find(ISBN);if(n==-1){DataRowdr=ShopCart.NewRow();dr["ISBN"]=ISBN
5、;dr["书名"]=SM;dr["市场价"]=DJ;doubleHYJ=DJ*(double.Parse(Session["discount"].ToString()));dr["会员价"]=HYJ;dr["数量"]=1;dr["金额"]=HYJ;ShopCart.Rows.Add(dr);}else{ShopCartView[n]["数量"]=(int)ShopCartView[n]["数量"]+1;doubleHYJ=DJ*(double.Parse(Session["discount"].To
6、String()));ShopCartView[n]["金额"]=(double)ShopCartView[n]["金额"]+HYJ;}ShopCartView.Sort=null;Session["ShopCart"]=ShopCart;intGSSL=0;doubleHYJE=0;for(inti=0;i7、YJE+=double.Parse(ShopCartView[i]["金额"].ToString());Session["HYJE"]=HYJE;}Session["SCJE"]=double.Parse(Session["HYJE"].ToString())/(double.Parse(Session["discount"].ToString()));Label3.Text=Session["GSSL"].ToString()+"本";Label4.Text=Session["SCJE"].ToS8、tring()+"元";Label5.Text=Session["HYJE"].ToString()+"元";}if(e.CommandName=="details"){Response.Redirect("Details.aspx");}if(e.CommandName=="comment"){Session["leaveWordsObj"]=e.Item.Cells[1].Text;Response.Redirect("SeeLeaveWords.aspx");}
7、YJE+=double.Parse(ShopCartView[i]["金额"].ToString());Session["HYJE"]=HYJE;}Session["SCJE"]=double.Parse(Session["HYJE"].ToString())/(double.Parse(Session["discount"].ToString()));Label3.Text=Session["GSSL"].ToString()+"本";Label4.Text=Session["SCJE"].ToS
8、tring()+"元";Label5.Text=Session["HYJE"].ToString()+"元";}if(e.CommandName=="details"){Response.Redirect("Details.aspx");}if(e.CommandName=="comment"){Session["leaveWordsObj"]=e.Item.Cells[1].Text;Response.Redirect("SeeLeaveWords.aspx");}
此文档下载收益归作者所有