Esempio n. 1
0
 private void ExecuteReplace()
 {
     Task.Run(() =>
     {
         _randomDataGenerator.ProgressValue = 0;
         _onworking = true;
         ReplaceDB.RaiseCanExecuteChanged();
         AddToDB.RaiseCanExecuteChanged();
         _randomDataGenerator.DeleteAll();
         ExecuteAdd();
         _onworking = false;
         ReplaceDB.RaiseCanExecuteChanged();
         AddToDB.RaiseCanExecuteChanged();
     });
 }
Esempio n. 2
0
 private void ExecuteAdd()
 {
     Task.Run(() =>
     {
         _randomDataGenerator.ProgressValue = 0;
         SafeInvoke(OnWork);
         _onworking = true;
         AddToDB.RaiseCanExecuteChanged();
         ReplaceDB.RaiseCanExecuteChanged();
         _randomDataGenerator.AddCountriesFromApi(numberOfCountries);
         Message = _randomDataGenerator.Message;
         _randomDataGenerator.AddCustomerToDB(numberOfCustomers);
         Message = _randomDataGenerator.Message;
         _randomDataGenerator.AddRandomAirlines(numberOfAirlines);
         Message = _randomDataGenerator.Message;
         _randomDataGenerator.AddRandomFlights(numberOfFlights);
         Message = _randomDataGenerator.Message;
         _randomDataGenerator.AddRandomTickets(numberOfTickets);
         Message    = _randomDataGenerator.Message;
         _onworking = false;
         AddToDB.RaiseCanExecuteChanged();
         ReplaceDB.RaiseCanExecuteChanged();
     });
 }