void SetShoppingCartInfo(bool isAuthenticated, string userName, int uniqueId, ShoppingCart sc) { if (isAuthenticated) { sc.Shoppings = Shoppings.ShoppingLoad(GetUniqueId(userName).ToString()); } else { sc.Shoppings = Shoppings.ShoppingLoad(userName); } }
ShoppingCart GetShoppings(bool isAuthenticated, string userName) { ShoppingCart sc = new ShoppingCart(); if (isAuthenticated) { sc.Shoppings = Shoppings.ShoppingLoad(GetUniqueId(userName).ToString()); } else { sc.Shoppings = Shoppings.ShoppingLoad(userName); } return(sc); }
void BindAmount() { string userID = string.Empty; if (Profile.IsAnonymous) { userID = Profile.UserName; } else { userID = Profile.AccountInfo.UserID.ToString(); } List <Shopping> shops = Shoppings.ShoppingLoad(userID); btnSeeShopCart.Text = "查看购物车(" + shops.Count + "件)"; btnSeeShopCart.Attributes.Add("onclick", "parent.window.location.href='" + GlobalSettings.RelativeWebRoot + "pages/view.aspx?shopcart-cartitems'"); }
void BindCartItems() { string userID = Profile.UserName; if (!Profile.IsAnonymous) { userID = Profile.AccountInfo.UserID.ToString(); } List <Shopping> shops = Shoppings.ShoppingLoad(userID); egvShoppings.DataSource = shops; egvShoppings.DataBind(); int quantities = 0; foreach (Shopping s in shops) { quantities += s.Quantity; } ltItemsAmount.Text = "共【" + shops.Count + "】件产品,合计【" + quantities + "】小件。"; }