public static void MegaSync() { // check tables var syncTask = Task <bool> .Factory.StartNew( () => { RepositoryActionHashBox.Sync(); //RepositoryCheck RepositoryCheckTicket.Sync(); RepositoryCheckTicketTmp.Sync(); RepositoryPro.Sync(); RepositoryClientInfo.Sync(); RepositoryCloseTicket.Sync(); RepositoryCloseTicketCheckDiscount.Sync(); RepositoryCloseTicketG.Sync(); RepositoryCloseTicketTmp.Sync(); RepositoryCountry.Sync(); RepositoryCurrency.Sync(); //RepositoryCurrencyRelations RepositoryDevisId.Sync(); RepositoryDevisWeb.Sync(); //RepositoryDiscount RepositoryDiscountCard.Sync(); RepositoryEstablishment.Sync(); RepositoryGeneral.Sync(); RepositoryGroupProduct.Sync(); //RepositoryHistoryChangeProduct RepositoryInfoClientsDiscountsType.Sync(); RepositoryLastUpdate.Sync(); RepositoryOpenTicketWindow.Sync(); RepositoryPayProduct.Sync(); RepositoryPayProductTmp.Sync(); //RepositoryPriceGros RepositoryProduct.Sync(); RepositoryProductBc.Sync(); RepositoryStatNation.Sync(); RepositoryStatNationPopup.Sync(); RepositoryStatPlaceArrond.Sync(); //RepositoryStockLogs RepositoryStockReal.Sync(); RepositorySyncPlus.Sync(); RepositorySyncPlusProduct.Sync(); //RepositoryTes RepositoryTva.Sync(); RepositoryTypePay.Sync(); //RepositoryXmlFile return(true); }); syncTask.ContinueWith( s => { }); }
private void ButtonClick(object sender, RoutedEventArgs e) { var name = xNameNation.Text; var qtyText = xQTY.Text; if (name.Length == 0) { FunctionsService.ShowMessageTime("Пустое знаение "); } else { if (Snp.Find(l => l.NameNation == name) != null) { FunctionsService.ShowMessageTime("Такое имя сущ-ет "); } else { int qty = 0; if (int.TryParse(qtyText, out qty)) { var sn = new StatNationPopup(Guid.NewGuid(), name, qty); RepositoryStatNationPopup.Add(sn); Snp.Add(sn); CollectionViewSource.GetDefaultView((Owner as WGrid).dataGrid.ItemsSource).Refresh(); foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(WStat)) { WStat w = (window as WStat); w.Reload(); } } Close(); } else { FunctionsService.ShowMessageTime("Неверое значние поля QTY "); } } } }