public void AssignClusterCoordinator(int disasterId, int clusterId, int personId)
 {
     dataService.AddClusterCoordinator(new ClusterCoordinator {DisasterId = disasterId, ClusterId = clusterId, PersonId = personId});
     var clusterCoordinatorLogEntry = new ClusterCoordinatorLogEntry
                                      {
                                          Event = ClusterCoordinatorEvents.Assigned,
                                          TimeStampUtc = DateTime.UtcNow,
                                          ClusterId = clusterId,
                                          ClusterName = dataService.Clusters.Single(x=>x.Id == clusterId).Name,
                                          DisasterId = disasterId,
                                          DisasterName = dataService.Disasters.Single(x=>x.Id == disasterId).Name,
                                          PersonId = personId,
                                          PersonName = dataService.Persons.Single(x=>x.Id == personId).FullName,
                                      };
     dataService.AppendClusterCoordinatorLogEntry(clusterCoordinatorLogEntry);
 }
 public void UnassignClusterCoordinator(ClusterCoordinator clusterCoordinator)
 {
     dataService.RemoveClusterCoordinator(clusterCoordinator);
     var clusterCoordinatorLogEntry = new ClusterCoordinatorLogEntry
                                      {
                                          Event = ClusterCoordinatorEvents.Unassigned,
                                          TimeStampUtc = DateTime.UtcNow,
                                          ClusterId = clusterCoordinator.ClusterId,
                                          ClusterName = dataService.Clusters.Single(x => x.Id == clusterCoordinator.ClusterId).Name,
                                          DisasterId = clusterCoordinator.DisasterId,
                                          DisasterName = dataService.Disasters.Single(x => x.Id == clusterCoordinator.DisasterId).Name,
                                          PersonId = clusterCoordinator.PersonId,
                                          PersonName = dataService.Persons.Single(x => x.Id == clusterCoordinator.PersonId).FullName,
                                      };
     dataService.AppendClusterCoordinatorLogEntry(clusterCoordinatorLogEntry);
 }
예제 #3
0
 public void AppendClusterCoordinatorLogEntry(ClusterCoordinatorLogEntry clusterCoordinatorLogEntry)
 {
     context.ClusterCoordinatorLogEntries.Add(clusterCoordinatorLogEntry);
     context.SaveChanges();
 }
 private void AppendLogEntry(ClusterCoordinator coordinator)
 {
     var clusterCoordinatorLogEntry = new ClusterCoordinatorLogEntry
                                      {
                                          Event = ClusterCoordinatorEvents.Assigned,
                                          TimeStampUtc = DateTime.UtcNow,
                                          ClusterId = coordinator.ClusterId,
                                          ClusterName = coordinator.Cluster.Name,
                                          DisasterId = coordinator.DisasterId,
                                          DisasterName = coordinator.Disaster.Name,
                                          PersonId = coordinator.PersonId,
                                          PersonName = coordinator.Person.FullName,
                                      };
     _dataService.AppendClusterCoordinatorLogEntry(clusterCoordinatorLogEntry);
 }
 public void UnassignClusterCoordinator(ClusterCoordinator clusterCoordinator)
 {
     var clusterCoordinatorLogEntry = new ClusterCoordinatorLogEntry
                                      {
                                          Event = ClusterCoordinatorEvents.Unassigned,
                                          TimeStampUtc = DateTime.UtcNow,
                                          ClusterId = clusterCoordinator.ClusterId,
                                          ClusterName = clusterCoordinator.Cluster.Name,
                                          DisasterId = clusterCoordinator.DisasterId,
                                          DisasterName = clusterCoordinator.Disaster.Name,
                                          PersonId = clusterCoordinator.PersonId,
                                          PersonName = clusterCoordinator.Person.FullName
                                      };
     _dataService.RemoveClusterCoordinator(clusterCoordinator);
     _dataService.AppendClusterCoordinatorLogEntry(clusterCoordinatorLogEntry);
 }