public async Task <IActionResult> AppointmentManagementList(int id) { try { if (id == 0) { throw new ApplicationException("AppointmentManagementList - Id should ne be set to 0"); } var model = new AppointmentManagementViewModel() { AppointmentList = await _optionService.GetAppointmentList(id) }; return(PartialView("_appointments", model)); } catch (Exception ex) { ex.ToExceptionless().Submit(); return(BadRequest()); } }
public async Task <IActionResult> AppointmentManagement() { try { var model = new AppointmentManagementViewModel() { RootUrl = BaseRootUrl, AppointmentList = await _optionService.GetAppointmentList(CurrentUser.GarageId), GarageSelector = new GarageSelectorViewModel { Garages = await _garageService.GetGaragesSelectList(), SelectedGarageId = HttpContext.User.IsInRole("SuperAdmin") ? 0 : CurrentUser.GarageId, disabled = HttpContext.User.IsInRole("Administrator") }, }; return(View(model)); } catch (Exception ex) { ex.ToExceptionless().Submit(); return(BadRequest()); } }