Esempio n. 1
0
        public ActionResult Orders()
        {
            var costumerOrdersViewModel = new CostumerOrdersViewModel();

            costumerOrdersViewModel.Orders = _context.Orders.Where(o => o.CustomerId == _customer.Id).OrderBy(o => o.Date).ToArray();

            return(View("Orders", costumerOrdersViewModel));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            var userId   = User.Identity.GetUserId().ToString();
            var customer = _context.Customers.SingleOrDefault(c => c.ApplicationUserId == userId);

            var costumerOrdersViewModel = new CostumerOrdersViewModel();

            costumerOrdersViewModel.Orders = _context.Orders.Where(o => o.CustomerId == customer.Id).OrderBy(o => o.Date).ToArray();

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