public async Task <IActionResult> PutGreetings(int id, Greetings greetings) { if (id != greetings.Id) { return(BadRequest()); } _context.Entry(greetings).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GreetingsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Greetings GetWantedGreetingByName(string name) { string wantedGreetingString = PeopleData.Find_name(name).greeting; Greetings result = Greetings.None; switch (wantedGreetingString) { case "hug": result = Greetings.Hug; break; case "kiss": result = Greetings.Kiss; break; case "bump": result = Greetings.Bump; break; case "shake": result = Greetings.Shake; break; } return(result); }
public async Task <ActionResult <Greetings> > PostGreetings(Greetings greetings) { _context.Greetings.Add(greetings); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGreetings", new { id = greetings.Id }, greetings)); }
public void EstablishedCustomerGreetingsList() { Greetings greeting1 = new Greetings("John", "Smith", CustomerType.Past); Greetings greeting2 = new Greetings("Tom", "Smith", CustomerType.Current); Greetings greeting3 = new Greetings("Elon", "Thomas", CustomerType.Current); Greetings greeting4 = new Greetings("Jake", "Clark", CustomerType.Current); Greetings greeting5 = new Greetings("Martha", "Maddox", CustomerType.Current); Greetings greeting6 = new Greetings("Penny", "Parker", CustomerType.Past); Greetings greeting7 = new Greetings("Don", "Trump", CustomerType.Past); Greetings greeting8 = new Greetings("Ben", "Sharp", CustomerType.Potential); Greetings greeting9 = new Greetings("Milly", "Thomas", CustomerType.Potential); Greetings greeting10 = new Greetings("Janet", "Aikens", CustomerType.Potential); Greetings greeting11 = new Greetings("John", "Nelson", CustomerType.Potential); Greetings greeting12 = new Greetings("Clark", "Hurley", CustomerType.Potential); _greetingsRepo.AddCustomerGreeting(greeting1); _greetingsRepo.AddCustomerGreeting(greeting2); _greetingsRepo.AddCustomerGreeting(greeting3); _greetingsRepo.AddCustomerGreeting(greeting4); _greetingsRepo.AddCustomerGreeting(greeting5); _greetingsRepo.AddCustomerGreeting(greeting6); _greetingsRepo.AddCustomerGreeting(greeting7); _greetingsRepo.AddCustomerGreeting(greeting8); _greetingsRepo.AddCustomerGreeting(greeting9); _greetingsRepo.AddCustomerGreeting(greeting10); _greetingsRepo.AddCustomerGreeting(greeting11); _greetingsRepo.AddCustomerGreeting(greeting12); }
/// <summary> /// Exits AISA after greeting the user /// </summary> private void ExitAISA() { //Stop the AISA Recognition //Say the end greeting OpenSpeak.Speak(Greetings.End()); AISAHandler.Pause(); //Disappear the program var da = new DoubleAnimation(SystemParameters.PrimaryScreenHeight, TimeSpan.FromSeconds(1)); da.EasingFunction = new QuinticEase(); BeginAnimation(TopProperty, da); //Close the program in 2 seconds var dt = new DispatcherTimer(); dt.Interval = TimeSpan.FromSeconds(2); dt.Tick += (a, b) => { Application.Current.Shutdown(); }; dt.Start(); }
public Greetings GetGreetingMessage(string dateTime) { Greetings greetings = new Greetings(); DateTime timeOfDayGreeting = DateTime.Now; if (!string.IsNullOrEmpty(dateTime)) { DateTime.TryParse(dateTime, out timeOfDayGreeting); } if (timeOfDayGreeting.Hour >= 5 && timeOfDayGreeting.Hour < 12) { greetings.GreetingMessage = "Good morning!"; } else if (timeOfDayGreeting.Hour >= 12 && timeOfDayGreeting.Hour < 16) { greetings.GreetingMessage = "Good afternoon!"; } else if (timeOfDayGreeting.Hour >= 16 && timeOfDayGreeting.Hour < 20) { greetings.GreetingMessage = "Good evening!"; } else { greetings.GreetingMessage = "Good night!"; } return(greetings); }
static void Main(string[] args) { Console.WriteLine("Start"); Greetings g = new Greetings(SayHello); g("Ari"); g += SayHallo; g("Ari"); // Anonym, d.h. direkt mit eine Methodenimplementierung Anonym a = delegate(string name) { Console.WriteLine("Ich bin Anonym " + name); }; a("Anonymous"); Timer t = new Timer(); t.Start(); CounterUp u = new CounterUp(t); // Warten Simulieren Thread.Sleep(10000); t.Stopp(); Console.WriteLine("End"); }
public void PlaySceneRole(People People, Greetings PlayerGreeting) { switch (People.Type) { case Roles.Wife: PlaySceneWife(People, PlayerGreeting); break; case Roles.Boss: PlaySceneBoss(People, PlayerGreeting); break; case Roles.Friend: PlaySceneFriend(People, PlayerGreeting); break; case Roles.Mother: PlaySceneMother(People, PlayerGreeting); break; } }
public IActionResult Greetings(string name) { var greetings = new Greetings(WebApplication1.Models.Greetings.counter++, name); return(View(greetings)); }
public MainWindow() { InitializeComponent(); //Set Dimensions of the Window Height = 600; Width = 350; Left = SystemParameters.FullPrimaryScreenWidth - Width; Top = SystemParameters.FullPrimaryScreenHeight; //Animate from Bottom var da = new DoubleAnimation(SystemParameters.FullPrimaryScreenHeight, SystemParameters.WorkArea.Height - Height, TimeSpan.FromSeconds(1)); da.EasingFunction = new QuinticEase(); da.BeginTime = TimeSpan.FromSeconds(2); BeginAnimation(TopProperty, da); //Set the greeting text HelloUser.Content = Greetings.Greet(); //Configure the speech synthesizer synthesizer.SelectVoice("Kate"); synthesizer.Volume = 100; synthesizer.Rate = 0; //Attach the exiting code to the viewControllerConnector ViewControllerConnector.Exit += ExitAISA; }
static void Main(string[] args) { Greetings.SayHello(); // немного dll Console.WriteLine(Properties.Settings.Default.Hello); Console.Write("если хотите очистить таблицы напишите clean: "); string clean = Console.ReadLine(); if (clean == "clean") { Properties.Settings.Default.Reset(); } else if (string.IsNullOrEmpty(Properties.Settings.Default.Name) && string.IsNullOrEmpty(Properties.Settings.Default.Age) && string.IsNullOrEmpty(Properties.Settings.Default.job)) { Console.Write("Введите ваше имя: "); Properties.Settings.Default.Name = Console.ReadLine(); Console.Write("Cколько вам лет: "); Properties.Settings.Default.Age = (Console.ReadLine()); Console.Write("Ваш род деятельности: "); Properties.Settings.Default.job = Console.ReadLine(); Properties.Settings.Default.Save(); } else { string name = Properties.Settings.Default.Name; string age = Properties.Settings.Default.Age; string job = Properties.Settings.Default.job; Console.WriteLine("Привет {0} {1} {2}", name, age, job); } Console.ReadKey(); }
public void OnGet(int ID = 0) { if (ID > 0) { bridgeGreetings = _myDB.Greetings.Find(ID); } }
public void UpdateExistingCustomer_ShouldReturnTrue() { Greetings updateGreeting = new Greetings("John", "Smith", CustomerType.Current); bool updateResult = _greetingsRepo.UpdateExistingCustomerGreeting("Smith", "John", updateGreeting); Assert.IsTrue(updateResult); }
public void TestNotResponding() { Greetings dialogUnit = new Greetings(); DialogContext context = new DialogContext(); DialogUnitTestUtils.TestNotResponding(dialogUnit, context, "Как дела?"); }
public static void Main(string [] args) { Simulation sim = new Simulation(); Greetings greetings = new Greetings(); // (2) Process process = new Process(sim, greetings.SayHello); // (3) sim.Run(process); }
public IndexModel(IOptions <Greetings> greetings, ILogger <IndexModel> logger, IMovieData movieData) { this.greetings = greetings.Value; this.logger = logger; this.movieData = movieData; }
public void GetGreetingsByNameTest() { SetTestContent(); Greetings greeting = _greetingsTestRepo.GetGreetingsByNames(person2.FirstName, person2.LastName); Assert.AreEqual(greeting.LastName, person2.LastName); }
private void ResovleTypes() { m_riffSystemOperations = Bootstrapper.ResolveType <RiffSystemOperations>(); m_greetings = Bootstrapper.ResolveType <Greetings>(); m_speechHandlerChain = Bootstrapper.ResolveType <ISpeechHandlerChain>(); m_speechContext = Bootstrapper.ResolveType <ISpeechContext>(); m_speechRecognitionEngine = Bootstrapper.ResolveType <IRecognitionEngineProvider>(); }
public MainWindow() { InitializeComponent(); string preferredLanguage = ConfigurationManager.AppSettings["PreferredLanguage"]; textBlock.Text = Greetings.GetGreetingInLanguage(preferredLanguage); }
public RiffSystemOperations(ISpeechContext speechContext) : base(speechContext) { m_greetings = Bootstrapper.ResolveType <Greetings>(); m_speechSynthesizer = m_speechContext.SpeechSynthesizer(); m_stopListeningTimer = new System.Windows.Forms.Timer(); m_stopListeningTimer.Tick += new EventHandler(Tick); m_stopListeningTimer.Interval = 1000; }
public void RemoveGreetingByNameTest() { SetTestContent(); _greetingsTestRepo.RemoveGreetingByName(person2.FirstName, person2.LastName); Greetings greeting = _greetingsTestRepo.GetGreetingsByNames(person2.LastName, person2.FirstName); Assert.IsNull(greeting); }
private void OnLeaveHandler(Person p) { Console.WriteLine($"{p.Name} left the office."); EveryoneSayHi -= p.SayHi; EveryoneSayBye -= p.SayBye; EveryoneSayBye?.Invoke(p); Console.WriteLine(); }
private void OnCameHandler(Person p, int time) { Console.WriteLine($"{p.Name} came to office."); EveryoneSayHi?.Invoke(p, Person.TimeOfday); EveryoneSayHi += p.SayHi; EveryoneSayBye += p.SayBye; Console.WriteLine(); }
public void AddCustomer_ShouldGetNotNull() { Greetings newGreetings = new Greetings("Tom", "Smith", CustomerType.Current); GreetingsRepo repository = new GreetingsRepo(); repository.AddCustomerGreeting(newGreetings); Greetings fromDirectory = repository.GetCustomerByFullName("Smith", "Tom"); Assert.IsNotNull(fromDirectory); }
private void SetContent() { Greetings person1 = new Greetings("Don", "Pablo", GreetingType.current, ""); Greetings person2 = new Greetings("Jack", "Ryan", GreetingType.past, ""); Greetings person3 = new Greetings("Lucie", "Smith", GreetingType.potential, ""); _greetingsRepo.AddGreetingsToList(person1); _greetingsRepo.AddGreetingsToList(person2); _greetingsRepo.AddGreetingsToList(person3); }
public Greetings Get(Int64 ixGreeting) { Greetings greetings = _context.Greetings.AsNoTracking().Where(x => x.ixGreeting == ixGreeting).First(); greetings.Languages = _context.Languages.Find(greetings.ixLanguage); greetings.LanguageStyles = _context.LanguageStyles.Find(greetings.ixLanguageStyle); greetings.ResponseTypes = _context.ResponseTypes.Find(greetings.ixResponseType); return(greetings); }
public void TestProtectedWriteHelloMethod() { var firstName = "John"; var lastName = "Doe"; var sut = new Greetings(firstName, lastName); var greeting = sut.WriteHello(firstName, lastName); }
public void TestResponding() { Greetings dialogUnit = new Greetings(); DialogContext context = new DialogContext(); DialogUnitTestUtils.TestResponding(dialogUnit, context, "Привет!", "Привет!"); context.Upsert(new ClientName("Иван")); DialogUnitTestUtils.TestResponding(dialogUnit, context, "Здрасте!", "Привет, Иван!"); }
public static void Main() { // read name Console.WriteLine("Name: "); var name = Console.ReadLine().Trim(); // say hello var g = new Greetings(); Console.WriteLine(g.SayHello(name)); }
public void PlaySceneBoss(People People, Greetings PlayerGreeting) { if (People.WantedGreeting == PlayerGreeting) { Scene_Animator.SetInteger("Scene", 7); } else { Scene_Animator.SetInteger("Scene", 8); } }
private void RunSynchronizationInBackground() { try { var serverAddress = _configurationManager.GetConfig("Common") .GetSection("Server") .GetSetting("Address") .Value; var username = _configurationManager.GetConfig("Common") .GetSection("Server") .GetSetting("Username") .Value; var password = _configurationManager.GetConfig("Common") .GetSection("Server") .GetSetting("Password") .Value; var bathSize = _configurationManager.GetConfig("Common") .GetSection("Synchronization") .GetSetting("BathSize") .As<int>(); var databaseName = _configurationManager.GetConfig("Common") .GetSection("Database") .GetSetting("FileName") .Value; var schemaScript = _configurationManager.GetConfig("Common") .GetSection("Database") .GetSetting("SchemaScript") .Value; using (IWebServer webServer = new WebServer(serverAddress, username, password)) { Notify(new TextNotification("Start synchronization")); _view.ShowProgressBar(); AppCache.Clear(); Notify(new TextNotification("Routes synchronization")); var routesRepository = _repositoryFactory.CreateRepository<Route>(); var routePointsRepository = _repositoryFactory.CreateRepository<RoutePoint>(); var routesSyncCmd = new RoutesSynchronization(webServer, routesRepository, routePointsRepository, _unitOfWorkFactory).RepeatOnError(3, 5000); routesSyncCmd.Execute(); Notify(new TextNotification("Orders synchronization")); var ordersRepository = _repositoryFactory.CreateRepository<Order>(); var ordersSyncCmd = new OrdersSynchronization(webServer, ordersRepository, _unitOfWorkFactory).RepeatOnError(3, 5000); ordersSyncCmd.Execute(); if (_viewModel.SynchronizeFully) { Notify(new TextNotification("Clear Database")); _storageManager.DeleteCurrentStorage(); // Initialization string databaseScriptFullPath = Environment.AppPath + schemaScript; string databaseFileFullPath = Environment.AppPath + databaseName; _storageManager.CreateOrOpenStorage(databaseFileFullPath, databaseScriptFullPath); Notify(new TextNotification("Greetings")); var greetings = new Greetings(webServer); greetings.Execute(); } DateTime synchronizationDate = webServer.Connect().ServerTime(); // Customers synchronization Notify(new TextNotification("Customers synchronization")); var customerDtoRepository = new WebRepository<CustomerDto>(webServer); var customerRepository = _repositoryFactory.CreateRepository<Customer>(); DtoTranslator<Customer, CustomerDto> customerTranslator = new CustomerTranslator(_repositoryFactory); Command<bool> customerSyncCmd = _viewModel.SynchronizeFully ? new SynchronizationCommand <CustomerDto, Customer>( customerDtoRepository, customerRepository, customerTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <CustomerDto, Customer>( customerDtoRepository, customerRepository, customerTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); customerSyncCmd = customerSyncCmd.RepeatOnError(3, 5000); customerSyncCmd.Execute(); Notify(new ProgressNotification(7)); // Shipping addresses synchronization Notify(new TextNotification("Shipping addresses synchronization")); var shippingAddressDtoRepository = new WebRepository<ShippingAddressDto>(webServer); var shippingAddressSqLiteRepository = _repositoryFactory.CreateRepository<ShippingAddress>(); DtoTranslator<ShippingAddress, ShippingAddressDto> shippingAddressdTranslator = new ShippingAddressdTranslator(); Command<bool> shippingAddressSyncCmd = _viewModel.SynchronizeFully ? new SynchronizationCommand <ShippingAddressDto, ShippingAddress>( shippingAddressDtoRepository, shippingAddressSqLiteRepository, shippingAddressdTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <ShippingAddressDto, ShippingAddress>( shippingAddressDtoRepository, shippingAddressSqLiteRepository, shippingAddressdTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); shippingAddressSyncCmd = shippingAddressSyncCmd.RepeatOnError(3, 5000); shippingAddressSyncCmd.Execute(); Notify(new ProgressNotification(15)); // Categories synchronization Notify(new TextNotification("Categories synchronization")); var categoriesDtoRepository = new WebRepository<CategoryDto>(webServer); var categorySqLiteRepository = _repositoryFactory.CreateRepository<Category>(); DtoTranslator<Category, CategoryDto> categoriesTranslator = new CategoryTranslator(); Command<bool> categoriesSyncCmd = _viewModel.SynchronizeFully ? new CategotiesSynchronization ( categoriesDtoRepository, categorySqLiteRepository, categoriesTranslator, _unitOfWorkFactory, bathSize) : new CategotiesSynchronization ( categoriesDtoRepository, categorySqLiteRepository, categoriesTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); categoriesSyncCmd = categoriesSyncCmd.RepeatOnError(3, 5000); categoriesSyncCmd.Execute(); Notify(new ProgressNotification(30)); // Statuses synchronization Notify(new TextNotification("Statuses synchronization")); var statusDtoRepository = new WebRepository<StatusDto>(webServer); var statusSqLiteRepository = _repositoryFactory.CreateRepository<Status>(); DtoTranslator<Status, StatusDto> statusTranslator = new StatusTranslator(); Command<bool> statusSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <StatusDto, Status>( statusDtoRepository, statusSqLiteRepository, statusTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <StatusDto, Status>( statusDtoRepository, statusSqLiteRepository, statusTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); statusSyncCommand = statusSyncCommand.RepeatOnError(3, 5000); statusSyncCommand.Execute(); Notify(new ProgressNotification(37)); // Warehouses synchronization Notify(new TextNotification("Warehouses synchronization")); var warehouseDtoRepository = new WebRepository<WarehouseDto>(webServer); var warehouseSqLiteRepository = _repositoryFactory.CreateRepository<Warehouse>(); DtoTranslator<Warehouse, WarehouseDto> warehouseTranslator = new WarehouseTranslator(); Command<bool> warehouseSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <WarehouseDto, Warehouse>( warehouseDtoRepository, warehouseSqLiteRepository, warehouseTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <WarehouseDto, Warehouse>( warehouseDtoRepository, warehouseSqLiteRepository, warehouseTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); warehouseSyncCommand = warehouseSyncCommand.RepeatOnError(3, 5000); warehouseSyncCommand.Execute(); Notify(new ProgressNotification(45)); // Price lists synchronization Notify(new TextNotification("Price lists synchronization")); var priceListDtoRepository = new WebRepository<PriceListDto>(webServer); var priceListSqLiteRepository = _repositoryFactory.CreateRepository<PriceList>(); DtoTranslator<PriceList, PriceListDto> priceListTranslator = new PriceListTranslator(_repositoryFactory); Command<bool> priceListSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <PriceListDto, PriceList>( priceListDtoRepository, priceListSqLiteRepository, priceListTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <PriceListDto, PriceList>( priceListDtoRepository, priceListSqLiteRepository, priceListTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); priceListSyncCommand = priceListSyncCommand.RepeatOnError(3, 5000); priceListSyncCommand.Execute(); Notify(new ProgressNotification(52)); // UnitOfMeasures synchronization Notify(new TextNotification("UnitOfMeasures synchronization")); var unitOfMeasureDtoRepository = new WebRepository<UnitOfMeasureDto>(webServer); var unitOfMeasureSqLiteRepository = _repositoryFactory.CreateRepository<UnitOfMeasure>(); DtoTranslator<UnitOfMeasure, UnitOfMeasureDto> unitOfMeasureTranslator = new UnitOfMeasureTranslator(); Command<bool> unitOfMeasureSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <UnitOfMeasureDto, UnitOfMeasure>( unitOfMeasureDtoRepository, unitOfMeasureSqLiteRepository, unitOfMeasureTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <UnitOfMeasureDto, UnitOfMeasure>( unitOfMeasureDtoRepository, unitOfMeasureSqLiteRepository, unitOfMeasureTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); unitOfMeasureSyncCommand = unitOfMeasureSyncCommand.RepeatOnError(3, 5000); unitOfMeasureSyncCommand.Execute(); Notify(new ProgressNotification(60)); // Products synchronization Notify(new TextNotification("Products synchronization")); var productDtoRepository = new WebRepository<ProductDto>(webServer); var productSqLiteRepository = _repositoryFactory.CreateRepository<Product>(); DtoTranslator<Product, ProductDto> productTranslator = new ProductTranslator(_repositoryFactory); Command<bool> productSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <ProductDto, Product >( productDtoRepository, productSqLiteRepository, productTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <ProductDto, Product >( productDtoRepository, productSqLiteRepository, productTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); productSyncCommand = productSyncCommand.RepeatOnError(3, 5000); productSyncCommand.Execute(); Notify(new ProgressNotification(67)); // Product prices synchronization Notify(new TextNotification("Product prices synchronization")); var productsPriceDtoRepository = new WebRepository<ProductPriceDto>(webServer); var productsPriceSqLiteRepository = _repositoryFactory.CreateRepository<ProductsPrice>(); DtoTranslator<ProductsPrice, ProductPriceDto> productsPriceTranslator = new ProductsPriceTranslator(); Command<bool> productsPricesSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <ProductPriceDto, ProductsPrice>( productsPriceDtoRepository, productsPriceSqLiteRepository, productsPriceTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <ProductPriceDto, ProductsPrice>( productsPriceDtoRepository, productsPriceSqLiteRepository, productsPriceTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); productsPricesSyncCommand = productsPricesSyncCommand.RepeatOnError(3, 5000); productsPricesSyncCommand.Execute(); Notify(new ProgressNotification(75)); // Product units of measure synchronization Notify(new TextNotification("Product units of measure synchronization")); var productsUomDtoRepository = new WebRepository<ProductUnitOfMeasureDto>(webServer); var productsUnitOfMeasureSqLiteRepository = _repositoryFactory.CreateRepository<ProductsUnitOfMeasure>(); DtoTranslator<ProductsUnitOfMeasure, ProductUnitOfMeasureDto> productsUnitOfMeasureTranslator = new ProductsUnitOfMeasureTranslator(); Command<bool> productsUomSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <ProductUnitOfMeasureDto, ProductsUnitOfMeasure>( productsUomDtoRepository, productsUnitOfMeasureSqLiteRepository, productsUnitOfMeasureTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <ProductUnitOfMeasureDto, ProductsUnitOfMeasure>( productsUomDtoRepository, productsUnitOfMeasureSqLiteRepository, productsUnitOfMeasureTranslator, _unitOfWorkFactory, bathSize, _viewModel.LastSynchronizationDate); productsUomSyncCommand = productsUomSyncCommand.RepeatOnError(3, 5000); productsUomSyncCommand.Execute(); Notify(new ProgressNotification(82)); // Route templates synchronization Notify(new TextNotification("Route templates synchronization")); var routeTemplateDtoRepository = new WebRepository<RouteTemplateDto>(webServer); var routeTemplateSqLiteRepository = _repositoryFactory.CreateRepository<RouteTemplate>(); DtoTranslator<RouteTemplate, RouteTemplateDto> routeTemplateTranslator = new RouteTemplateTranslator(_repositoryFactory); Command<bool> routeTemplateSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <RouteTemplateDto, RouteTemplate>( routeTemplateDtoRepository, routeTemplateSqLiteRepository, routeTemplateTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <RouteTemplateDto, RouteTemplate>( routeTemplateDtoRepository, routeTemplateSqLiteRepository, routeTemplateTranslator, _unitOfWorkFactory, bathSize, _viewModel .LastSynchronizationDate); routeTemplateSyncCommand = routeTemplateSyncCommand.RepeatOnError(3, 5000); routeTemplateSyncCommand.Execute(); Notify(new ProgressNotification(90)); // Route points templates synchronization Notify(new TextNotification("Route points templates synchronization")); var routePointTemplateDtoRepository = new WebRepository<RoutePointTemplateDto>(webServer); var routePointTemplateSqLiteRepository = _repositoryFactory.CreateRepository<RoutePointTemplate>(); DtoTranslator<RoutePointTemplate, RoutePointTemplateDto> routePointTemplateTranslator = new RoutePointTemplateTranslator(); Command<bool> routePointTemplateSyncCommand = _viewModel.SynchronizeFully ? new SynchronizationCommand <RoutePointTemplateDto, RoutePointTemplate>( routePointTemplateDtoRepository, routePointTemplateSqLiteRepository, routePointTemplateTranslator, _unitOfWorkFactory, bathSize) : new SynchronizationCommand <RoutePointTemplateDto, RoutePointTemplate>( routePointTemplateDtoRepository, routePointTemplateSqLiteRepository, routePointTemplateTranslator, _unitOfWorkFactory, bathSize, _viewModel.LastSynchronizationDate); routePointTemplateSyncCommand = routePointTemplateSyncCommand.RepeatOnError(3, 5000); routePointTemplateSyncCommand.Execute(); Notify(new ProgressNotification(100)); // Managers settings synchronization Notify(new TextNotification("Managers settings synchronization")); warehouseSqLiteRepository = _repositoryFactory.CreateRepository<Warehouse>(); Command<bool> managerSettingsSyncCommand = _viewModel.SynchronizeFully ? new ManagerSynchronization( webServer, warehouseSqLiteRepository, _unitOfWorkFactory) : new ManagerSynchronization( webServer, warehouseSqLiteRepository, _unitOfWorkFactory, _viewModel .LastSynchronizationDate); managerSettingsSyncCommand = managerSettingsSyncCommand.RepeatOnError(3, 5000); managerSettingsSyncCommand.Execute(); // Settings synchronization Notify(new TextNotification("Settings synchronization")); Command<bool> settingsSyncCommand = _viewModel.SynchronizeFully ? new SettingsSynchronization( webServer, _configurationManager) : new SettingsSynchronization( webServer, _configurationManager, _viewModel.LastSynchronizationDate); settingsSyncCommand = settingsSyncCommand.RepeatOnError(3, 5000); settingsSyncCommand.Execute(); _configurationManager.GetConfig("Common") .GetSection("Synchronization") .GetSetting("LastSyncDate").Value = synchronizationDate.ToString(DateTimeFormatInfo.InvariantInfo); _configurationManager.GetConfig("Common").Save(); _view.ShowInformation("Synchronization complete"); } } catch (ThreadAbortException) { } catch (Exception exception) { Log.Error("Synchronization failed", exception); _view.ShowError(new[] {"Synchronization failed! Please, try to synchronize later."}); } finally { _view.MakeActive(); _inProcess = false; } _view.ReturnToMenu(); }