public PartialViewResult DeleteFocusAreaLocation(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var viewModel = new ConfirmDialogFormViewModel(focusArea.FocusAreaID); return(ViewDeleteFocusAreaLocation(focusArea, viewModel)); }
public PartialViewResult Edit(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var viewModel = new EditViewModel(focusArea); return(ViewEdit(viewModel)); }
public PartialViewResult ApproveUploadGis(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var viewModel = new ApproveUploadGisViewModel(); return(ViewApproveUploadGis(viewModel, focusArea)); }
public ViewResult EditLocation(FocusAreaPrimaryKey focusAreaPrimaryKey) { var viewModel = new EditLocationViewModel(); var viewData = new EditLocationViewData(CurrentPerson, focusAreaPrimaryKey.EntityObject); return(RazorView <EditLocation, EditLocationViewData, EditLocationViewModel>(viewData, viewModel)); }
public GridJsonNetJObjectResult <Project> DetailProjectFocusAreaGridJsonData(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var gridSpec = new ProjectsIncludingLeadImplementingGridSpec(CurrentPerson, false); var projects = focusArea.Projects.ToList(); var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projects, gridSpec); return(gridJsonNetJObjectResult); }
public PartialViewResult NewForAFocusArea(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var viewModel = new EditGrantAllocationAwardViewModel() { FocusAreaID = focusArea.FocusAreaID }; return(GrantAllocationAwardViewEdit(viewModel)); }
public ActionResult Edit(FocusAreaPrimaryKey focusAreaPrimaryKey, EditViewModel viewModel) { var focusArea = focusAreaPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEdit(viewModel)); } viewModel.UpdateModel(focusArea); return(new ModalDialogFormJsonResult()); }
public ActionResult NewForAFocusArea(FocusAreaPrimaryKey focusAreaPrimaryKey, EditGrantAllocationAwardViewModel viewModel) { if (!ModelState.IsValid) { return(GrantAllocationAwardViewEdit(viewModel)); } var grantAllocation = HttpRequestStorage.DatabaseEntities.GrantAllocations.Single(ga => ga.GrantAllocationID == viewModel.GrantAllocationID); var focusArea = HttpRequestStorage.DatabaseEntities.FocusAreas.Single(fa => fa.FocusAreaID == viewModel.FocusAreaID); var grantAllocationAward = GrantAllocationAward.CreateNewBlank(grantAllocation, focusArea); viewModel.UpdateModel(grantAllocationAward); return(new ModalDialogFormJsonResult()); }
public ViewResult Detail(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var mapInitJson = GetMapInitJsonWithProjects(focusArea, out var hasSpatialData, CurrentPerson); var grantAllocationAwardGridSpec = new GrantAllocationAwardGridSpec(CurrentPerson, focusArea); var viewData = new DetailViewData(CurrentPerson, focusArea, mapInitJson, hasSpatialData, grantAllocationAwardGridSpec); return(RazorView <Detail, DetailViewData>(viewData)); }
public ActionResult Delete(FocusAreaPrimaryKey focusAreaPrimaryKey, ConfirmDialogFormViewModel viewModel) { var focusArea = focusAreaPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteFocusArea(focusArea, viewModel)); } focusArea.DeleteFull(HttpRequestStorage.DatabaseEntities); return(new ModalDialogFormJsonResult()); }
public ActionResult DeleteFocusAreaLocation(FocusAreaPrimaryKey focusAreaPrimaryKey, ConfirmDialogFormViewModel viewModel) { var focusArea = focusAreaPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteFocusAreaLocation(focusArea, viewModel)); } focusArea.FocusAreaLocation = null; return(new ModalDialogFormJsonResult()); }
public ActionResult EditLocation(FocusAreaPrimaryKey focusAreaPrimaryKey, EditLocationViewModel viewModel) { var focusArea = focusAreaPrimaryKey.EntityObject; if (!ModelState.IsValid) { var viewData = new EditLocationViewData(CurrentPerson, focusArea); return(RazorPartialView <EditLocationErrors, EditLocationViewData, EditLocationViewModel>(viewData, viewModel)); } viewModel.UpdateModel(focusArea); return(RedirectToAction(new SitkaRoute <FocusAreaController>(c => c.ApproveUploadGis(focusAreaPrimaryKey)))); }
public ActionResult ApproveUploadGis(FocusAreaPrimaryKey focusAreaPrimaryKey, ApproveUploadGisViewModel viewModel) { var focusArea = focusAreaPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewApproveUploadGis(viewModel, focusArea)); } viewModel.UpdateModel(focusArea); HttpRequestStorage.DatabaseEntities.FocusAreaLocationStagings.RemoveRange(focusArea .FocusAreaLocationStagings); SetMessageForDisplay($"{FieldDefinition.FocusArea.GetFieldDefinitionLabel()} Location for {focusArea.GetDisplayNameAsUrl()} successfully updated."); return(new ContentResult()); }
public GridJsonNetJObjectResult <GrantAllocationAward> GrantAllocationAwardByFocusAreaGridJsonData(FocusAreaPrimaryKey focusAreaPrimaryKey) { var focusArea = focusAreaPrimaryKey.EntityObject; var grantAllocationAwards = focusArea.GrantAllocationAwards.ToList(); var gridSpec = new GrantAllocationAwardGridSpec(CurrentPerson, focusArea); var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <GrantAllocationAward>(grantAllocationAwards, gridSpec); return(gridJsonNetJObjectResult); }