Example #1
0
        public static void CommitChangesToProject(ProjectUpdateBatch projectUpdateBatch,
                                                  DatabaseEntities databaseEntities)
        {
            var project = projectUpdateBatch.Project;
            var currentProjectLocations = project.GetProjectLocationDetailedAsProjectLocations(true).ToList();

            currentProjectLocations.ForEach(x => x.DeleteFull(databaseEntities));
            currentProjectLocations.Clear();

            if (projectUpdateBatch.ProjectUpdate.HasProjectLocationDetailed(true))
            {
                // Completely rebuild the list
                projectUpdateBatch.ProjectUpdate.GetProjectLocationDetailedAsProjectLocationUpdate(true).ForEach(x =>
                {
                    var projectLocation = new ProjectLocation(project, x.ProjectLocationUpdateGeometry, x.Annotation);
                    databaseEntities.AllProjectLocations.Add(projectLocation);
                });
            }
        }
Example #2
0
        public static void CommitChangesToProject(ProjectUpdateBatch projectUpdateBatch, IList <ProjectLocation> allProjectLocations)
        {
            var project = projectUpdateBatch.Project;
            var currentProjectLocations = project.ProjectLocations.ToList();

            currentProjectLocations.ForEach(projectLocation =>
            {
                allProjectLocations.Remove(projectLocation);
            });
            currentProjectLocations.Clear();

            if (projectUpdateBatch.ProjectLocationUpdates.Any())
            {
                // Completely rebuild the list
                projectUpdateBatch.ProjectLocationUpdates.ToList().ForEach(x =>
                {
                    var projectLocation = new ProjectLocation(project, x.ProjectLocationUpdateName, x.ProjectLocationUpdateGeometry, x.ProjectLocationType, x.ProjectLocationUpdateNotes);
                    allProjectLocations.Add(projectLocation);
                });
            }
        }
 public static void DeleteProjectLocation(this IQueryable <ProjectLocation> projectLocations, ProjectLocation projectLocationToDelete)
 {
     DeleteProjectLocation(projectLocations, new List <ProjectLocation> {
         projectLocationToDelete
     });
 }
 public static string GetProjectSimpleMapPopupUrl(this ProjectLocation projectLocation)
 {
     return(ProjectMapSimplePopuUrlTemplate.ParameterReplace(projectLocation.ProjectID));
 }