private void ChargerHabilitationCaisse() { CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse")); service.RetouneLaCaisseCouranteAsync(UserConnecte.matricule); service.RetouneLaCaisseCouranteCompleted += (sender, es) => { try { if (es.Cancelled || es.Error != null) { Message.ShowError("Erreur d'invocation du service . Veuillez réssayer svp!", Galatee.Silverlight.Resources.Langue.errorTitle); this.DialogResult = true; } if (es.Result == null) { Message.ShowError("Aucune données trouvées", Langue.errorTitle); return; } SessionObject.LaCaisseCourante = es.Result; RetourneReglementEncaisse(); } catch (Exception ex) { Message.ShowError(ex, Langue.errorTitle); } }; }
void RetourneCaisseCourante() { try { CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse")); service.RetouneLaCaisseCouranteAsync(UserConnecte.matricule); service.RetouneLaCaisseCouranteCompleted += (s, args) => { if (args.Cancelled || args.Error != null) { Message.ShowError("Erreur de chargement des reçus de la caisse. Réessayez svp !", "Erreur"); this.DialogResult = true; } if (args.Result != null) { SessionObject.LaCaisseCourante = args.Result; } }; service.CloseAsync(); } catch (Exception) { throw; } }