private void RecuperationNumCaisse() { if (SessionObject.DernierNumeroDeRecu <= 0) { CaisseServiceClient srv; srv = new CaisseServiceClient(Utility.Protocole(), Utility.EndPoint("Caisse")); srv.RetourneNumeroRecuAsync(SessionObject.LaCaisseCourante.FK_IDCAISSE, UserConnecte.matricule); srv.RetourneNumeroRecuCompleted += (s, es) => { try { if (es.Error != null || es.Cancelled) { Message.ShowError("Erreur! :" + es.Error.Message, "Erreur"); return; } if (es.Result == null) { Message.ShowError("Erreur", "Erreur"); return; } else { SessionObject.DernierNumeroDeRecu = Decimal.Parse(es.Result); } } catch (Exception ex) { Message.ShowError(ex, Langue.errorTitle); } finally { } }; } }