public AECInvoiceHistory(DateTime?PeriodeDebut, DateTime?PeriodeFin, bool ClearMode = false) { this.InitializeComponent(); this._PeriodeDebut = PeriodeDebut; this._PeriodeFin = PeriodeFin; this._ClearMode = ClearMode; if (this._ClearMode) { this.LabelOperation.Content = "Nettoyage des données !"; } this.ProgressBar.ToolTip = "Nombre de coeurs processeurs utilisés : " + MaximumThreadCount; // récupération de la liste des comptes client mappés Model.Local.CustomerRepository CustomerRepository = new Model.Local.CustomerRepository(); List <Model.Local.Customer> ListCustomer = CustomerRepository.List(); // récupération de la liste des comptes Sage existants Model.Sage.F_COMPTETRepository F_COMPTETRepository = new Model.Sage.F_COMPTETRepository(); //List<int> ListSage = F_COMPTETRepository.ListIdTypeSommeil((short)ABSTRACTION_SAGE.F_COMPTET.Obj._Enum_CT_Type.Client, (short)ABSTRACTION_SAGE.F_COMPTET.Obj._Enum_Boolean.Non); List <Model.Sage.F_COMPTET_Light> ListSage = F_COMPTETRepository.ListLight((short)ABSTRACTION_SAGE.F_COMPTET.Obj._Enum_CT_Type.Client, (short)ABSTRACTION_SAGE.F_COMPTET.Obj._Enum_Boolean.Non); // filtrage des comptes qui sont centralisés ListCustomer = ListCustomer.Where(c => ListSage.Count(s => s.cbMarq == c.Sag_Id) == 1).ToList(); // filtres clients de l'interface if (Core.Global.UILaunch) { if (!string.IsNullOrWhiteSpace(Core.Temp.ModuleAECInvoiceHistory_Numero)) { Core.Temp.LoadF_COMPTET_BtoBIfEmpty(); ListCustomer = ListCustomer.Where(c => c.Sag_Numero.StartsWith(Core.Temp.ModuleAECInvoiceHistory_Numero)).ToList(); } if (!string.IsNullOrWhiteSpace(Core.Temp.ModuleAECInvoiceHistory_Intitule)) { Core.Temp.LoadF_COMPTET_BtoBIfEmpty(); ListCustomer = ListCustomer.Where(c => c.Sag_Name.ToLower().Contains(Core.Temp.ModuleAECInvoiceHistory_Intitule.ToLower())).ToList(); } } this.ListCount = ListCustomer.Count; Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = MaximumThreadCount; this.ReportProgress(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListCustomer, this.ParallelOptions, Exec); }); }
public SynchroPortfolioCustomerEmployee(List <Model.Local.Customer> ListCustomer = null) { this.InitializeComponent(); if (ListCustomer == null) { Model.Local.CustomerRepository CustomerRepository = new Model.Local.CustomerRepository(); ListCustomer = CustomerRepository.List(); } this.ListCount = ListCustomer.Count; Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = MaximumThreadCount; this.ReportProgress(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListCustomer, this.ParallelOptions, Sync); }); }
public CustomerInfo(List <Model.Local.Customer> ListCustomer = null) { this.InitializeComponent(); if (ListCustomer == null) { Model.Local.CustomerRepository CustomerRepository = new Model.Local.CustomerRepository(); ListCustomer = CustomerRepository.List(); } this.ListCount = ListCustomer.Count; Context = SynchronizationContext.Current; this.ParallelOptions.MaxDegreeOfParallelism = System.Environment.ProcessorCount; this.ReportProgress(0); Task.Factory.StartNew(() => { Parallel.ForEach(ListCustomer, this.ParallelOptions, Sync); }); }