private void ChargerDonneeDuSite() { try { 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; lesCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre, UserConnecte.listeProfilUser); lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(lesCentre); foreach (ServiceAccueil.CsCentre item in lesCentre) { IdDesCentre.Add(item.PK_ID); } ChargerDistinctListeLotri(IdDesCentre); }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void RemplirListeDesRuesExistant() { try { if (SessionObject.LstRues != null && SessionObject.LstRues.Count != 0) { _listeDesRuesExistant = SessionObject.LstRues; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ChargerLesRueDesSecteurCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstRues = args.Result; _listeDesRuesExistant = SessionObject.LstRues; }; service.ChargerLesRueDesSecteurAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargeEquipe(string p) { try { List <Galatee.Silverlight.ServiceAccueil.CsGroupe> lstequipe = new List <Galatee.Silverlight.ServiceAccueil.CsGroupe>(); //Lancer la transaction de Mise à jour en base Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.RetourneListeGroupeCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } lstequipe = res.Result; cboEquipe.ItemsSource = lstequipe; cboEquipe.SelectedValuePath = "ID"; cboEquipe.DisplayMemberPath = "LIBELLE"; }; service1.RetourneListeGroupeAsync(UserConnecte.Centre); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDiametreCompteur() { try { if (SessionObject.LstReglageCompteur != null && SessionObject.LstReglageCompteur.Count != 0) { this.CboDIAMETRE.ItemsSource = null; this.CboDIAMETRE.DisplayMemberPath = "LIBELLE"; this.CboDIAMETRE.ItemsSource = SessionObject.LstReglageCompteur; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ChargerReglageCompteurCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstReglageCompteur = args.Result; this.CboDIAMETRE.ItemsSource = null; this.CboDIAMETRE.DisplayMemberPath = "LIBELLE"; this.CboDIAMETRE.ItemsSource = SessionObject.LstReglageCompteur; }; service.ChargerReglageCompteurAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDonneeDuSite() { try { if (SessionObject.LstCentre != null && SessionObject.LstCentre.Count != 0) { 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; }; service.ListeDesDonneesDesSiteAsync(true); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerTypeDemande() { try { if (SessionObject.LstTypeDemande != null && SessionObject.LstTypeDemande.Count != 0) { CboTypeDevis.ItemsSource = SessionObject.LstTypeDemande; CboTypeDevis.SelectedValuePath = "PK_ID"; CboTypeDevis.DisplayMemberPath = "LIBELLE"; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.RetourneOptionDemandeCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } SessionObject.LstTypeDemande = res.Result; CboTypeDevis.ItemsSource = SessionObject.LstTypeDemande; CboTypeDevis.SelectedValuePath = "PK_ID"; CboTypeDevis.DisplayMemberPath = "LIBELLE"; }; service1.RetourneOptionDemandeAsync(); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerListeDeProduit() { try { if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count != 0) { return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service1.ListeDesProduitCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } SessionObject.ListeDesProduit = res.Result; }; service1.ListeDesProduitAsync(); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerTaxe() { try { if (SessionObject.LstDesTaxe != null && SessionObject.LstDesTaxe.Count != 0) { Cbo_Taxe.ItemsSource = null; Cbo_Taxe.SelectedValuePath = "PK_ID"; Cbo_Taxe.DisplayMemberPath = "LIBELLE"; Cbo_Taxe.ItemsSource = SessionObject.LstDesTaxe.Where(c => c.DEBUTAPPLICATION <= DateTime.Now || c.FINAPPLICATION >= DateTime.Now); return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.RetourneListeTaxeCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } SessionObject.LstDesTaxe = res.Result; Cbo_Taxe.ItemsSource = null; Cbo_Taxe.SelectedValuePath = "PK_ID"; Cbo_Taxe.DisplayMemberPath = "LIBELLE"; Cbo_Taxe.ItemsSource = SessionObject.LstDesTaxe.Where(c => c.DEBUTAPPLICATION <= DateTime.Now || c.FINAPPLICATION >= DateTime.Now); }; service1.RetourneListeTaxeAsync(); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDonneeDuSite() { try { if (SessionObject.LstCentre.Count != 0) { LstCentre = SessionObject.LstCentre; LstCentrePerimetre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre); if (lstSite != null) { List <ServiceAccueil.CsSite> _LstSite = lstSite.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(); if (_LstSite.Count == 1) { this.Txt_CodeSite.Text = _LstSite[0].CODE; this.Txt_LibelleSite.Text = _LstSite[0].LIBELLE; this.btn_Site.IsEnabled = false; this.Txt_CodeSite.IsReadOnly = true; } LstCentre = LstCentrePerimetre.Where(t => t.FK_IDCODESITE == _LstSite[0].PK_ID).ToList(); if (LstCentre != null && LstCentre.Count == 1) { this.Txt_CodeCentre.Text = LstCentre.First().CODE; this.Txt_LibelleCentre.Text = LstCentre.First().LIBELLE; this.Txt_CodeCentre.Tag = LstCentre.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; LstCentre = SessionObject.LstCentre; LstCentrePerimetre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre); if (lstSite != null) { List <ServiceAccueil.CsSite> _LstSite = lstSite.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(); if (_LstSite.Count == 1) { this.Txt_CodeSite.Text = _LstSite[0].CODE; this.Txt_LibelleSite.Text = _LstSite[0].LIBELLE; this.btn_Site.IsEnabled = false; this.Txt_CodeSite.IsReadOnly = true; } } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { Message.ShowError(ex.Message, "ChargerDonneeDuSite"); } }
private void ChargerTypeDemande() { try { if (SessionObject.LstTypeDemande != null && SessionObject.LstTypeDemande.Count != 0) { return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.RetourneOptionDemandeCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } SessionObject.LstTypeDemande = res.Result; }; service1.RetourneOptionDemandeAsync(); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void RemplirCodeRegroupement() { try { if (SessionObject.LstCodeRegroupement.Count != 0) { return; } else { Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneCodeRegroupementCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstCodeRegroupement = args.Result; return; }; service.RetourneCodeRegroupementAsync(); service.CloseAsync(); } } catch (Exception ex) { throw ex; } }
private void ChargerProduit() { try { if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count > 0) { this.CboProduit.ItemsSource = SessionObject.ListeDesProduit; this.CboProduit.DisplayMemberPath = "LIBELLE"; this.CboProduit.SelectedValuePath = "PK_ID"; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ListeDesProduitCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.ListeDesProduit = args.Result; this.CboProduit.ItemsSource = SessionObject.ListeDesProduit; this.CboProduit.DisplayMemberPath = "LIBELLE"; this.CboProduit.SelectedValuePath = "PK_ID"; }; service.ListeDesProduitAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerCategorie() { try { if (SessionObject.LstCategorie != null && SessionObject.LstCategorie.Count != 0) { this.CboCATEG.ItemsSource = null; this.CboCATEG.DisplayMemberPath = "LIBELLE"; this.CboCATEG.ItemsSource = SessionObject.LstCategorie; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneCategorieCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstCategorie = args.Result; this.CboCATEG.ItemsSource = null; this.CboCATEG.DisplayMemberPath = "LIBELLE"; this.CboCATEG.ItemsSource = SessionObject.LstCategorie; }; service.RetourneCategorieAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDiametreCompteur() { try { if (SessionObject.LstCalibreCompteur != null && SessionObject.LstCalibreCompteur.Count != 0) { return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ChargerCalibreCompteurCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstCalibreCompteur = args.Result; }; service.ChargerCalibreCompteurAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerProduit() { try { if (SessionObject.ListeDesProduit != null && SessionObject.ListeDesProduit.Count != 0) { Cbo_Produit.ItemsSource = null; Cbo_Produit.DisplayMemberPath = "LIBELLE"; Cbo_Produit.ItemsSource = SessionObject.ListeDesProduit; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service1 = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.ListeDesProduitCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } SessionObject.ListeDesProduit = res.Result; Cbo_Produit.ItemsSource = null; Cbo_Produit.DisplayMemberPath = "LIBELLE"; Cbo_Produit.ItemsSource = SessionObject.ListeDesProduit; }; service1.ListeDesProduitAsync(); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void RemplirListeDesSecteur() { try { if (SessionObject.LstSecteur != null && SessionObject.LstSecteur.Count != 0) { //ListSecteur = Shared.ClasseMEthodeGenerique.RetourneListCopy<ServiceAccueil.CsSecteur>(SessionObject.LstSecteur); return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ChargerLesSecteursAsync(); service.ChargerLesSecteursCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstSecteur = args.Result; //ListSecteur = Shared.ClasseMEthodeGenerique.RetourneListCopy<ServiceAccueil.CsSecteur>(SessionObject.LstSecteur); }; service.CloseAsync(); } catch (Exception ex) { throw ex; } }
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.Count == 1) { this.Txt_CodeSite.Text = lstSite.First().CODE; this.Txt_LibelleSite.Text = lstSite.First().LIBELLE; this.Txt_CodeSite.Tag = lstSite.First().CODE; this.btn_Site.IsEnabled = false; } if (LstCentrePerimetre.Count == 1) { this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().LIBELLE; lstCentreSelect.Add(LstCentrePerimetre.First()); this.Cbo_Centre.ItemsSource = null; this.Cbo_Centre.ItemsSource = lstCentreSelect; this.Cbo_Centre.DisplayMemberPath = "LIBELLE"; } else { this.Txt_LibelleCentre.Visibility = System.Windows.Visibility.Collapsed; this.Cbo_Centre.Visibility = System.Windows.Visibility.Visible; } 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; List <Galatee.Silverlight.ServiceAccueil.CsCentre> LstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); List <Galatee.Silverlight.ServiceAccueil.CsSite> lstSite = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentre) { lesCentreCaisse.Add(item.PK_ID); } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
//private void OKButton_Click(object sender, RoutedEventArgs e) //{ // this.DialogResult = true; //} //private void CancelButton_Click(object sender, RoutedEventArgs e) //{ // this.DialogResult = false; //} private void ChargerDonneeDuSite() { try { if (SessionObject.LstCentre.Count != 0) { LstCentre = SessionObject.LstCentre; cbo_centreCible.ItemsSource = LstCentre; cbo_centreCible.DisplayMemberPath = "LIBELLE"; cbo_centreCible.SelectedValuePath = "PK_ID"; lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); if (lstSite != null) { List <Galatee.Silverlight.ServiceAccueil.CsSite> _LstSite = lstSite.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(); if (_LstSite.Count > 0) { cbo_Site.ItemsSource = _LstSite; cbo_Site.DisplayMemberPath = "LIBELLE"; cbo_Site.SelectedValuePath = "CODE"; } } 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; cbo_centreCible.ItemsSource = LstCentre; cbo_centreCible.DisplayMemberPath = "CODECENTRE"; cbo_centreCible.SelectedValuePath = "PK_ID"; lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); if (lstSite != null) { List <Galatee.Silverlight.ServiceAccueil.CsSite> _LstSite = lstSite.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(); if (_LstSite.Count > 0) { cbo_Site.ItemsSource = _LstSite; cbo_Site.DisplayMemberPath = "LIBELLE"; cbo_Site.SelectedValuePath = "CODE"; } } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { Message.ShowError(ex.Message, "ChargerDonneeDuSite"); } }
private void RemplirCommune() { try { if (_listeDesCommuneInitiale != null && _listeDesCommuneInitiale.Count != 0) { Cbo_Commune.ItemsSource = _listeDesCommuneInitiale.OrderBy(t => t.LIBELLE).ToList(); Cbo_Commune.IsEnabled = true; Cbo_Commune.SelectedValuePath = "PK_ID"; Cbo_Commune.DisplayMemberPath = "LIBELLE"; return; } Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.ChargerCommuneAsync(); service.ChargerCommuneCompleted += (s, args) => { if (args.Error != null && args.Cancelled) { return; } _listeDesCommuneInitiale.Clear(); List <CsCommune> _listeDesCommuneExistant = new List <CsCommune>(); CsCommune st = null; foreach (ServiceAccueil.CsCommune item in args.Result) { st = new CsCommune(); st.PK_ID = item.PK_ID; st.CODE = item.CODE; st.LIBELLE = item.LIBELLE; _listeDesCommuneExistant = _listeDesCommuneInitiale.Where(t => t.LIBELLE == st.LIBELLE).ToList(); if (_listeDesCommuneExistant == null || _listeDesCommuneExistant.Count == 0) { _listeDesCommuneInitiale.Add(st); } } Cbo_Commune.ItemsSource = _listeDesCommuneInitiale.OrderBy(t => t.LIBELLE).ToList(); Cbo_Commune.IsEnabled = true; Cbo_Commune.SelectedValuePath = "PK_ID"; Cbo_Commune.DisplayMemberPath = "LIBELLE"; if (ObjetSelectionnee != null && ObjetSelectionnee.FK_IDCOMMUNE > 0) { Cbo_Commune.SelectedItem = _listeDesCommuneInitiale.FirstOrDefault(t => t.PK_ID == ObjetSelectionnee.FK_IDCOMMUNE); } }; service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDonneeDuSite() { try { if (SessionObject.LstCentre != null && SessionObject.LstCentre.Count > 0) { ListeCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODESITE != SessionObject.Enumere.CodeSiteScaBT && p.CODESITE != SessionObject.Enumere.CodeSiteScaMT).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(ListeCentre); ServiceAccueil.CsSite AgenceCentral = lstSite.FirstOrDefault(t => t.CODE == SessionObject.Enumere.Generale); if (AgenceCentral != null) { AgenceCentral.LIBELLE = "AGENCE CENTRALE"; } foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in ListeCentre.Where(p => p.CODESITE != SessionObject.Enumere.CodeSiteScaMT && p.CODESITE != SessionObject.Enumere.CodeSiteScaBT).ToList()) { lesCentrePerimetre.Add(item.PK_ID); } if (AgenceCentral != null) { ServiceAccueil.CsCentre leCentreAgenceGeneral = ListeCentre.FirstOrDefault(o => o.CODE == SessionObject.Enumere.Generale); leCentreAgenceGeneral.LIBELLE = "AGENCE CENTRALE"; List <string> lstCodeAgGnral = ListeCentre.Where(t => t.CODESITE == SessionObject.Enumere.Generale && t.CODE != SessionObject.Enumere.Generale).Select(u => u.CODE).ToList(); ListeCentre = ListeCentre.Where(t => !lstCodeAgGnral.Contains(t.CODE)).ToList(); } 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; ListeCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(ListeCentre); foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in ListeCentre) { lesCentrePerimetre.Add(item.PK_ID); } ServiceAccueil.CsSite AgenceCentral = lstSite.FirstOrDefault(t => t.CODE == SessionObject.Enumere.Generale); if (AgenceCentral != null) { AgenceCentral.LIBELLE = "AGENCE CENTRALE"; } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
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; } }
private void ChargerDonneeDuSite() { try { List <int> lstCentreSelect = new List <int>(); 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 = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre); if (lstSite.Count == 1) { this.Txt_LibelleSite.Text = lstSite.First().LIBELLE; this.btn_Site.Tag = lstSite.First().CODE; ChargerPiaAgence(lstSite.First().CODE); this.btn_Site.IsEnabled = false; } if (LstCentrePerimetre.Count == 1) { this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().LIBELLE; this.btn_Centre.IsEnabled = false; } 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 = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentrePerimetre); if (lstSite.Count == 1) { this.Txt_LibelleSite.Text = lstSite.First().LIBELLE; ChargerPiaAgence(lstSite.First().CODE); this.btn_Site.Tag = lstSite.First().CODE; this.btn_Site.IsEnabled = false; } if (LstCentrePerimetre.Count == 1) { this.Txt_LibelleCentre.Text = LstCentrePerimetre.First().LIBELLE; this.btn_Centre.IsEnabled = false; } return; }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDonneeDuSite() { try { if (SessionObject.LstCentre.Count != 0) { LstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre, UserConnecte.listeProfilUser); lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre, SessionObject.LstCentre); if (lstSite.Count == 1) { this.txt_Site.Text = lstSite.First().LIBELLE; this.txt_Site.Tag = lstSite.First().PK_ID; this.Txt_Centre.IsReadOnly = false; this.Txt_Client.IsReadOnly = false; this.Txt_produit.IsReadOnly = false; this.Cbo_Compteur.IsEnabled = true; } if (LstCentre.Count == 1) { this.Txt_Centre.Text = LstCentre.First().CODE; this.Txt_Centre.IsReadOnly = true; } 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; LstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre, UserConnecte.listeProfilUser); lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre, SessionObject.LstCentre); if (lstSite.Count == 1) { this.txt_Site.Text = lstSite.First().LIBELLE; this.txt_Site.Tag = lstSite.First().PK_ID; this.Txt_Centre.IsReadOnly = false; this.Txt_Client.IsReadOnly = false; this.Txt_produit.IsReadOnly = false; this.Cbo_Compteur.IsEnabled = true; } return; }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { Message.ShowError(ex.Message, "ChargerDonneeDuSite"); } }
private void ChargerCentre() { try { List <int> lstIdCentre = new List <int>(); if (SessionObject.LstCentre.Count != 0) { LstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentre) { lstIdCentre.Add(item.PK_ID); } return; } //Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new AccesServiceWCF().GetAcceuilClient(); 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 = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(), UserConnecte.listeProfilUser); lstSite = ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentre) { lstIdCentre.Add(item.PK_ID); } if (lstSite != null) { List <Galatee.Silverlight.ServiceAccueil.CsSite> _LstSite = lstSite.Where(p => p.CODE != SessionObject.Enumere.Generale).ToList(); if (_LstSite.Count == 1) { } } if (LstCentre != null) { List <Galatee.Silverlight.ServiceAccueil.CsCentre> _LstCentre = LstCentre.Where(p => p.CODESITE != SessionObject.Enumere.Generale).ToList(); if (_LstCentre.Count == 1) { } } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { Message.ShowError(ex.Message, "LoadCentre"); } }
private void ChargerDonneeDuSite() { try { 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; this.btn_Centre.IsEnabled = true; LstCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre, UserConnecte.listeProfilUser); lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(LstCentre); foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in LstCentre) { lstIdCentre.Add(item.PK_ID); } if (lstSite != null) { if (lstSite.Count == 1) { this.Txt_CodeSite.Text = lstSite[0].CODE; this.Txt_LibelleSite.Text = lstSite[0].LIBELLE; this.btn_Site.IsEnabled = false; this.Txt_CodeSite.Tag = lstSite.First().PK_ID; this.Txt_CodeSite.IsReadOnly = true; } } if (LstCentre != null) { if (LstCentre.Count == 1) { this.Txt_CodeCentre.Text = LstCentre[0].CODESITE; this.Txt_CodeCentre.Tag = LstCentre[0].PK_ID; this.Txt_LibelleCentre.Text = LstCentre[0].LIBELLE; this.btn_Centre.IsEnabled = false; this.Txt_CodeCentre.IsReadOnly = true; } } RetournePoste(lstIdCentre); RetourneListeCaisse(lstIdCentre); }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerDonneeDuSite() { try { 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; lesCentre = Shared.ClasseMEthodeGenerique.RetourCentreByPerimetre(SessionObject.LstCentre, UserConnecte.listeProfilUser); lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(lesCentre); if (lstSite.Count == 1) { this.Txt_Site.Text = lstSite.First().CODE; txt_LibelleSite.Text = lstSite.First().LIBELLE; this.Txt_Site.Tag = lstSite.First().PK_ID; this.btn_Site.IsEnabled = false; } else { this.btn_Site.IsEnabled = true; } if (lesCentre.Count == 1) { this.Txt_Centre.Text = lesCentre.First().CODE; txt_libellecentre.Text = lesCentre.First().LIBELLE; this.Txt_Centre.Tag = lesCentre.First().PK_ID; this.btn_Centre.IsEnabled = false; } else { this.btn_Centre.IsEnabled = true; } foreach (ServiceAccueil.CsCentre item in lesCentre) { IdDesCentre.Add(item.PK_ID); } Chargelotri(IdDesCentre); }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
public void retourneCentre() { try { if (SessionObject.LstCentre != null && SessionObject.LstCentre.Count != 0) { List <ServiceAccueil.CsSite> lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(SessionObject.LstCentre); Cbo_Site.ItemsSource = lstSite; Cbo_Site.DisplayMemberPath = "LIBELLE"; if (lePosteModif != null) { isChargement = true; ServiceAccueil.CsCentre leC = SessionObject.LstCentre.FirstOrDefault(t => t.PK_ID == lePosteModif.FK_IDCENTRE); if (leC != null && !string.IsNullOrEmpty(leC.CODE)) { Cbo_Site.SelectedItem = lstSite.FirstOrDefault(t => t.PK_ID == leC.FK_IDCODESITE); } } 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; List <ServiceAccueil.CsSite> lstSite = Shared.ClasseMEthodeGenerique.RetourneSiteByCentre(SessionObject.LstCentre); Cbo_Site.ItemsSource = null; Cbo_Site.ItemsSource = lstSite; Cbo_Site.DisplayMemberPath = "LIBELLE"; if (lePosteModif != null) { isChargement = true; ServiceAccueil.CsCentre leC = SessionObject.LstCentre.FirstOrDefault(t => t.PK_ID == lePosteModif.FK_IDCENTRE); if (leC != null && !string.IsNullOrEmpty(leC.CODE)) { Cbo_Site.SelectedItem = lstSite.FirstOrDefault(t => t.PK_ID == leC.FK_IDCODESITE); } } }; service.ListeDesDonneesDesSiteAsync(false); service.CloseAsync(); } catch (Exception) { throw; } }
private void ChargerCoper() { Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneTousCoperCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } SessionObject.LstDesCopers = args.Result; }; service.RetourneTousCoperAsync(); service.CloseAsync(); }
//private void ChargerTournee() //{ // int handler = LoadingManager.BeginLoading("Recuperation des tournées ..."); // Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); // service.ChargerLesTourneesCompleted += (s, args) => // { // if (args != null && args.Cancelled) // return; // SessionObject.LstZone = args.Result; // if (args.Cancelled || args.Error != null) // { // Message.ShowInformation("Erreur d'invocation du service !", Galatee.Silverlight.Resources.Langue.wcf_error); // LoadingManager.EndLoading(handler); // return; // } // if (args.Result == null | args.Result.Count == 0) // { // Message.ShowInformation("Aucune donnée retournée du système ! ", Galatee.Silverlight.Resources.Langue.errorTitle); // LoadingManager.EndLoading(handler); // return; // } // btnzone.IsEnabled = true ; // btnController .IsEnabled = true ; // LoadingManager.EndLoading(handler); // }; // service.ChargerLesTourneesAsync (); // service.CloseAsync(); //} private void ChargerCodeConso() { try { int handler___ = LoadingManager.BeginLoading("Récupération des codes consommateur..."); Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneCodeConsomateurCompleted += (s, args) => { try { if (args != null && args.Cancelled) { return; } SessionObject.LstCodeConsomateur = args.Result; //ListeCodeConsomateur= Utility.ConvertListType<CsCodeConsomateur , Galatee.Silverlight.ServiceAccueil.CsCodeConsomateur >(SessionObject.LstCodeConsomateur); ListeCodeConsomateur = SessionObject.LstCodeConsomateur; btn_CodeConso.IsEnabled = true; if (args.Cancelled || args.Error != null) { Message.ShowError("Erreur d'invocation du service. Réessayer svp! ", Galatee.Silverlight.Resources.Langue.wcf_error); LoadingManager.EndLoading(handler___); return; } if (args.Result == null | args.Result.Count == 0) { Message.ShowInformation("Aucune donnée retournée du service. Réessayer svp! ", Galatee.Silverlight.Resources.Langue.errorTitle); LoadingManager.EndLoading(handler___); return; } LoadingManager.EndLoading(handler___); } catch (Exception e) { LoadingManager.EndLoading(handler___); throw e; } }; service.RetourneCodeConsomateurAsync(); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void Btn_Recherche_Click(object sender, RoutedEventArgs e) { this.Txt_NouvIndex.Text = string.Empty; this.Txt_AncIndex.Text = string.Empty; this.Cbo_Compteur.SelectedItem = null; this.Txt_NomAbon.Text = string.Empty; if (this.Txt_CodeCentre.Tag != null && !string.IsNullOrEmpty(this.Txt_PeriodeEnCour.Text)) { int idcentre = int.Parse(this.Txt_CodeCentre.Tag.ToString()); ServiceAccueil.CsClient leClient = new ServiceAccueil.CsClient(); leClient.CENTRE = Txt_CodeCentre.Text; leClient.REFCLIENT = this.txtClient.Text; leClient.PRODUIT = this.Txt_Produit.Tag.ToString(); leClient.FK_IDCENTRE = idcentre; string OrdreMax = string.Empty; Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient service = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneOrdreMaxCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } OrdreMax = args.Result; if (OrdreMax != null) { leClient.ORDRE = OrdreMax; this.txtOrdre.Text = OrdreMax; //RetourneInfoClient(leClient); VerifieExisteDemande(leClient); } else { Message.ShowInformation("Abonnement non trouvé", "Facturation"); return; } }; service.RetourneOrdreMaxAsync(leClient.FK_IDCENTRE.Value, leClient.CENTRE, leClient.REFCLIENT, leClient.PRODUIT); service.CloseAsync(); } else { Message.ShowInformation("Saisir la période à modifier", "Facturation"); return; } }