Esempio n. 1
0
        private void ChargerHabilitationCaisse()
        {
            CsPoste lePoste = new CsPoste();

            lePoste.CODECENTRE  = SessionObject.LePosteCourant.CODECENTRE;
            lePoste.FK_IDCAISSE = SessionObject.LePosteCourant.FK_IDCAISSE;
            lePoste.FK_IDCENTRE = SessionObject.LePosteCourant.FK_IDCENTRE;
            lePoste.IsSelect    = SessionObject.LePosteCourant.IsSelect;
            lePoste.MATRICULE   = SessionObject.LePosteCourant.MATRICULE;
            lePoste.NOMPOSTE    = SessionObject.LePosteCourant.NOMPOSTE;
            lePoste.NUMCAISSE   = SessionObject.LePosteCourant.NUMCAISSE;
            lePoste.PK_ID       = SessionObject.LePosteCourant.PK_ID;

            CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            //service.RetouneLaCaisseCouranteAsync(UserConnecte.matricule);
            service.RetouneLaCaisseCouranteInsereeAsync(UserConnecte.matricule, lePoste);
            service.RetouneLaCaisseCouranteInsereeCompleted += (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ée trouvée", Langue.errorTitle);
                        return;
                    }

                    SessionObject.LaCaisseCourante = es.Result;
                    RecuperationNumCaisse();
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, Langue.errorTitle);
                }
            };
        }