Esempio n. 1
0
 private void SaveToDatabase(Alarm alarm)
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         repo.Add(_serviceId, alarm);
     }
 }
 public void DeniedRemoval(string clientName)
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         repo.RemoveClientRequest(clientName);
     }
 }
 private void AddForRemovalEvaluation(string clientName)
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         repo.AddClientRequest(clientName);
     }
 }
 public List <string> GetClientRemovalRequests()
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         return(repo.GetAllClientRequests().ToList());
     }
 }
 public void RemoveAllAlarms()
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         repo.DeleteAll();
     }
 }
 public List <Alarm> GetAlarms()
 {
     using (var repo = AlarmRepositoryFactory.CreateNew(DefaultConnectionString))
     {
         return(repo.GetAllByServiceId(_serviceId).ToList());
     }
 }