public override async Task <IActionResult> Details(Guid?id) { var appSort = (await _dataService.GetDtoAsync <AppShortDTO>(x => x.Id == id)).Select(x => x.AppSort).FirstOrDefault(); if (string.IsNullOrEmpty(appSort)) { return(await Task.Run(() => NotFound())); } if (appSort != "GetLicenseApplication" && appSort != "AdditionalInfoToLicense" && appSort != "IncreaseToPRLApplication") { return(RedirectToAction("AltAppDetails", "PrlAppAlt", new { Area = "PRL", id = id, sort = appSort })); } if (appSort == "GetLicenseApplication") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Заява про отримання ліцензії на провадження діяльності"); } if (appSort == "AdditionalInfoToLicense") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Доповнення інформації по наявній ліцензії"); } if (appSort == "IncreaseToPRLApplication") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Заява про розширення провадження виду господарської діяльності - Розширення до виробництва лікарських засобів"); } ViewBag.IsEditable = _entityStateHelper.IsEditableApp(id); return(await base.Details(id)); }
public override async Task <IActionResult> Details(Guid id) { var app = (await _trlApplicationService.DataService.GetDtoAsync <AppShortDTO>(x => x.Id == id)).FirstOrDefault(); var appSort = app.AppSort; if (string.IsNullOrEmpty(appSort)) { return(await Task.Run(() => NotFound())); } if (appSort != "GetLicenseApplication" && appSort != "AdditionalInfoToLicense" && appSort != "IncreaseToTRLApplication") { return(RedirectToAction("AltAppDetails", "TrlAppAlt", new { Area = "TRL", id = id, sort = appSort })); } if (appSort == "GetLicenseApplication") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Заява про отримання ліцензії на провадження діяльності"); } if (appSort == "AdditionalInfoToLicense") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Доповнення інформації по наявній ліцензії"); } if (appSort == "IncreaseToTRLApplication") { HttpContext.ModifyCurrentBreadCrumb(x => x.Name = "Заява про розширення провадження виду господарської діяльності " + "- Розширення до торгівлі лікарськими засобами"); } if (_entityStateHelper.IsEditableApp(id) == null) { return(NotFound()); } ViewBag.IsEditable = _entityStateHelper.IsEditableApp(id); var model = (await _trlApplicationService.DataService.GetDtoAsync <TrlAppDetailDTO>(x => x.Id == id)).SingleOrDefault(); if (model == null) { return(NotFound()); } ViewBag.PerformerName = _trlApplicationService.DataService.GetDto <UserDetailsDTO>(p => p.Id == model.PerformerId).Select(p => p.FIO).SingleOrDefault(); return(View(model)); }