public IActionResult List(string filter) { if (filter == null) { filter = "all"; } IQueryable <Incident> query = context.Incidents .Include(i => i.Customer) .Include(i => i.Product) .OrderBy(i => i.DateOpened); if (filter == "unassigned") { query = query.Where(i => i.TechnicianID == null); } if (filter == "open") { query = query.Where(i => i.DateClosed == null); } var incidents = query.ToList(); IncidentsListViewModel model = new IncidentsListViewModel(); model.Filter = filter; model.Incidents = incidents; return(View("List", model)); }
public IncidentsListUserControl() { try { InitializeComponent(); ViewModel = new IncidentsListViewModel(); } catch (Exception ex) { ErrorHelper.OnError(MethodBase.GetCurrentMethod().DeclaringType.Name, "Error on route to map coordinate click", ex); } }