예제 #1
0
        public ActionResult RemoveFromShoppingCart(Guid id)
        {
            Guid userId = GetUserId();

            var shoppingModel = ShoppingCartProcessor.GetShoppingModel(id);

            ShoppingCartProcessor.RemoveFromShoppingCart(userId, shoppingModel);

            return(RedirectToAction("ShoppingCart", "Acount"));
        }
예제 #2
0
        public ActionResult SendPaymentEmail()
        {
            var userId = GetUserId();

            var userModel = UserProcessor.GetUserToModel(userId);
            var mailBody  = ShoppingCartToString(userModel);

            if (!SendEmail(userId, "MP-Verf Order confirmation email", mailBody))
            {
                //email did not send do stuff

                return(RedirectToAction("ShoppingCart", "Acount"));
            }
            //clear item list
            foreach (var storeItem in userModel.ShoppingCart)
            {
                ShoppingCartProcessor.RemoveFromShoppingCart(userId, storeItem);
            }

            return(RedirectToAction("ShoppingCart", "Acount"));
        }