示例#1
0
        public IActionResult Checkout(OrderViewModel model)
        {
            Order order = new Order
            {
                GameList    = OrderLogic.GetShoppingList(),
                OrderStatus = OrderStatus.Waiting,
                Address     = model.Address,
                OrderDate   = model.Order.OrderDate
            };
            var email = HttpContext.Session.GetString("_Name");

            order.UserId = AccountLogic.GetUser(email).Id;

            OrderLogic.AddOrder(order);
            int orderId = OrderLogic.GetOrderId();

            OrderLogic.AddGamesOrder(order.GameList, orderId);
            OrderLogic.ClearShoppingList();
            return(RedirectToAction("Index", "Home"));
        }
示例#2
0
 public IActionResult Logout()
 {
     HttpContext.Session.Clear();
     _orderLogic.ClearShoppingList();
     return(RedirectToAction("Index", "Home"));
 }