private void UpdateReleveur(CsReleveur LeReleveur) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.UpdateUnReleveurCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de la mise à jour du releveur.Réessayer svp!", "Erreur"); return; } if (args.Result == false) { Message.ShowError("Erreur d'insertion du releveur.Réessayer svp!", "Information"); return; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.UpdateUnReleveurAsync(LeReleveur); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void DefacturationLot(List <CsLotri> ListLotSelect) { int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours); try { CsStatFacturation _laStat = new CsStatFacturation(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.DefacturerLotCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } _laStat = args.Result; if (_laStat != null) { Message.Show("Nombre de client :" + _laStat.NombreCalcule + "\r\n Montant défacturé : " + decimal.Parse(_laStat.Montant.ToString()).ToString("N2"), "Statistique"); } this.OKButton.IsEnabled = true; LoadingManager.EndLoading(res); this.DialogResult = false; }; service.DefacturerLotAsync(ListLotSelect, Action); service.CloseAsync(); } catch (Exception ex) { LoadingManager.EndLoading(res); throw ex; } }
private void MiseAJourEvent(List <CsEvenement> lstEvenement) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetirerClientLotFactCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == true) { Message.ShowInformation("Client retiré du lot", Langue.LibelleModule); chk_Tournee.IsChecked = true; btnRechercher_Click(null, null); } else { Message.ShowInformation("Une erreur est survenue lors de la mise a jour", Langue.LibelleModule); return; } }; service.RetirerClientLotFactAsync(lstEvenement); service.CloseAsync(); }
private void ChargerLotriPourCalcul(Dictionary <string, List <int> > lstSiteCentre, bool IsFacturationCourante, string Periode) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerLotriPourCalculCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null || args.Result.Count == 0) { return; } this.btn_Batch.IsEnabled = true; ListeLotri = args.Result; lstLot = ListeLotri; }; service.ChargerLotriPourCalculAsync(lstSiteCentre, UserConnecte.matricule, IsFacturationCourante, Periode); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void RetourneAnnomalie(List <CsFactureBrut> leResultatFacturationbrut) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneLesteAnomalieCompleted += (s, args) => { if (args != null && args.Cancelled) { Message.Show(Langue.msgErrorFact, Langue.LibelleModule); return; } if (args == null && args.Cancelled) { Message.Show(Langue.msgErrorFact, Langue.LibelleModule); return; } if (args.Result.Count != 0) { string print = "Imprimé le " + DateTime.Now + " sur le poste " + SessionObject.LePosteCourant.NOMPOSTE + " par " + UserConnecte.nomUtilisateur + "(" + UserConnecte.matricule + ") du centre " + UserConnecte.LibelleCentre; Dictionary <string, string> param = new Dictionary <string, string>(); param.Add("Print", print); //Utility.ActionDirectOrientation<ServicePrintings.CsAnnomalie, ServiceFacturation.CsAnnomalie>(args.Result, new Dictionary<string, string>(), SessionObject.CheminImpression, "AnomalieFacturation", "Facturation", true); Utility.ActionDirectOrientation <ServicePrintings.CsAnnomalie, ServiceFacturation.CsAnnomalie>(args.Result, param, SessionObject.CheminImpression, "AnomalieFacturation", "Facturation", true); } }; service.RetourneLesteAnomalieAsync(leResultatFacturationbrut.First().LOTRI, leResultatFacturationbrut.First().FK_IDCENTRE); service.CloseAsync(); }
private void ValiderEnqute(List <CsEvenement> lstEnqueteConfirme) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ValiderEnqueteCompleted += (s, args) => { try { if (args.Error != null && args.Cancelled) { Message.ShowError("Erreur survenue lors du traitement", "Erreur"); return; } Message.ShowInformation(Langue.MsgEnqueteValider, Langue.libelleModule); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.ValiderEnqueteAsync(lstEnqueteConfirme); } catch (Exception ex) { throw ex; } }
private void RetourneAnnomalie(List <CsFactureBrut> leResultatFacturationbrut) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneLesteAnomalieCompleted += (s, args) => { if (args != null && args.Cancelled) { Message.Show(Langue.msgErrorFact, Langue.LibelleModule); return; } if (args == null && args.Cancelled) { Message.Show(Langue.msgErrorFact, Langue.LibelleModule); return; } if (args.Result.Count != 0) { Dictionary <string, string> param = new Dictionary <string, string>(); Utility.ActionDirectOrientation <ServicePrintings.CsAnnomalie, ServiceFacturation.CsAnnomalie>(args.Result, new Dictionary <string, string>(), SessionObject.CheminImpression, "AnomalieFacturation", "Facturation", true); } }; service.RetourneLesteAnomalieAsync(leResultatFacturationbrut.First().LOTRI, leResultatFacturationbrut.First().FK_IDCENTRE); service.CloseAsync(); }
private void EditerListeCasDuLot(string Lotri, string LeCentre, string LaTournee, List <CsCasind> ListCas) { try { string key = Utility.getKey(); List <CsCasind> ListDesCasDuLot = new List <CsCasind>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.EditerListeDesCasCompleted += (s, args) => { try { if (args.Error != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel serveur", "Erreur"); return; } Utility.ActionImpressionDirect(SessionObject.CheminImpression, key, "EtatListeDesCas", "Index"); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.EditerListeDesCasAsync(Lotri, LeCentre, LaTournee, ListCas, key); } catch (Exception ex) { throw ex; } }
private void DefacturationLot(List <CsLotri> ListLotSelect) { int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours); try { CsStatFacturation _laStat = new CsStatFacturation(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.DemandeDefacturerLotAsync(ListLotSelect); service.DemandeDefacturerLotCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == true) { Message.Show("Demande de défacturation effectuée avec succès", "facturation"); } else { Message.Show("Une erreur s'est produite lors de la demande ", "facturation"); } LoadingManager.EndLoading(res); this.DialogResult = true; }; service.CloseAsync(); } catch (Exception ex) { LoadingManager.EndLoading(res); throw ex; } }
private void btn_AfficherAnnomalie_Click(object sender, RoutedEventArgs e) { if (dataGridlLot.SelectedItem != null) { CsLotri SelectedObject = (CsLotri)dataGridlLot.SelectedItem; List <CsAnnomalie> ListeAnnomalie = new List <CsAnnomalie>(); FacturationServiceClient service = new FacturationServiceClient(Utility.Protocole(), Utility.EndPoint("Facturation")); service.RetourneControleFacturesCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } ListeAnnomalie = args.Result; if (ListeAnnomalie == null || ListeAnnomalie.Count == 0) { return; } this.dataGrid1.ItemsSource = null; this.dataGrid1.ItemsSource = ListeAnnomalie; }; service.RetourneControleFacturesAsync(SelectedObject); service.CloseAsync(); } }
private void RejeterDefacturationLot(List <CsLotri> ListLotSelect) { int res = LoadingManager.BeginLoading(Galatee.Silverlight.Resources.Accueil.Langue.En_Cours); try { CsStatFacturation _laStat = new CsStatFacturation(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ValiderRejetDefacturationCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result) { Message.Show(Galatee.Silverlight.Resources.Facturation.Langue.msgRejetDefacturation, Galatee.Silverlight.Resources.Facturation.Langue.LibelleModule); } this.OKButton.IsEnabled = true; LoadingManager.EndLoading(res); this.DialogResult = false; }; service.ValiderRejetDefacturationAsync(ListLotSelect, Action); service.CloseAsync(); } catch (Exception ex) { LoadingManager.EndLoading(res); throw ex; } }
private void ChargerLotriAll(List <int> idCentre) { try { ListeLotri = new List <CsLotri>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerLotriDejaMiseAJourCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } ListeLotri = args.Result; if (ListeLotri == null || ListeLotri.Count == 0) { return; } ListeLotri = ListeLotri.ToList(); foreach (CsLotri item in ListeLotri) { if (item.EXIG != null) { item.DATEEXIG = Convert.ToDateTime(Convert.ToDateTime(item.DFAC) + TimeSpan.FromDays((int)item.EXIG)); } } }; service.ChargerLotriDejaMiseAJourAsync(idCentre, UserConnecte.matricule); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void ChargerLotriAll(List <int> idCentre) { ListeLotri = new List <CsLotri>(); FacturationServiceClient service = new FacturationServiceClient(Utility.Protocole(), Utility.EndPoint("Facturation")); service.ChargerLotriDejaFactureCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } ListeLotri = args.Result; if (ListeLotri == null || ListeLotri.Count == 0) { return; } ListeLotri = ListeLotri.ToList(); foreach (CsLotri item in ListeLotri) { item.DATEEXIG = Convert.ToDateTime(Convert.ToDateTime(item.DFAC) + TimeSpan.FromDays((int)item.EXIG)); } dataGridlLot.ItemsSource = null; dataGridlLot.ItemsSource = ClasseMethodeGenerique.DistinctLotri(ListeLotri); }; service.ChargerLotriDejaFactureAsync(idCentre); service.CloseAsync(); }
private void ChargerListeTourneeReleveur(List <int> lstIdCentre) { ListeTournee = new List <CsTournee>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerAllTourneeReleveurAsync(lstIdCentre); service.ChargerAllTourneeReleveurCompleted += (s, args) => { try { if (args.Cancelled || args.Error != null) { Message.ShowError("Erreur survenue à l'appel du service.", "Erreur"); return; } if (args.Result == null || args.Result.Count == 0) { Message.ShowError("Aucune tournée retournée par le système.", "Info"); return; } ListeTournee = args.Result; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; }
private void ChargerLotriAll(Dictionary <string, List <int> > lstSiteCentre) { ListeLotri = new List <CsLotri>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerLotriPourDefacturationCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } ListeLotri = args.Result; if (ListeLotri == null || ListeLotri.Count == 0) { return; } ListeLotri = ListeLotri.ToList(); foreach (CsLotri item in ListeLotri) { if (item.DFAC != null && item.EXIG != null) { item.DATEEXIG = Convert.ToDateTime(Convert.ToDateTime(item.DFAC) + TimeSpan.FromDays((int)item.EXIG)); } } dataGridlLot.ItemsSource = null; dataGridlLot.ItemsSource = ClasseMethodeGenerique.DistinctLotri(ListeLotri); }; service.ChargerLotriPourDefacturationAsync(lstSiteCentre, UserConnecte.matricule, true); service.CloseAsync(); }
private void PurgerLot(List <CsLotri> lesLot) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.PurgeDeLotCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == true) { Message.ShowInformation("Lot purger avec succès", "Facturation"); prgBar.Visibility = System.Windows.Visibility.Collapsed; this.DialogResult = true; } }; service.PurgeDeLotAsync(lesLot); service.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void RetourneInfoClient(CsClient leClientRech) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneAbonCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null) { Message.ShowError(Langue.Msg_AbonnemtInexistant, Galatee.Silverlight.Resources.Facturation.Langue.LibelleModule); return; } if (args.Result != null && args.Result.Count == 1) { leAbonnement = args.Result.First(); } this.Txt_NomAbon.Text = leAbonnement.NOMABON; leClientRech.FK_IDABON = leAbonnement.PK_ID; leClientRech.FK_IDPRODUIT = leAbonnement.FK_IDPRODUIT; leClientRech.FK_IDCENTRE = leAbonnement.FK_IDCENTRE; leClientRech.PERIODE = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(this.Txt_PeriodeEnCour.Text); if (leAbonnement != null && !string.IsNullOrEmpty(leAbonnement.CENTRE)) { RetourneEvenement(leClientRech); } }; service.RetourneAbonAsync(leClientRech.FK_IDCENTRE.Value, leClientRech.CENTRE, leClientRech.REFCLIENT, leClientRech.ORDRE); service.CloseAsync(); }
private void RetourneEvenement(CsClient leClient) { try { FacturationServiceClient ClientSrv = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); ClientSrv.RetourneEvenementCorrectionIndexCompleted += (e, argsss) => { if (argsss != null && argsss.Cancelled) { return; } List <CsEvenement> Res = argsss.Result; this.Cbo_Compteur.ItemsSource = null; this.Cbo_Compteur.ItemsSource = Res; this.Cbo_Compteur.DisplayMemberPath = "COMPTEUR"; if (Res.Count == 1) { this.Cbo_Compteur.SelectedItem = Res.First(); } }; ClientSrv.RetourneEvenementCorrectionIndexAsync(leClient); } catch (Exception ex) { throw ex; } }
private void ChargerListeReleveur(List <int> lstIdCentre) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneReleveurCentre_Async(lstIdCentre, UserConnecte.PK_ID); service.RetourneReleveurCentre_Completed += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel du service.", "Erreur"); return; } if (args.Result == null || args.Result.Count <= 0) { Message.ShowError("Aucun releveur retourné par le système.", "Information"); return; } ListeReleveur = args.Result.OrderBy(r => r.MATRICULE).ThenBy(r => r.DATECREATION).ToList(); ListeReleveurActif = ListeReleveur.Where(t => t.SUPPRIMER == null || t.SUPPRIMER == false) != null?ListeReleveur.Where(t => t.SUPPRIMER == null || t.SUPPRIMER == false).ToList() : new List <CsReleveur>(); ListeUser = ListeUtilisateurReleveur.Where(l => !lstIdReleveur.Contains(l.PK_ID)).ToList(); 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; if (ListeReleveur != null && ListeReleveur.Count != 0) { this.dataGrid1.ItemsSource = null; this.dataGrid1.ItemsSource = ListeReleveur.Where(t => t.FK_IDCENTRE == lesCentre.First().PK_ID&& (t.SUPPRIMER == null || t.SUPPRIMER == false)); } } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; this.btn_Creation.Visibility = System.Windows.Visibility.Visible; this.btn_modification.Visibility = System.Windows.Visibility.Visible; this.btn_suppression.Visibility = System.Windows.Visibility.Visible; this.OKButton.Visibility = System.Windows.Visibility.Collapsed; this.CancelButton.Visibility = System.Windows.Visibility.Collapsed; this.dataGrid1.IsEnabled = true; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void RetourneCanalisation(int fk_idcentre, string Centre, string Client, string Produit) { List <CsCanalisation> LstCanalisation = new List <CsCanalisation>(); LstCanalisationProduit = new List <CsCanalisation>(); try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneCanalisationCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur suite appel service", "Index"); return; } if (args.Result == null || args.Result.Count == 0) { Message.ShowError("Evenement non trouvé", "Index"); return; } LstCanalisation.AddRange(args.Result); if (LstCanalisation.Count != 0) { LstCanalisationProduit = LstCanalisation.Where(p => p.PRODUIT == Produit).ToList(); if (LstCanalisationProduit.Count != 0) { foreach (CsCanalisation item in LstCanalisationProduit) { item.INFOCOMPTEUR = item.NUMERO + " " + item.LIBELLETYPECOMPTEUR; } this.Cbo_Compteur.ItemsSource = null; this.Cbo_Compteur.ItemsSource = LstCanalisationProduit; this.Cbo_Compteur.DisplayMemberPath = "INFOCOMPTEUR"; if (LstCanalisationProduit.Count == 1) { this.Cbo_Compteur.SelectedItem = LstCanalisationProduit.First(); } } } } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }; service.RetourneCanalisationAsync(fk_idcentre, Centre, Client, Produit, null); // PARAMETRE MANQUANT } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }
private void Chargelotri(Dictionary <string, List <int> > lesDeCentre, bool IsLotCourant, string Periode) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerLotriPourSaisieCompleted += (_, es) => { try { if (es != null && es.Cancelled) { Message.ShowError("Aucun lot trouvé", "Facturation"); return; } if (es.Result == null || es.Result.Count == 0) { Message.ShowError("Aucun lot trouvé", "Facturation"); return; } if (es.Result != null && es.Result.Count != 0) { listeBatchInit = es.Result; listeBatch = ClasseMethodeGenerique.RetourneDistinctNumLot(es.Result); if (listeBatch != null && listeBatch.Count == 1) { Txt_NumBatch.Text = listeBatch.First().NUMLOTRI; this.Txt_NumBatch.Tag = listeBatch.First(); _lstCentreDuLot = ClasseMethodeGenerique.RetourneDistinctCentre(listeBatch.Where(t => t.NUMLOTRI == listeBatch.First().NUMLOTRI&& t.PERIODE == listeBatch.First().PERIODE).ToList()); if (_lstCentreDuLot != null && _lstCentreDuLot.Count == 1) { this.Txt_Centre.Text = _lstCentreDuLot.First().CENTRE; this.Txt_Centre.Tag = _lstCentreDuLot.First(); ListeDesSelectTourneeLot = listeBatchInit.Where(t => t.FK_IDCENTRE == _lstCentreDuLot.First().FK_IDCENTRE&& t.NUMLOTRI == Txt_NumBatch.Text).ToList(); if (ListeDesSelectTourneeLot != null && ListeDesSelectTourneeLot.Count == 1) { this.Txt_zone.Text = ListeDesSelectTourneeLot.First().TOURNEE; } } } } ListeDesTourneeLot = new List <CsLotri>(); if (listeBatch.Count != 0) { ListeDesTourneeLot = ClasseMethodeGenerique.RetourneDistinctTournee(listeBatch); } this.btn_batch.IsEnabled = true; this.Txt_NumBatch.IsReadOnly = false; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.ChargerLotriPourSaisieAsync(lesDeCentre, UserConnecte.matricule, IsLotCourant, Periode); }
private void SupprimerAnnomalie(List <CsFactureBrut> leResultatFacturationbrut) { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.SupprimeAnnomalieCompleted += (s, args) => { }; service.SupprimeAnnomalieAsync(leResultatFacturationbrut.First().LOTRI, leResultatFacturationbrut.First().FK_IDCENTRE); service.CloseAsync(); }
private void ChargerListeReleveur(List <int> lstIdCentre) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneReleveurCentre_Async(lstIdCentre, UserConnecte.PK_ID); service.RetourneReleveurCentre_Completed += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel du service.", "Erreur"); return; } if (args.Result == null || args.Result.Count == 0) { Message.ShowError("Aucun releveur retourné par le système.", "Information"); return; } ListeReleveur = args.Result.OrderBy(r => r.MATRICULE).ThenBy(r => r.DATECREATION).ToList(); if (lesCentre != null && lesCentre.Count == 1) { this.Txt_Centre.Text = lesCentre.First().CODE; this.txt_libellecentre.Text = lesCentre.First().LIBELLE; this.Txt_Centre.Tag = lesCentre.First().PK_ID; this.CboReleveur.ItemsSource = null; this.CboReleveur.DisplayMemberPath = "NOMRELEVEUR"; this.CboReleveur.SelectedValuePath = "PK_ID"; this.CboReleveur.ItemsSource = ListeReleveur.Where(t => t.FK_IDCENTRE == lesCentre.First().PK_ID&& (t.SUPPRIMER == null || t.SUPPRIMER == false)); return; } this.CboReleveur.ItemsSource = null; this.CboReleveur.DisplayMemberPath = "NOMRELEVEUR"; this.CboReleveur.SelectedValuePath = "PK_ID"; this.CboReleveur.ItemsSource = ListeReleveur.Where(t => t.SUPPRIMER == null || t.SUPPRIMER == false); return; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; this.dataGrid1.IsEnabled = true; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void OKButton_Click(object sender, RoutedEventArgs e) { try { prgBar.Visibility = System.Windows.Visibility.Visible; List <CsLotri> LotPourMaj = new List <CsLotri>(); this.OKButton.IsEnabled = false; var ligneLotriSelect = ((List <CsLotri>)dtgFactures.ItemsSource).Where(t => t.IsSelect == true).ToList(); if (ligneLotriSelect != null && ligneLotriSelect.Count > 0) { foreach (CsLotri item in ligneLotriSelect) { LotPourMaj.AddRange(lstLotInit.Where(t => t.NUMLOTRI == item.NUMLOTRI && t.PERIODE == item.PERIODE && t.JET == item.JET).ToList()); LotPourMaj.ForEach(t => t.MATRICULE = UserConnecte.matricule); LotPourMaj.ForEach(t => t.MOISCOMPTA = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(item.MOISCOMPTA)); } FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.MiseAjourLotsAsync(LotPourMaj); service.MiseAjourLotsCompleted += (erreur, resultat) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (resultat.Error != null || resultat.Cancelled) { Message.Show("Une erreur s'est produite", "Erreur"); } else { CsStatFacturation _laStat = resultat.Result; if (_laStat != null) { this.DialogResult = false; UcResultatFacturation ctrl = new UcResultatFacturation(_laStat); ctrl.Show(); prgBar.Visibility = System.Windows.Visibility.Collapsed; } this.OKButton.IsEnabled = true; } }; } else { Message.Show("Vous devez choisir un lot dans la liste", "Erreur"); this.OKButton.IsEnabled = true; prgBar.Visibility = System.Windows.Visibility.Collapsed; return; } } catch (Exception ex) { Message.Show("Erreur à la mise à jour", "Erreur"); } }
private void ChargeListeDesCasDuLot(string Lotri, List <int> LesCentre, List <int?> Latournee) { try { string TypeCas = string.Empty; List <CsCasind> lstCaAfficher = new List <CsCasind>(); if (Chk_Enquete.IsChecked == true) { TypeCas = "1"; } else if (chk_NonEnquetable.IsChecked == true) { TypeCas = "2"; } else if (chk_Confirmer.IsChecked == true) { TypeCas = "3"; } List <CsCasind> ListDesCasDuLot = new List <CsCasind>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ListeDesCasCompleted += (s, args) => { try { if (args.Error != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel serveur", "Erreur"); return; } if (args.Result != null && args.Result.Count == 0) { Message.ShowInformation("Aucune données trouvées!", "Info"); return; } ListDesCasDuLot = args.Result; this.dataGrid1.ItemsSource = null; this.dataGrid1.ItemsSource = ListDesCasDuLot; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.ListeDesCasAsync(Lotri, LesCentre, Latournee, TypeCas); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void ChargerLstEvenementNonFacture(List <CsCanalisation> LstCanalisationSelect) { List <CsEvenement> LstEvenement = new List <CsEvenement>(); try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneListEvenementNonFactCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel serveur. Veuillez reessayer svp ", ""); return; } if (args.Result == null) { Message.ShowError("Aucune donnée retournée par le système.", "Information"); return; } List <CsSaisiIndexIndividuel> lstEvtCompteur = new List <CsSaisiIndexIndividuel>(); lstEvtCompteur = args.Result; if (lstEvtCompteur.Count != 0) { LstEvenement = AffecterInfoPrecedente(LstEvenement.OrderBy(p => p.NUMEVENEMENT).ToList()); UcSaisieIndividuelle Ctrl = new UcSaisieIndividuelle(lstEvtCompteur); Ctrl.Show(); } else { Message.ShowError("Aucun evenement non saisi", "Information"); return; } } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }; service.RetourneListEvenementNonFactAsync(LstCanalisationSelect); } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }
private void ChargerListeLotriPourMAJ(List <int> lstCentre) { try { prgBar.Visibility = System.Windows.Visibility.Visible; ListeDesLotriAfficher = new List <CsLotri>(); FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerLotriPourMiseAJourAsync(lstCentre, UserConnecte.matricule); service.ChargerLotriPourMiseAJourCompleted += (s, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; try { if (args.Error != null && args.Cancelled) { Message.ShowError("Erreur d'invocation du service.", "Erreur"); return; } if (args.Result == null) { Message.ShowError("Aucune donnée retournée du système.", "Erreur"); return; } List <CsLotri> lstGolbalLot = new List <CsLotri>(); lstGolbalLot = args.Result; lstLotInit = lstGolbalLot; if (lstGolbalLot.Count != 0) { ListeDesLotriAfficher = Facturation.ClasseMethodeGenerique.DistinctLotriJetProduit(lstGolbalLot); } string MoisCpt = Shared.ClasseMEthodeGenerique.FormatPeriodeMMAAAA(System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString("00")); ListeDesLotriAfficher.ForEach(t => t.MOISCOMPTA = MoisCpt); dtgFactures.ItemsSource = null; dtgFactures.ItemsSource = ListeDesLotriAfficher; } catch (Exception ex) { Message.Show("Erreur remplissage cmb :" + ex.Message, "Erreur inconnue"); } }; } catch (Exception ex) { Message.Show("Erreur remplissage cmb :" + ex.Message, "Erreur inconnue"); } }
private void UpdateTournee(CsTournee LeTournee) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.UpdateUneTourneeCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel du service.", "Erreur"); return; } if (args.Result == null) { Message.ShowError("Erreur survenue lors de la mise à jour de la tournée.Réessayer svp!", "Information"); return; } if (args.Result == true) { Message.ShowInformation("Insertion de la tournée validée.", "Information"); this.DialogResult = true; //return; } _TourneeCreation = LeTournee; ListeTournee.RemoveAll(r => r.CENTRE == LaTournee.CENTRE && r.CODE == LaTournee.CODE && r.RELEVEUR == LaTournee.RELEVEUR); ListeTournee.Add(LeTournee); Closed(this, new EventArgs()); this.DialogResult = false; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.UpdateUneTourneeAsync(LeTournee); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void ChargerEvenementNonFacture(CsCanalisation LaCanalisationSelect) { List <CsEvenement> LstEvenement = new List <CsEvenement>(); try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.RetourneEvenementNonFactCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel serveur. Veuillez reessayer svp ", ""); return; } if (args.Result == null) { Message.ShowError("Aucune donnée retournée par le système.", "Information"); return; } LstEvenement.Clear(); LstEvenement.AddRange(args.Result.EventLotriNull); LstEvenement.AddRange(args.Result.EventPageri); LstEvenement.AddRange(args.Result.EventPagisol); if (LstEvenement.Count != 0) { LstEvenement = AffecterInfoPrecedente(LstEvenement.OrderBy(p => p.NUMEVENEMENT).ToList()); UcSaisieIndividuelle Ctrl = new UcSaisieIndividuelle(LstEvenement, args.Result.ConsoPrecedent, args.Result.CONSOMOYENNE); Ctrl.Show(); } } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }; service.RetourneEvenementNonFactAsync(LaCanalisationSelect); } catch (Exception ex) { Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle); } }
private void InsererTournee(CsTournee LaTournee) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.InsererUneTourneeCompleted += (s, args) => { try { if (args != null && args.Cancelled) { Message.ShowError("Erreur survenue lors de l'appel du service", "Erreur"); return; } if (args.Result == null) { Message.ShowError("Erreur d'insertion du releveur.Réessayer svp!", "Information"); return; } if (args.Result == true) { Message.ShowInformation("Insertion validée.", "Information"); this.DialogResult = true; //return; } _TourneeCreation = LaTournee; ListeTournee.Add(LaTournee); Closed(this, new EventArgs()); this.DialogResult = false; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.InsererUneTourneeAsync(LaTournee); } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }