private void ucgCentre(object sender, EventArgs e)
 {
     Galatee.Silverlight.Facturation.UcGenerique ctrs = sender as Galatee.Silverlight.Facturation.UcGenerique;
     if (ctrs.isOkClick)
     {
         List <Galatee.Silverlight.ServiceFacturation.CsLotri> LesCentreeDuLot = (List <Galatee.Silverlight.ServiceFacturation.CsLotri>)ctrs.MyObjectList;
         if (LesCentreeDuLot != null && LesCentreeDuLot.Count > 0)
         {
             int passage = 1;
             foreach (Galatee.Silverlight.ServiceFacturation.CsLotri item in LesCentreeDuLot)
             {
                 if (passage == 1)
                 {
                     this.Txt_LibelleCentre.Text = item.CODE;
                 }
                 else
                 {
                     this.Txt_LibelleCentre.Text = this.Txt_LibelleCentre.Text + "  " + item.CODE;
                 }
                 passage++;
             }
             this.Txt_LibelleCentre.Tag = LesCentreeDuLot.Select(o => o.CODE).ToList();
         }
     }
 }
        private void btn_Centre_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <ServiceAccueil.CsCentre> lstCentreDistinct = new List <ServiceAccueil.CsCentre>();
                if (SessionObject.LstCentre.Count != 0)
                {
                    var lesDistinct = SessionObject.LstCentre.Where(ip => ip.CODE != "001" && ip.CODE != "002" &&
                                                                    ip.CODE != "003" && ip.CODE != "004").
                                      Select(u => new { u.CODE, u.LIBELLE }).Distinct();
                    foreach (var item in lesDistinct)
                    {
                        ServiceAccueil.CsCentre leCentr = new ServiceAccueil.CsCentre();
                        leCentr.CODE    = item.CODE;
                        leCentr.LIBELLE = item.LIBELLE;
                        lstCentreDistinct.Add(leCentr);
                    }
                }


                if (lstCentreDistinct != null && lstCentreDistinct.Count != 0)
                {
                    this.btn_Centre.IsEnabled = false;
                    List <Galatee.Silverlight.ServiceFacturation.CsLotri> leLotSelect = new List <Galatee.Silverlight.ServiceFacturation.CsLotri>();
                    Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();
                    _LstColonneAffich.Add("CODE", "CODE");
                    _LstColonneAffich.Add("LIBELLE", "LIBELLE");
                    foreach (ServiceAccueil.CsCentre item in lstCentreDistinct)
                    {
                        leLotSelect.Add(new ServiceFacturation.CsLotri()
                        {
                            CODE    = item.CODE,
                            LIBELLE = item.LIBELLE
                        });
                    }
                    Galatee.Silverlight.Facturation.UcGenerique ctrl = new Galatee.Silverlight.Facturation.UcGenerique(leLotSelect, true, "Liste des centres");
                    ctrl.Closed += new EventHandler(ucgCentre);
                    ctrl.Show();
                    this.btn_Centre.IsEnabled = true;
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, "Erreur");
            }
        }