//private void ChargerDonneeDuSite()
        //{
        //    try
        //    {
        //        if (SessionObject.LstCentre.Count != 0)
        //        {
        //            LstCentre = SessionObject.LstCentre;
        //            //lstSite = new ClasseMEthodeGenerique().RetourneSiteByCentre(LstCentre);
        //            //if (lstSite != null)
        //            //{
        //            //    List<CsSite> _LstSite = lstSite.Where(p => p.CODESITE != SessionObject.Enumere.Generale).ToList();
        //            //    if (_LstSite.Count == 1)
        //            //    {
        //            //        this.Txt_CodeSite.Text = _LstSite[0].CODESITE;
        //            //        this.Txt_LibelleSite.Text = _LstSite[0].LIBELLE;
        //            //        this.btn_Site.IsEnabled = false;
        //            //        this.Txt_CodeSite.IsReadOnly = true;
        //            //    }
        //            //}
        //            return;
        //        }
        //        Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
        //        service.ListeDesDonneesDesSiteCompleted += (s, args) =>
        //        {
        //            if (args != null && args.Cancelled)
        //                return;
        //            SessionObject.LstCentre = args.Result;
        //            LstCentre = SessionObject.LstCentre;
        //            //lstSite = new ClasseMEthodeGenerique().RetourneSiteByCentre(LstCentre);
        //            //if (lstSite != null)
        //            //{
        //            //    List<CsSite> _LstSite = lstSite.Where(p => p.CODESITE != SessionObject.Enumere.Generale).ToList();
        //            //    if (_LstSite.Count == 1)
        //            //    {
        //            //        this.Txt_CodeSite.Text = _LstSite[0].CODESITE;
        //            //        this.Txt_LibelleSite.Text = _LstSite[0].LIBELLE;
        //            //        this.btn_Site.IsEnabled = false;
        //            //        this.Txt_CodeSite.IsReadOnly = true;
        //            //    }
        //            //}
        //        };
        //        service.ListeDesDonneesDesSiteAsync();
        //        service.CloseAsync();
        //    }
        //    catch (Exception ex)
        //    {
        //        Message.ShowError(ex.Message, "ChargerDonneeDuSite");

        //    }
        //}

        private void btn_ajouter_Click_1(object sender, RoutedEventArgs e)
        {
            if (CboTable.SelectedItem != null)
            {
                ServiceTarification.CsCtarcomp CsCtarcomp = new ServiceTarification.CsCtarcomp();
                CsCtarcomp.FK_IDRECHERCHETARIF        = this.csRechercheTarif.PK_ID;
                CsCtarcomp.FK_IDCONTENANTCRITERETARIF = ((CsContenantCritereTarif)CboTable.SelectionBoxItem).PK_ID;

                this.csRechercheTarif.CTARCOMP.Add(new ServiceTarification.CsCtarcomp {
                    FK_IDRECHERCHETARIF = this.csRechercheTarif.PK_ID, FK_IDCONTENANTCRITERETARIF = ((CsContenantCritereTarif)CboTable.SelectionBoxItem).PK_ID, ORDRE = byte.Parse((((List <CsCtarcomp>)dgListeRedevence.ItemsSource).Count() + 1).ToString()), DATECREATION = DateTime.Now, DATEMODIFICATION = DateTime.Now, USERCREATION = UserConnecte.matricule, USERMODIFICATION = UserConnecte.matricule, LIBELLECONTENANTCRITERETARIF = ((CsContenantCritereTarif)CboTable.SelectionBoxItem).LIBELLE
                });

                LayoutRoot.DataContext = null;
                LayoutRoot.DataContext = this.csRechercheTarif;
                InitCentreProduit();
            }
        }
        private void btn_supprimer_Click_1(object sender, RoutedEventArgs e)
        {
            var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Êtes-vous sûr de vouloir supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);

            messageBox.OnMessageBoxClosed += (_, result) =>
            {
                if (messageBox.Result == MessageBoxResult.OK)
                {
                    ServiceTarification.CsCtarcomp Ctarcomp = ((ServiceTarification.CsCtarcomp)dgListeRedevence.SelectedItem);
                    this.csRechercheTarif.CTARCOMP.Remove(Ctarcomp);

                    LayoutRoot.DataContext = null;
                    LayoutRoot.DataContext = this.csRechercheTarif;
                    InitCentreProduit();
                }
                else
                {
                    return;
                }
            };
            messageBox.Show();
        }