//Recherche des factures sen fonction des critère entré private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit) { //Activation du busy indicator allowProgressBar(); //Grisé certain éléments du formulaire pour bloqué certainnes actions ActiverElement(false); //Exécution du service web recupération des factures Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement")); service.RemplirfactureAvecProduitCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } Lstfacture = args.Result; if (this.Anciennecamp != null) { foreach (var item_ in this.Anciennecamp) { foreach (var item in item_.DETAILCAMPAGNEGC_) { CsLclient facture = new CsLclient(); facture.CENTRE = item.CENTRE; facture.CLIENT = item.CLIENT; facture.ORDRE = item.ORDRE; facture.NOM = item.NOM; facture.REFEM = item.PERIODE; facture.SOLDEFACTURE = item.MONTANT; facture.NDOC = item.NDOC; Lstfacture.Add(facture); } } } System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture); LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture); if (dg_facture.ItemsSource != null) { this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant); } btn_Rech.IsEnabled = true; desableProgressBar(); ActiverElement(true); return; }; service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit); }
//Recherche des factures sen fonction des critère entré private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit) { //Activation du busy indicator allowProgressBar(); //Grisé certain éléments du formulaire pour bloqué certainnes actions ActiverElement(false); //Exécution du service web recupération des factures Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement")); service.RemplirfactureAvecProduitCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } List <CsLclient> lstFactureGeneral = new List <CsLclient>(); List <CsLclient> lstFactureExist = new List <CsLclient>(); lstFactureGeneral = args.Result; /*LKO 15/01/2021 VERFICATION DE DOUBLON A LA CREATION D'UNE CAMPAGNE */ if (lstFactureGeneral != null && lstFactureGeneral.Count != 0) { lstFactureExist = lstFactureGeneral.Where(t => t.IsPAIEMENTANTICIPE).ToList(); Lstfacture = lstFactureGeneral.Where(t => !t.IsPAIEMENTANTICIPE).ToList(); } if (lstFactureExist != null && lstFactureExist.Count != 0) { List <object> _LstObj = new List <object>(); _LstObj = ClasseMEthodeGenerique.RetourneListeObjet(lstFactureExist); Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>(); _LstColonneAffich.Add("NUMDEM", "CAMPAGNE"); _LstColonneAffich.Add("CENTRE", "CENTRE"); _LstColonneAffich.Add("CLIENT", "CLIENT"); _LstColonneAffich.Add("ORDRE", "ORDRE"); _LstColonneAffich.Add("NDOC", "NUM FACTURE"); _LstColonneAffich.Add("REFEM", "PERIODE"); List <object> obj = Shared.ClasseMEthodeGenerique.RetourneListeObjet(_LstObj); MainView.UcListeClientMultiple ctrl = new MainView.UcListeClientMultiple(obj, _LstColonneAffich, false, "Liste des factures deja dans une campagne"); ctrl.Closed += new EventHandler(galatee_OkClickedChoixClient); ctrl.Show(); return; } /*****/ else { if (this.Anciennecamp != null) { foreach (var item_ in this.Anciennecamp) { foreach (var item in item_.DETAILCAMPAGNEGC_) { CsLclient facture = new CsLclient(); facture.CENTRE = item.CENTRE; facture.CLIENT = item.CLIENT; facture.ORDRE = item.ORDRE; facture.NOM = item.NOM; facture.REFEM = item.PERIODE; facture.SOLDEFACTURE = item.MONTANT; facture.NDOC = item.NDOC; Lstfacture.Add(facture); } } } System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture); LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture); if (dg_facture.ItemsSource != null) { this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant); } btn_Rech.IsEnabled = true; desableProgressBar(); ActiverElement(true); return; } }; service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit); }