Ejemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            if (!HttpContext.Session.GetInt32("authenticated").HasValue)
            {
                return(new RedirectToActionResult("index", "login", null));
            }

            var orders = await orderModel.GetAll();

            return(View(orders));
        }
Ejemplo n.º 2
0
        public IActionResult GetOrders()
        {
            OrderModel model = new OrderModel(_db);

            return(Ok(model.GetAll(HttpContext.Session.GetString(SessionVars.User))));
        }