private void ClearCart() { CartBLL.ClearCart(base.UserID); Sessions.ProductBuyCount = 0; Sessions.ProductTotalPrice = 0M; Sessions.ProductTotalWeight = 0M; ResponseHelper.End(); }
protected void AddOrderProduct(int orderID) { foreach (CartInfo info in CartBLL.ReadCartList(UserID)) { OrderDetailInfo orderDetail = new OrderDetailInfo(); orderDetail.OrderID = orderID; orderDetail.ProductID = info.ProductID; orderDetail.ProductName = info.ProductName; //orderDetail.ProductWeight = product.Weight; //orderDetail.SendPoint = product.SendPoint; orderDetail.ProductPrice = info.ProductPrice; orderDetail.BuyCount = info.BuyCount; orderDetail.RandNumber = info.RandNumber; OrderDetailBLL.AddOrderDetail(orderDetail); } CartBLL.ClearCart(UserID); Sessions.ProductTotalPrice = 0M; Sessions.ProductBuyCount = 0; Sessions.ProductTotalWeight = 0M; }
protected void AddOrderProduct(int orderID) { List <CartInfo> list = CartBLL.ReadCartList(base.UserID); string strProductID = string.Empty; foreach (CartInfo info in list) { if (strProductID == string.Empty) { strProductID = info.ProductID.ToString(); } else { strProductID = strProductID + "," + info.ProductID.ToString(); } } List <ProductInfo> productList = new List <ProductInfo>(); if (strProductID != string.Empty) { ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = strProductID; productList = ProductBLL.SearchProductList(productSearch); } List <MemberPriceInfo> memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID); Dictionary <string, bool> dictionary = new Dictionary <string, bool>(); Dictionary <int, int> dictionary2 = new Dictionary <int, int>(); foreach (CartInfo info in list) { ProductInfo product = ProductBLL.ReadProductByProductList(productList, info.ProductID); OrderDetailInfo orderDetail = new OrderDetailInfo(); orderDetail.OrderID = orderID; orderDetail.ProductID = info.ProductID; orderDetail.ProductName = info.ProductName; orderDetail.ProductWeight = product.Weight; orderDetail.SendPoint = product.SendPoint; if (info.GiftPackID == 0) { orderDetail.ProductPrice = MemberPriceBLL.ReadCurrentMemberPrice(memberPriceList, base.GradeID, product); } else if (dictionary.ContainsKey(info.RandNumber + "|" + info.GiftPackID.ToString())) { orderDetail.ProductPrice = 0M; } else { orderDetail.ProductPrice = GiftPackBLL.ReadGiftPack(info.GiftPackID).Price; dictionary.Add(info.RandNumber + "|" + info.GiftPackID.ToString(), true); } orderDetail.BuyCount = info.BuyCount; if (info.FatherID > 0) { orderDetail.FatherID = dictionary2[info.FatherID]; } orderDetail.RandNumber = info.RandNumber; orderDetail.GiftPackID = info.GiftPackID; int num = OrderDetailBLL.AddOrderDetail(orderDetail); dictionary2.Add(info.ID, num); } CartBLL.ClearCart(base.UserID); Sessions.ProductTotalPrice = 0M; Sessions.ProductBuyCount = 0; Sessions.ProductTotalWeight = 0M; }