Example #1
0
        public PartialViewResult DeleteFocusAreaLocation(FocusAreaPrimaryKey focusAreaPrimaryKey)
        {
            var focusArea = focusAreaPrimaryKey.EntityObject;
            var viewModel = new ConfirmDialogFormViewModel(focusArea.FocusAreaID);

            return(ViewDeleteFocusAreaLocation(focusArea, viewModel));
        }
Example #2
0
        public PartialViewResult Edit(FocusAreaPrimaryKey focusAreaPrimaryKey)
        {
            var focusArea = focusAreaPrimaryKey.EntityObject;
            var viewModel = new EditViewModel(focusArea);

            return(ViewEdit(viewModel));
        }
Example #3
0
        public PartialViewResult ApproveUploadGis(FocusAreaPrimaryKey focusAreaPrimaryKey)
        {
            var focusArea = focusAreaPrimaryKey.EntityObject;
            var viewModel = new ApproveUploadGisViewModel();

            return(ViewApproveUploadGis(viewModel, focusArea));
        }
Example #4
0
        public ViewResult EditLocation(FocusAreaPrimaryKey focusAreaPrimaryKey)
        {
            var viewModel = new EditLocationViewModel();
            var viewData  = new EditLocationViewData(CurrentPerson, focusAreaPrimaryKey.EntityObject);

            return(RazorView <EditLocation, EditLocationViewData, EditLocationViewModel>(viewData, viewModel));
        }
Example #5
0
        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));
        }
Example #7
0
        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());
        }
Example #9
0
        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));
        }
Example #10
0
        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());
        }
Example #11
0
        public ActionResult DeleteFocusAreaLocation(FocusAreaPrimaryKey focusAreaPrimaryKey,
                                                    ConfirmDialogFormViewModel viewModel)
        {
            var focusArea = focusAreaPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteFocusAreaLocation(focusArea, viewModel));
            }

            focusArea.FocusAreaLocation = null;

            return(new ModalDialogFormJsonResult());
        }
Example #12
0
        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))));
        }
Example #13
0
        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);
        }