Esempio n. 1
0
 private void SyncResultsWorkerHandler(InputWorkerParameters WorkerParameters)
 {
     try
     {
         var unsendedDevices = _resultsService.GetUnsendedDevices();
         using (var centralDbClient = new CentralDatabaseServiceClient())
         {
             foreach (var unsendedDevice in unsendedDevices)
             {
                 var sended = centralDbClient.SendResultToServer(unsendedDevice);
                 if (sended)
                 {
                     _resultsService.SetResultSended(unsendedDevice.Id);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(string.Format("Error while syncing results from local database with a master:{0}", ex.Message));
     }
 }