public async Task <IActionResult> RecommendationManagementList(int id) { try { if (id == 0) { throw new ApplicationException("RecommendationManagementList - Id should ne be set to 0"); } var model = new RecommendationManagementViewModel() { RecommendationList = await _optionService.GetRecommendationList(id) }; return(PartialView("_recommendations", model)); } catch (Exception ex) { ex.ToExceptionless().Submit(); return(BadRequest()); } }
public async Task <IActionResult> RecommendationManagement() { try { var model = new RecommendationManagementViewModel() { RootUrl = BaseRootUrl, RecommendationList = await _optionService.GetRecommendationList(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()); } }