コード例 #1
0
        public void UpdateModelBatch(ProjectUpdateBatch projectUpdateBatch)
        {
            var projectUpdate = projectUpdateBatch.ProjectUpdate;

            projectUpdate.ProjectLocationSimpleTypeID = ProjectFirmaModels.Models.ProjectLocationSimpleType.ToType(ProjectLocationSimpleType).ProjectLocationSimpleTypeID;
            switch (ProjectLocationSimpleType)
            {
            case ProjectLocationSimpleTypeEnum.PointOnMap:
            case ProjectLocationSimpleTypeEnum.LatLngInput:
                // Using ProjectLocationPoint here because the location is being updated
                projectUpdate.ProjectLocationPoint = ProjectLocationPointX.HasValue && ProjectLocationPointY.HasValue
                        ? DbSpatialHelper.MakeDbGeometryFromCoordinates(ProjectLocationPointX.Value, ProjectLocationPointY.Value, LtInfoGeometryConfiguration.DefaultCoordinateSystemId)
                        : null;
                break;

            case ProjectLocationSimpleTypeEnum.None:
                // Using ProjectLocationPoint here because the location is being updated
                projectUpdate.ProjectLocationPoint = null;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            projectUpdate.ProjectLocationNotes = ProjectLocationNotes;
            projectUpdate.LocationIsPrivate    = LocationIsPrivate;
        }
コード例 #2
0
 public void UpdateModel(Models.InteractionEvent interactionEvent)
 {
     if (InteractionEventLocationPointX != null && InteractionEventLocationPointY != null)
     {
         interactionEvent.InteractionEventLocationSimple = DbSpatialHelper.MakeDbGeometryFromCoordinates(InteractionEventLocationPointX.Value, InteractionEventLocationPointY.Value, MapInitJson.CoordinateSystemId);
     }
 }
コード例 #3
0
        public OnlandVisualTrashAssessmentObservation ToOnlandVisualTrashAssessmentObservation()
        {
            DbGeometry locationPoint4326 = DbSpatialHelper.MakeDbGeometryFromCoordinates(LocationX.GetValueOrDefault(),
                                                                                         LocationY.GetValueOrDefault(), CoordinateSystemHelper.NAD_83_HARN_CA_ZONE_VI_SRID);

            var locationPoint2771 =
                CoordinateSystemHelper.ProjectWebMercatorToCaliforniaStatePlaneVI(locationPoint4326);

            return(new OnlandVisualTrashAssessmentObservation(OnlandVisualTrashAssessmentObservationID,
                                                              OnlandVisualTrashAssessmentID, locationPoint2771, Note, ObservationDateTime, locationPoint4326));
        }
コード例 #4
0
        public virtual void UpdateModel(Models.TreatmentBMP treatmentBMP, Person currentPerson)
        {
            // note that these nullables will never be null due to the Required attribute
            // this is coming FROM the browser, so it has to be reprojected to CA State Plane
            var locationPoint4326 = DbSpatialHelper.MakeDbGeometryFromCoordinates(TreatmentBMPPointX.GetValueOrDefault(),
                                                                                  TreatmentBMPPointY.GetValueOrDefault(), CoordinateSystemHelper.WGS_1984_SRID);
            var locationPoint = CoordinateSystemHelper.ProjectWebMercatorToCaliforniaStatePlaneVI(locationPoint4326);

            treatmentBMP.LocationPoint     = locationPoint;
            treatmentBMP.LocationPoint4326 = locationPoint4326;

            treatmentBMP.UpdateUpstreamBMPReferencesIfNecessary();

            // associate watershed, lspc basin, precipitation zone
            treatmentBMP.SetTreatmentBMPPointInPolygonDataByLocationPoint(locationPoint);

            treatmentBMP.UpdatedCentralizedBMPDelineationIfPresent();
        }
コード例 #5
0
        public virtual void UpdateModel(IProject project)
        {
            project.ProjectLocationSimpleTypeID = Models.ProjectLocationSimpleType.ToType(ProjectLocationSimpleType).ProjectLocationSimpleTypeID;
            switch (ProjectLocationSimpleType)
            {
            case ProjectLocationSimpleTypeEnum.PointOnMap:
                project.ProjectLocationPoint = DbSpatialHelper.MakeDbGeometryFromCoordinates(ProjectLocationPointX.Value, ProjectLocationPointY.Value, MapInitJson.CoordinateSystemId);
                break;

            case ProjectLocationSimpleTypeEnum.None:
                project.ProjectLocationPoint = null;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            project.ProjectLocationNotes = ProjectLocationNotes;
        }
コード例 #6
0
        public virtual void UpdateModel(IProject iProject)
        {
            iProject.ProjectLocationSimpleTypeID = ProjectFirmaModels.Models.ProjectLocationSimpleType.ToType(ProjectLocationSimpleType).ProjectLocationSimpleTypeID;
            switch (ProjectLocationSimpleType)
            {
            case ProjectLocationSimpleTypeEnum.PointOnMap:
            case ProjectLocationSimpleTypeEnum.LatLngInput:
                // Using ProjectLocationPoint here because location is being updated
                iProject.ProjectLocationPoint = DbSpatialHelper.MakeDbGeometryFromCoordinates(ProjectLocationPointX.Value, ProjectLocationPointY.Value, LtInfoGeometryConfiguration.DefaultCoordinateSystemId);
                break;

            case ProjectLocationSimpleTypeEnum.None:
                // Using ProjectLocationPoint here because location is being updated
                iProject.ProjectLocationPoint = null;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            iProject.ProjectLocationNotes = ProjectLocationNotes;
            iProject.LocationIsPrivate    = LocationIsPrivate;
        }
コード例 #7
0
        public void UpdateModelBatch(ProjectUpdateBatch projectUpdateBatch)
        {
            var project = projectUpdateBatch.ProjectUpdate;

            project.ProjectLocationSimpleTypeID = Models.ProjectLocationSimpleType.ToType(ProjectLocationSimpleType).ProjectLocationSimpleTypeID;
            switch (ProjectLocationSimpleType)
            {
            case ProjectLocationSimpleTypeEnum.PointOnMap:

                project.ProjectLocationPoint = ProjectLocationPointX.HasValue && ProjectLocationPointY.HasValue
                        ? DbSpatialHelper.MakeDbGeometryFromCoordinates(ProjectLocationPointX.Value, ProjectLocationPointY.Value, MapInitJson.CoordinateSystemId)
                        : null;
                break;

            case ProjectLocationSimpleTypeEnum.None:
                project.ProjectLocationPoint = null;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            project.ProjectLocationNotes = ProjectLocationNotes;
        }