Beispiel #1
0
        public override Task PreRender()
        {
            var user = Context.GetAuthentication().Context.User;

            if (user.IsInRole("admin"))
            {
                _orders = _orderFacade.GetAllOrdersAsync(true).Result.OrderBy(order => order.State).ToList();
            }
            else
            {
                _orders = _orderFacade.GetOrdersByUserAsync(user.Identity.Name, true).Result;
            }
            Orders.LoadFromQueryable(_orders.AsQueryable());
            return(base.PreRender());
        }