public ActionResult RemoveCartProduct(int CartProductId)
        {
            CMember      member      = (CMember)Session[CMemberSession.Session_Login_User];
            CCartVM      currentCart = CCartVM.GetCurrentCart(member);
            CCartProduct CartProduct = currentCart.lscartprooduct.FirstOrDefault(p => p.fCartProductId == CartProductId);

            CCartProductFactory.fn購物車商品刪除(CartProduct);
            return(RedirectToAction("CartView"));
        }
        public ActionResult CartClear(int CartId)
        {
            CMember member      = (CMember)Session[CMemberSession.Session_Login_User];
            CCartVM currentCart = CCartVM.GetCurrentCart(member);

            foreach (var item in currentCart.lscartprooduct.Where(p => p.fCartId == CartId))
            {
                CCartProductFactory.fn購物車商品刪除(item);
            }
            return(RedirectToAction("CartView"));
        }
        public ActionResult RemoveFromCart(int CartProductId)
        {
            //登入的會員資訊
            CMember member = (CMember)Session[CMemberSession.Session_Login_User];

            //目前購物車Session的項目
            CCartVM currentCart = CCartVM.GetCurrentCart(member);

            //商品資訊,給fn購物車商品刪除()使用
            CCartProduct CartProduct = currentCart.lscartprooduct.FirstOrDefault(p => p.fCartProductId == CartProductId);

            CCartProductFactory.fn購物車商品刪除(CartProduct);

            return(PartialView("_CartPartial"));
        }
        //GET:下次再買
        public ActionResult PurchaseNextTime(int CartProductId)
        {
            CMember      member      = (CMember)Session[CMemberSession.Session_Login_User];
            CCartVM      currentCart = CCartVM.GetCurrentCart(member);
            CCartProduct CartProduct = currentCart.lscartprooduct.FirstOrDefault(p => p.fCartProductId == CartProductId);

            //新增購物車
            CCart cart = new CCart()
            {
                fMemberId   = member.fMemberId,
                fSubmitTime = null
            };
            CCart mycart = CCartFactory.fn購物車新增(member, cart);

            //新增下次再買的商品到新的購物車
            CProduct product = CProductFactory.fn商品查詢().FirstOrDefault(p => p.fProductId == CartProduct.fProductId);

            CCartProductFactory.fn購物車商品新增(product, mycart);

            //刪除現在購物車裡的商品
            CCartProductFactory.fn購物車商品刪除(CartProduct);

            return(RedirectToAction("CartView"));
        }