Ejemplo n.º 1
0
        public PartialViewResult EditProjectLocationSimple(ProjectPrimaryKey projectPrimaryKey)
        {
            var project   = projectPrimaryKey.EntityObject;
            var viewModel = new ProjectLocationSimpleViewModel(project.ProjectLocationPoint, project.ProjectLocationSimpleType.ToEnum, project.ProjectLocationNotes);

            return(ViewEditProjectLocationSummaryPoint(project, viewModel));
        }
Ejemplo n.º 2
0
 public ActionResult EditProjectLocationSimple(ProjectPrimaryKey projectPrimaryKey, ProjectLocationSimpleViewModel viewModel)
 {
     if (!ModelState.IsValid)
     {
         return(ViewEditProjectLocationSummaryPoint(projectPrimaryKey.EntityObject, viewModel));
     }
     viewModel.UpdateModel(projectPrimaryKey.EntityObject);
     return(new ModalDialogFormJsonResult());
 }
Ejemplo n.º 3
0
        private PartialViewResult ViewEditProjectLocationSummaryPoint(Project project, ProjectLocationSimpleViewModel viewModel)
        {
            var layerGeoJsons = MapInitJson.GetConfiguredGeospatialAreaMapLayers();
            var mapInitJson   = new MapInitJson($"project_{project.ProjectID}_EditMap", 10, layerGeoJsons, MapInitJson.GetExternalMapLayers(), BoundingBox.MakeNewDefaultBoundingBox(), false)
            {
                AllowFullScreen = false, DisablePopups = true
            };
            var mapPostUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.EditProjectLocationSimple(project, null));

            var mapFormID           = GenerateEditProjectLocationFormID(project.ProjectID);
            var geospatialAreaTypes = HttpRequestStorage.DatabaseEntities.GeospatialAreaTypes.OrderBy(x => x.GeospatialAreaTypeName)
                                      .ToList();
            var viewData = new ProjectLocationSimpleViewData(CurrentFirmaSession, mapInitJson, geospatialAreaTypes, null, mapPostUrl, mapFormID);

            return(RazorPartialView <ProjectLocationSimple, ProjectLocationSimpleViewData, ProjectLocationSimpleViewModel>(viewData, viewModel));
        }
Ejemplo n.º 4
0
        private PartialViewResult ViewEditProjectLocationSummaryPoint(Project project, ProjectLocationSimpleViewModel viewModel)
        {
            var layerGeoJsons = MapInitJson.GetAllGeospatialAreaMapLayers(LayerInitialVisibility.Hide);
            var mapInitJson   = new MapInitJson($"project_{project.ProjectID}_EditMap", 10, layerGeoJsons, BoundingBox.MakeNewDefaultBoundingBox(), false)
            {
                AllowFullScreen = false, DisablePopups = true
            };
            var mapPostUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.EditProjectLocationSimple(project, null));

            var mapFormID = GenerateEditProjectLocationFormID(project.ProjectID);
            var viewData  = new ProjectLocationSimpleViewData(CurrentPerson, mapInitJson, FirmaWebConfiguration.GetWmsLayerNames(), null, mapPostUrl, mapFormID, FirmaWebConfiguration.WebMapServiceUrl);

            return(RazorPartialView <ProjectLocationSimple, ProjectLocationSimpleViewData, ProjectLocationSimpleViewModel>(viewData, viewModel));
        }