コード例 #1
0
        public void MiseAjourPoste()
        {
            try
            {
                string machine = this.txtMomMachine.Text;
                if (this.Cbo_Centre.SelectedItem != null && !string.IsNullOrEmpty(this.txtMomMachine.Text))
                {
                    ServiceCaisse.CsCaisse laCaisseSelect = new ServiceCaisse.CsCaisse();
                    if (this.Cbo_Caisse.SelectedItem != null)
                    {
                        laCaisseSelect = (ServiceCaisse.CsCaisse)Cbo_Caisse.SelectedItem;
                    }
                    Galatee.Silverlight.ServiceAccueil.CsCentre leCentre = Cbo_Centre.SelectedItem as Galatee.Silverlight.ServiceAccueil.CsCentre;
                    CsPoste lePoste = new CsPoste()
                    {
                        CODECENTRE  = leCentre.CODE,
                        FK_IDCENTRE = leCentre.PK_ID,
                        NOMPOSTE    = this.txtMomMachine.Text.ToUpper().Trim(),
                        NUMCAISSE   = (laCaisseSelect == null ? string.Empty : laCaisseSelect.NUMCAISSE),
                    };
                    lePoste.FK_IDCAISSE = null;


                    if (laCaisseSelect != null && !string.IsNullOrEmpty(laCaisseSelect.NUMCAISSE))
                    {
                        lePoste.FK_IDCAISSE = laCaisseSelect.PK_ID;

                        /** ZEG 29/08/2017 **/
                        if (SessionObject.iDCaisseDeclaree == null && lePoste.FK_IDCAISSE != null)
                        {
                            SessionObject.iDCaisseDeclaree = lePoste.FK_IDCAISSE;
                        }
                    }

                    Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient service = new Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));
                    service.InsertPosteCompleted += (s, args) =>
                    {
                        if (args != null && args.Cancelled)
                        {
                            return;
                        }
                        Classes.IsolatedStorage.storeMachine(lePoste.NOMPOSTE);
                        Classes.IsolatedStorage.storeCentre(lePoste.CODECENTRE);


                        /** ZEG 29/08/2017 **/
                        if (SessionObject.iDCaisseDeclaree == null && lePoste.FK_IDCAISSE != null)
                        {
                            SessionObject.iDCaisseDeclaree = lePoste.FK_IDCAISSE;
                        }
                    };
                    service.InsertPosteAsync(lePoste);
                    service.CloseAsync();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
 public FrmParametragePoste(CsPoste lePoste)
 {
     lePosteModif = new CsPoste();
     InitializeComponent();
     lePosteModif = lePoste;
     retourneCaisseDispo();
     this.txtMomMachine.Text = string.IsNullOrEmpty(lePoste.NOMPOSTE) ? string.Empty : lePoste.NOMPOSTE;
 }
コード例 #3
0
 public bool InsertPoste(CsPoste lePoste)
 {
     try
     {
         return(new DBAdmUsers().InsertPoste(lePoste));
     }
     catch (Exception ex)
     {
         ErrorManager.LogException(this, ex);
         return(false);
     }
 }
コード例 #4
0
 public List <CsPoste> UpdatePoste(CsPoste lePoste)
 {
     try
     {
         if (new DBAdmUsers().UpdatePoste(lePoste))
         {
             return(RetourneListePoste());
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ErrorManager.LogException(this, ex);
         return(null);
     }
 }
コード例 #5
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);
                }
            };
        }