public InitiationCampagne(Galatee.Silverlight.Rpnt.ViewsModels.CsTBCAMPAGNECONTROLEBTA campagne, bool IsConsultation)
 {
     InitializeComponent();
     InitialisationDesVariablesLocales(campagne, IsConsultation);
     LoadUI();
     //LoadCampagne();
 }
        private void Load_Campagne()
        {
            listeCampagne.Clear();
            foreach (var item in Conteneur_listeCampagne)
            {
                C_BTA = new Galatee.Silverlight.Rpnt.ViewsModels.CsTBCAMPAGNECONTROLEBTA();
                string code_centre = item.CodeCentre != null?item.CodeCentre.ToString() : string.Empty;

                C_BTA.CODEEXPLOITATION = item.fk_idCentre.ToString();
                C_BTA.CAMPAGNE_ID      = item.Campagne_ID != null ? item.Campagne_ID : Guid.NewGuid();
                C_BTA.CODECENTRE       = code_centre;
                if (code_centre != string.Empty)
                {
                    C_BTA.LIBELLECENTRE = ListExploitation.First(c => Convert.ToInt16(c.CODE) == Convert.ToInt16(code_centre)).LIBELLE != null?ListExploitation.First(c => Convert.ToInt16(c.CODE) == Convert.ToInt16(code_centre)).LIBELLE : "";
                }
                else
                {
                    C_BTA.LIBELLECENTRE = string.Empty;
                }
                //C_BTA.METHODE = new CsREFMETHODEDEDETECTIONCLIENTSBTA();
                //C_BTA.METHODE.METHODE_ID = item.METHODE != null ? (item.METHODE.METHODE_ID != null ? item.METHODE.METHODE_ID : int.MinValue) : int.MinValue;
                C_BTA.DATECREATION                       = item.DateCreation != null ? item.DateCreation : DateTime.MinValue;
                C_BTA.DATEDEBUTCONTROLES                 = item.DateDebutControles != null ? item.DateDebutControles : DateTime.MinValue;
                C_BTA.DATEFINPREVUE                      = item.DateFinPrevue != null ? item.DateFinPrevue : DateTime.MinValue;
                C_BTA.DATEMODIFICATION                   = item.DateModification != null ? item.DateModification : DateTime.MinValue;
                C_BTA.LIBELLE_CAMPAGNE                   = item.Libelle_Campagne != null ? item.Libelle_Campagne : "";
                C_BTA.LIBELLEEXPLOITATION                = C_BTA.LIBELLECENTRE;
                C_BTA.MATRICULEAGENTCREATION             = item.MatriculeAgentCreation != null ? item.MatriculeAgentCreation : "";
                C_BTA.MATRICULEAGENTDERNIEREMODIFICATION = item.MatriculeAgentDerniereModification != null ? item.MatriculeAgentDerniereModification : "";
                C_BTA.NBREELEMENTS                       = item.NbreElements != null ? item.NbreElements : 0;
                C_BTA.STATUT    = item.Statut_ID == 1 ? " Actif ": " Inactif ";
                C_BTA.STATUT_ID = item.Statut_ID != null ? item.Statut_ID : 0;
                //C_BTA.NBRLOTS = item.NBRLOTS != null ? item.NBRLOTS : 0;
                //C_BTA.POULATIONNONAFFECTES = item.POULATIONNONAFFECTES != null ? item.POULATIONNONAFFECTES : 0;
                //C_BTA.LISTEBRANCHEMENT = new ObservableCollection<CsBrt>();
                //C_BTA.LISTELOT = new ObservableCollection<CsTBLOTDECONTROLEBTA>();
                //if (item.LISTEBRANCHEMENT != null)
                //{
                //    foreach (var item_ in item.LISTEBRANCHEMENT)
                //    {
                //        C_BTA.LISTEBRANCHEMENT.Add(item_);
                //    }
                //}
                //if (item.LISTELOT != null)
                //{
                //    foreach (var item_ in item.LISTELOT)
                //    {
                //        C_BTA.LISTELOT.Add(item_);
                //    }
                //}


                listeCampagne.Add(C_BTA);
                //txtnbrbranch.Text = ListeBrtCampagne.Count().ToString();
            }
        }