protected void BindAllTotal() { string UserName = Convert.ToString(Session["UserName"]); DataTable dt = GoodsManager.SelectAllTot_amt(UserName); if (dt != null && dt.Rows.Count != 0) { RPBuy.DataSource = dt; RPBuy.DataBind(); } string a = dt.Rows[0][0].ToString(); }
protected void LVShoppingcart_ItemCommand(object sender, ListViewCommandEventArgs e) { Label lbl = (Label)e.Item.FindControl("lbshoppingcartid"); string Eventname = e.CommandName; switch (Eventname) { case "Delete": { int ID = Convert.ToInt32(lbl.Text); int result = GoodsManager.DeleteShoppingCart(ID); if (result >= 1) { int ID02 = Convert.ToInt32(Session["UserID"]); DataTable ys = GoodsManager.JudgeShoppingCart(ID02); if (ys != null && ys.Rows.Count != 0) { Panel01.Visible = true; Panel02.Visible = false; } else { Panel01.Visible = false; Panel02.Visible = true; } string UserName = Convert.ToString(Session["UserName"]); DataTable dt = GoodsManager.SelectAllTot_amt(UserName); if (dt != null && dt.Rows.Count != 0) { RPBuy.DataSource = dt; RPBuy.DataBind(); } string UserID = Convert.ToString(Session["UserName"]); DataTable dt02 = GoodsManager.SelectShoppingCart(UserID); if (dt02 != null && dt02.Rows.Count != 0) { LVShoppingcart.DataSource = dt02; LVShoppingcart.DataBind(); } } } break; } }