示例#1
0
        public ActionResult Checkout(CheckOutData model)
        {
            Random rnd = new Random();

            model.order_num  = GenerateRandomInt(rnd);
            model.u_id       = repou.GetUserId(User.Identity.Name);
            model.cart_id    = repoc.getCartId(model.u_id);
            model.totalprice = repo.totalPrise(User.Identity.Name);
            int i = repoc.CheckOut(model);

            if (i >= 1)
            {
                //repoc.DeleteAllCartItem(model.u_id);
                return(RedirectToAction("CheckoutDetail"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }