コード例 #1
0
        public IActionResult Cart()
        {
            if (!mu.IsNull && mu.Status != 0)
            {
                return(WriteErr("你的帐户未通过验证或被锁定"));
            }
            int proid = DataConvert.CLng(GetParam("id"));

            if (proid < 1)
            {
                proid = DataConvert.CLng(GetParam("proid"));
            }
            //int suitid = DataConvert.CLng(GetParam("suitid"));
            int pronum = DataConvert.CLng(GetParam("pronum"), 1);
            int pclass = -1;//非-1则为添加了商品,需要跳转

            if (proid > 0)
            {
                M_Product proMod = proBll.GetproductByid(proid);
                if (proMod == null)
                {
                    return(WriteErr("商品不存在"));
                }
                AddToCart(mu, proMod, pronum);
                pclass = proMod.ProClass;
            }
            if (Request.IsAjaxRequest())
            {
                return(Content(Success.ToString()));
            }                                                                   //ajax下不需要数据绑定与跳转
            //通过页面访问
            if (pclass > -1)
            {
                Response.Redirect("Cart?ProClass=" + pclass);
            }
            B_Cart.UpdateUidByCartID(CartCookID, mu);
            VM_Cart model = new VM_Cart(HttpContext, mu);

            model.CartDT = cartBll.SelByCartID(CartCookID, mu.UserID, ProClass); //从数据库中获取
            if (StoreID != -100)                                                 //仅显示指定商铺的商品
            {
                model.CartDT.DefaultView.RowFilter = "StoreID=" + StoreID;
                model.CartDT = model.CartDT.DefaultView.ToTable();
            }
            model.StoreDT = orderCom.SelStoreDT(model.CartDT);
            //totalmoney.InnerText = TotalPrice.ToString("f2");
            return(View(model));
        }
コード例 #2
0
 /// <summary>
 /// Creates a new instance for the summer season's prices.
 /// </summary>
 /// <param name="order">The list of product orders of the cart.</param>
 /// <param name="vM">View-model of the page.</param>
 public SummerPrice(List <ProductOrder> order, VM_Cart vM) : base(order, vM)
 {
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance for an autumn season's prices.
 /// </summary>
 /// <param name="order">The list of product orders of the cart.</param>
 /// <param name="vM">View-model of the page.</param>
 public AutumnPrice(List <ProductOrder> order, VM_Cart vM) : base(order, vM)
 {
 }
コード例 #4
0
 /// <summary>
 /// Creates a new instance for the spring season's prices.
 /// </summary>
 /// <param name="order">The list of product orders of the cart.</param>
 /// <param name="vM">View-model of the page.</param>
 public SpringPrice(List <ProductOrder> order, VM_Cart vM) : base(order, vM)
 {
 }
コード例 #5
0
ファイル: Cart.xaml.cs プロジェクト: kristytoman/afw_project
 /// <summary>
 /// Creates a new page for a customer cart content.
 /// </summary>
 public Cart()
 {
     BindingContext = new VM_Cart();
     InitializeComponent();
 }
コード例 #6
0
ファイル: Price.cs プロジェクト: kristytoman/afw_project
 /// <summary>
 /// Creates a new instance for a sale season.
 /// </summary>
 /// <param name="order">List of product-orders of the cart.</param>
 /// <param name="viewModel">View-model of the page.</param>
 public Price(List <ProductOrder> order, VM_Cart viewModel)
 {
     this.order     = order;
     this.viewModel = viewModel;
     sale           = 0;
 }
コード例 #7
0
 /// <summary>
 /// Creates a new instance for the winter season's prices.
 /// </summary>
 /// <param name="order">The list of product orders of the cart.</param>
 /// <param name="vM">View-model of the page.</param>
 public WinterPrice(List <ProductOrder> order, VM_Cart vM) : base(order, vM)
 {
     NewPrice       = 0;
     iMostExpensive = 0;
 }