コード例 #1
0
        public ActionResult ApproveGisUpload(ProjectPrimaryKey projectPrimaryKey, ProjectLocationDetailViewModel viewModel)
        {
            var project = projectPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewApproveGisUpload(project, viewModel));
            }
            SaveProjectDetailedLocations(viewModel, project, out bool hadToMakeValid, out bool atLeastOneCouldNotBeCorrected);
            if (hadToMakeValid && !atLeastOneCouldNotBeCorrected)
            {
                SetWarningForDisplay("One or more of your imported shapes had to be corrected in order to make it a valid geometry. Most likely this resulted in no noticeable changes, but please review the detailed location to verify.");
            }
            if (atLeastOneCouldNotBeCorrected && !hadToMakeValid)
            {
                SetWarningForDisplay("One or more of your imported shapes could not be made into a valid geometry and was not saved. All other shapes were saved. Please review the detailed location to verify.");
            }

            if (atLeastOneCouldNotBeCorrected && hadToMakeValid)
            {
                SetWarningForDisplay("One or more of your imported shapes had to be corrected in order to make it a valid geometry. Most likely this resulted in no noticeable changes." +
                                     " Additionally, one or more of your imported shapes could not be made into a valid geometry and was not saved. All other shapes were saved. Please review the detailed location to verify.");
            }
            DbSpatialHelper.Reduce(new List <IHaveSqlGeometry>(project.GetProjectLocationDetailed(true).ToList()));
            return(new ModalDialogFormJsonResult());
        }
コード例 #2
0
        public ActionResult ApproveGisUpload(ProjectPrimaryKey projectPrimaryKey, ProjectLocationDetailViewModel viewModel)
        {
            var project = projectPrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewApproveGisUpload(project, viewModel));
            }
            SaveProjectDetailedLocations(viewModel, project);
            DbSpatialHelper.Reduce(new List <IHaveSqlGeometry>(project.ProjectLocations.ToList()));
            return(EditProjectLocationDetailed(projectPrimaryKey));
        }