Пример #1
0
 protected override async Task ExecuteAsync(CancellationToken stoppingToken)
 {
     if (_remoteDatabaseService.IsCollectionExist())
     {
         _logger.LogInformation("jA EZXIXWSDASK AJ DAICJKA =SCOJA");
     }
     else
     {
         foreach (var supplie in await _localDatabaseService.GetAllSupplies())
         {
             await _remoteDatabaseService.SaveSupplie(supplie);
         }
     }
 }
Пример #2
0
        private void OnConnect()
        {
            var connectionString = _localDatabaseSettings.GenerateConnectionString();
            var status           = _localDatabaseService.GetStatusConnectDatabase(connectionString);

            if (status)
            {
                MessageBox.Show("Banco conectado com sucesso.", "RiseSync", MessageBoxButton.OK, MessageBoxImage.Information);
                _supplies = (ICollection <Supply>)_localDatabaseService.GetAllSupplies(connectionString, Database).Result;
                Items     = $"{_supplies.Count} items.";
            }
            else
            {
                MessageBox.Show("Banco não conectado", "RiseSync", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }