Ejemplo n.º 1
0
        public ActionResult Order(int cartID, string address, string phoneNumber)
        {
            Address addressModel = new Address()
            {
                AddressName = address,
                PhoneNumber = phoneNumber
            };
            Order order = new Order()
            {
                Address        = addressModel,
                DeliveryStatus = "Waiting",
                PaymentStatus  = "Delivery to receive"
            };

            ViewBag.Error = false;
            HttpResult result = CartAPIController.BuyCart(cartID, order);

            if (result.Result)
            {
                ViewBag.Success = true;
            }
            else
            {
                ViewBag.Error = result.Message;
            }
            ViewBag.CartID  = cartID;
            ViewBag.OrderID = result.ID;

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult OrderStatus(int orderID)
        {
            ViewBag.Order     = CartAPIController.GetOrder(orderID);
            ViewBag.OrderItem = CartAPIController.GetOrderItem(orderID);
            double total = 0;

            foreach (OrderItem item in ViewBag.OrderItem)
            {
                total += item.PricePerProduct;
            }
            ViewBag.TotalPrice = total;
            return(View());
        }
Ejemplo n.º 3
0
 public ActionResult Cart(int CartID)
 {
     ViewBag.Cart = CartAPIController.GetCart(CartID);
     ViewBag.Size = ViewBag.Cart.CartItem.Count;
     return(View());
 }