private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Txt_CodeSite.Text) && Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre)
                {
                    Galatee.Silverlight.ServiceAccueil.CsSite _LeSiteClient = ClasseMEthodeGenerique.RetourneObjectFromList(lstSite, this.Txt_CodeSite.Text, "CODE");
                    if (!string.IsNullOrEmpty(_LeSiteClient.LIBELLE))
                    {
                        this.Txt_LibelleSite.Text = _LeSiteClient.LIBELLE;
                        this.Txt_CodeSite.Text    = _LeSiteClient.CODE;
                        this.Txt_CodeSite.Tag     = _LeSiteClient.PK_ID;
                        List <int> lstCentreSelect = new List <int>();

                        List <ServiceAccueil.CsCentre> lsiteCentre = LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_CodeSite.Tag).ToList();
                        if (lsiteCentre.Count == 1)
                        {
                            lstCentreSelect.Add(lsiteCentre.First().PK_ID);
                            this.Txt_CodeCentre.Text    = lsiteCentre.First().CODE;
                            this.Txt_LibelleCentre.Text = lsiteCentre.First().LIBELLE;
                            this.Txt_CodeCentre.Tag     = lstCentreSelect;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, "Facturation");
            }
        }
 void galatee_OkClickedSite(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
         this.Txt_LibelleSite.Text = leSite.LIBELLE;
         this.Txt_LibelleSite.Tag  = leSite.PK_ID;
         lSiteSelect = leSite;
         List <ServiceAccueil.CsCentre> lsiteCentre = LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_LibelleSite.Tag).ToList();
         if (lsiteCentre.Count == 1)
         {
             this.Txt_LibelleCentre.Text = lsiteCentre.First().LIBELLE;
             this.Txt_LibelleCentre.Tag  = lsiteCentre.First();
             lProduitSelect            = lsiteCentre.First().LESPRODUITSDUSITE;
             this.btn_Centre.IsEnabled = true;
         }
         else
         {
             this.Txt_LibelleCentre.Text = string.Empty;
             this.Txt_LibelleCentre.Tag  = null;
             this.btn_Centre.IsEnabled   = true;
         }
     }
     this.btn_Site.IsEnabled = true;
 }
Beispiel #3
0
        void ctr_ClosedCtr(object sender, EventArgs e)
        {
            this.IsEnabled = true;
            UcListeGenerique ctrs = sender as UcListeGenerique;

            if (ctrs.isOkClick)
            {
                this.Txt_CodeCentre.Text     = string.Empty;
                this.Txt_LibelleCentre1.Text = string.Empty;
                this.Txt_CodeCentre.Tag      = null;
                Galatee.Silverlight.ServiceAccueil.CsSite _LeSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
                this.Txt_CodeSite.Text = _LeSite.CODE;
                this.Txt_CodeSite.Tag  = _LeSite.PK_ID;
                LstCentre = SessionObject.LstCentre.Where(t => t.FK_IDCODESITE == _LeSite.PK_ID).ToList();
                if (LstCentre != null && LstCentre.Count == 1)
                {
                    this.Txt_CodeCentre.Text = LstCentre.First().CODE;
                    LstDeProduit             = LstCentre.First().LESPRODUITSDUSITE;

                    if (LstDeProduit != null && LstDeProduit.Count == 1)
                    {
                        this.Txt_CodeProduit.Text    = LstDeProduit.First().CODE;
                        this.Txt_CodeProduit.Tag     = LstDeProduit.First().PK_ID;
                        this.Txt_LibelleProduit.Text = LstDeProduit.First().LIBELLE;
                    }
                }
            }
        }
        private void ChargerDonneeDuSite()
        {
            try
            {
                if (SessionObject.LstCentre != null && SessionObject.LstCentre.Count > 0)
                {
                    LstCentrePerimetre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser);
                    lstSite            = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre);
                    foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentrePerimetre)
                    {
                        lesCentreCaisse.Add(item.PK_ID);
                    }

                    if (lstSite != null && lstSite.Count != 0)
                    {
                        if (lstSite.Count == 1)
                        {
                            lSiteSelect = lstSite.First();
                            this.Txt_LibelleSite.Text = lSiteSelect.LIBELLE;
                            this.Txt_LibelleSite.Tag  = lSiteSelect.PK_ID;
                            lProduit = LstCentrePerimetre.FirstOrDefault(t => t.FK_IDCODESITE == (int)this.Txt_LibelleSite.Tag).LESPRODUITSDUSITE.First();
                        }
                    }
                    return;
                }
                Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
                service.ListeDesDonneesDesSiteCompleted += (s, args) =>
                {
                    if (args != null && args.Cancelled)
                    {
                        return;
                    }
                    SessionObject.LstCentre = args.Result;
                    LstCentrePerimetre      = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser);
                    lstSite = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre);
                    foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentrePerimetre)
                    {
                        lesCentreCaisse.Add(item.PK_ID);
                    }
                    if (lstSite != null && lstSite.Count != 0)
                    {
                        if (lstSite.Count == 1)
                        {
                            lSiteSelect = lstSite.First();
                            this.Txt_LibelleSite.Text = lstSite.First().LIBELLE;
                        }
                    }
                };
                service.ListeDesDonneesDesSiteAsync(false);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 void galatee_OkClickedSite(object sender, EventArgs e)
 {
     lSiteSelect = new ServiceAccueil.CsSite();
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
         this.Txt_LibelleSite.Text = leSite.LIBELLE;
         this.Txt_LibelleSite.Tag  = leSite.PK_ID;
         lSiteSelect = leSite;
     }
     this.btn_Site.IsEnabled = true;
 }
Beispiel #6
0
 void galatee_OkClickedSite(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
         this.Txt_LibelleSite.Text = leSite.LIBELLE;
         this.Txt_LibelleSite.Tag  = leSite.PK_ID;
         lSiteSelect = leSite;
         lProduit    = LstCentrePerimetre.FirstOrDefault(t => t.FK_IDCODESITE == (int)this.Txt_LibelleSite.Tag).LESPRODUITSDUSITE.First();
     }
     this.btn_Site.IsEnabled = true;
 }
Beispiel #7
0
        private void galatee_OkClickedSite(object sender, EventArgs e)
        {
            Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
            if (ctrs.isOkClick)
            {
                this.btn_Site.IsEnabled = true;
                Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
                this.Txt_CodeSite.Text    = leSite.CODE;
                this.Txt_CodeSite.Tag     = leSite.PK_ID;
                this.Txt_LibelleSite.Text = leSite.LIBELLE;

                this.Txt_CodeCentre.IsReadOnly = true;
                this.btn_Centre.IsEnabled      = true;
            }
        }
 private void Site_OkClicked(object sender, EventArgs e)
 {
     try
     {
         UcListeGenerique ctrs = sender as UcListeGenerique;
         if (ctrs.isOkClick)
         {
             Galatee.Silverlight.ServiceAccueil.CsSite _LeSiteSelect = ctrs.MyObject as Galatee.Silverlight.ServiceAccueil.CsSite;
             this.Txt_Site.Text        = string.IsNullOrEmpty(_LeSiteSelect.CODE) ? string.Empty : _LeSiteSelect.CODE;
             this.Txt_LibelleSite.Text = string.IsNullOrEmpty(_LeSiteSelect.LIBELLE) ? string.Empty : _LeSiteSelect.LIBELLE;
             LstCentre = SessionObject.LstCentre.Where(t => t.FK_IDCODESITE == _LeSiteSelect.PK_ID).ToList();
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, "Erreur");
     }
 }
Beispiel #9
0
 private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(Txt_CodeSite.Text) && Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre)
         {
             Galatee.Silverlight.ServiceAccueil.CsSite _LeSiteClient = lstSite.FirstOrDefault(t => t.CODE == this.Txt_CodeSite.Text);
             if (!string.IsNullOrEmpty(_LeSiteClient.LIBELLE))
             {
                 this.Txt_LibelleSite.Text = _LeSiteClient.LIBELLE;
                 LstCentre = SessionObject.LstCentre.Where(t => t.FK_IDCODESITE == _LeSiteClient.PK_ID).ToList();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, "Tarification");
     }
 }
Beispiel #10
0
 private void Txt_CodeSite_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(Txt_CodeSite.Text) && Txt_CodeSite.Text.Length == SessionObject.Enumere.TailleCentre)
         {
             Galatee.Silverlight.ServiceAccueil.CsSite _LeSiteClient = Shared.ClasseMEthodeGenerique.RetourneObjectFromList(lstSite, this.Txt_CodeSite.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeSiteClient.LIBELLE))
             {
                 this.Txt_LibelleSite.Text = _LeSiteClient.LIBELLE;
                 this.Txt_CodeSite.Text    = _LeSiteClient.CODE;
                 this.Txt_CodeSite.Tag     = _LeSiteClient.PK_ID;
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, "Facturation");
     }
 }
        void galatee_OkClickedCentre(object sender, EventArgs e)
        {
            Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
            if (ctrs.isOkClick)
            {
                this.btn_Centre.IsEnabled = true;
                Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
                this.txt_Site.Text = leSite.LIBELLE;
                this.txt_Site.Tag  = leSite.PK_ID;

                this.Txt_Centre.IsReadOnly  = false;
                this.Txt_Client.IsReadOnly  = false;
                this.Txt_produit.IsReadOnly = false;
                this.Cbo_Compteur.IsEnabled = true;
            }
            else
            {
                this.btn_Centre.IsEnabled = true;
            }
        }
 void galatee_OkClickedSite(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         this.btn_Site.IsEnabled = true;
         Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
         this.Txt_CodeSite.Text    = leSite.CODE;
         this.Txt_CodeSite.Tag     = leSite.PK_ID;
         this.Txt_LibelleSite.Text = leSite.LIBELLE;
         List <ServiceAccueil.CsCentre> lsiteCentre = LstCentrePerimetre.Where(t => t.FK_IDCODESITE == (int)this.Txt_CodeSite.Tag).ToList();
         if (lsiteCentre.Count == 1)
         {
             this.Txt_CodeCentre.Text    = lsiteCentre.First().CODE;
             this.Txt_LibelleCentre.Text = lsiteCentre.First().LIBELLE;
             this.Txt_CodeCentre.Tag     = lsiteCentre.First().PK_ID;
         }
     }
     this.btn_Site.IsEnabled = true;
 }
Beispiel #13
0
        void galatee_OkClickedSite(object sender, EventArgs e)
        {
            lstCentreSelect.Clear();
            Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
            if (ctrs.isOkClick)
            {
                this.btn_Site.IsEnabled = true;
                Galatee.Silverlight.ServiceAccueil.CsSite leSite = (Galatee.Silverlight.ServiceAccueil.CsSite)ctrs.MyObject;
                this.Txt_CodeSite.Text    = leSite.CODE;
                this.Txt_CodeSite.Tag     = leSite.CODE;
                this.Txt_LibelleSite.Text = leSite.LIBELLE;
                List <ServiceAccueil.CsCentre> lsiteCentre = LstCentrePerimetre.Where(t => t.CODESITE == this.Txt_CodeSite.Tag.ToString()).ToList();
                if (lsiteCentre.Count == 1)
                {
                    this.Txt_LibelleCentre.Text       = LstCentrePerimetre.First().LIBELLE;
                    this.Txt_LibelleCentre.Visibility = System.Windows.Visibility.Visible;
                    this.btn_Centre.Visibility        = System.Windows.Visibility.Visible;
                    this.Txt_LibelleCentre.Visibility = System.Windows.Visibility.Visible;


                    lstCentreSelect.AddRange(lsiteCentre);
                    this.Cbo_Centre.ItemsSource       = null;
                    this.Cbo_Centre.DisplayMemberPath = "LIBELLE";
                    this.Cbo_Centre.ItemsSource       = lstCentreSelect;
                    this.Cbo_Centre.SelectedItem      = lsiteCentre;
                    this.Cbo_Centre.Visibility        = System.Windows.Visibility.Collapsed;
                }
                else
                {
                    this.btn_Centre.Visibility        = System.Windows.Visibility.Visible;
                    this.Txt_LibelleCentre.Visibility = System.Windows.Visibility.Collapsed;
                    this.Cbo_Centre.Visibility        = System.Windows.Visibility.Visible;
                }
            }
            else
            {
                this.btn_Site.IsEnabled = true;
            }
        }
        private void ChargerDonneeDuSite()
        {
            try
            {
                if (SessionObject.LstCentre != null && SessionObject.LstCentre.Count > 0)
                {
                    LstCentrePerimetre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser);
                    lstSite            = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre);
                    if (lstSite != null && lstSite.Count != 0)
                    {
                        if (lstSite.Count == 1)
                        {
                            lSiteSelect = lstSite.First();
                            this.Txt_LibelleSite.Text = lstSite.First().LIBELLE;
                        }
                    }
                    if (LstCentrePerimetre.Count == 1)
                    {
                        this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().CODE;
                        this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().LIBELLE;
                        this.Txt_LibelleCentre.Tag  = LstCentrePerimetre.First().PK_ID;
                        lstCentre.Add(LstCentrePerimetre.First().PK_ID);
                    }
                    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;
                    LstCentrePerimetre      = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser);
                    lstSite = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre);

                    if (lstSite != null && lstSite.Count != 0)
                    {
                        if (lstSite.Count == 1)
                        {
                            lSiteSelect = lstSite.First();
                            this.Txt_LibelleSite.Text = lstSite.First().LIBELLE;
                        }
                    }
                    if (LstCentrePerimetre != null && LstCentrePerimetre.Count != 0)
                    {
                        if (LstCentrePerimetre.Count == 1)
                        {
                            this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().LIBELLE;
                            this.Txt_LibelleCentre.Tag  = LstCentrePerimetre.First().PK_ID;
                            lstCentre.Add(LstCentrePerimetre.First().PK_ID);
                            this.btn_Centre.IsEnabled = false;
                        }
                    }
                };
                service.ListeDesDonneesDesSiteAsync(false);
                service.CloseAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }