Ejemplo n.º 1
0
        // GET: Admin/OrderEntries
        public ActionResult Index()
        {
            var orders = db.Orders.ToList().OrderByDescending(x => x.Date).ToList();

            OrdersViewModel ovm = CustomerOrderMappers.OrdersToViewModel(orders);

            return(View(ovm));
        }
Ejemplo n.º 2
0
        public ActionResult Filter(string id)
        {
            Enum.TryParse(id, out OrderStatus status);
            List <Order> toView = new List <Order>();

            var allOrders = db.Orders.ToList();

            foreach (var order in allOrders)
            {
                if (order.Status == status)
                {
                    toView.Add(order);
                }
            }

            OrdersViewModel ovm = CustomerOrderMappers.OrdersToViewModel(toView);


            return(View("Index", ovm));
        }