public ProductType(Guid customerId, string name, string codeBare, string desc, short chpCat, bool balance, decimal contenance, int uniteContenance, int tare, DateTime date, Guid tvaCustomerId, Guid productsWebCustomerId, int subGrpProductId) { CustomerId = customerId; Name = name.Trim().ToUpper(); CodeBare = RepositoryProductBc.GetAllBarCodes(codeBare, customerId); Desc = desc.ToUpper(); ChpCat = chpCat; Balance = balance; Contenance = contenance; UniteContenance = uniteContenance; Tare = tare; Date = date; TvaCustomerId = tvaCustomerId; ProductsWebCustomerId = productsWebCustomerId; SubGrpProduct = RepositorySubGroupProduct.SubGroupProducts.FirstOrDefault(sg => sg.Id == subGrpProductId); if (SubGrpProduct != null) { CusumerIdSubGroup = SubGrpProduct.Id; Sgrp = SubGrpProduct.Id; Grp = SubGrpProduct.GroupId; } Tva = RepositoryTva.Tvases.FirstOrDefault(t => t.CustomerId == tvaCustomerId); if (Tva != null) { TvaId = Tva.Id; } StockReal = new List <StockReal>(); }
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 => { }); }