Example #1
0
        void RetourneReglementEncaisse()
        {
            try
            {
                CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                service.RetourneRecuDeCaissePourAnnulationAsync(SessionObject.LaCaisseCourante.PK_ID);
                service.RetourneRecuDeCaissePourAnnulationCompleted += (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 || args.Result.Count == 0)
                    {
                        Message.ShowError("Aucun encaissement n'a été effectué.", Langue.errorTitle);
                        return;
                    }
                    List <CsLclient> _LstReglement = new List <CsLclient>();
                    _LstReglement    = args.Result;
                    _LstrefReglement = _LstReglement;
                    if (_LstReglement != null && _LstReglement.Count != 0)
                    {
                        RemplireCombo(_LstReglement.Where(t => string.IsNullOrEmpty(t.TOPANNUL)).OrderBy(a => a.ACQUIT).ToList());
                    }
                };
                service.CloseAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }
        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;
            }
        }
        private void LoadEtatCaisse()
        {
            List <int> lstCentre  = new List <int>();
            DateTime?  DateCaisse = this.dtp_debut.Text == null ? null : this.dtp_debut.SelectedDate;
            bool       IsEncour   = false;

            if (this.Chk_EnCours.IsChecked == true)
            {
                IsEncour = true;
            }

            if (this.Cbo_Centre.Tag != null)
            {
                List <Galatee.Silverlight.ServiceAccueil.CsCentre> lstCentreSelect = Cbo_Centre.Tag as List <Galatee.Silverlight.ServiceAccueil.CsCentre>;
                foreach (Galatee.Silverlight.ServiceAccueil.CsCentre item in lstCentreSelect)
                {
                    lstCentre.Add(item.PK_ID);
                }
            }
            else if (this.Cbo_Site.Tag != null)
            {
                List <Galatee.Silverlight.ServiceAccueil.CsSite> lstSiteSelect = Cbo_Site.Tag as List <Galatee.Silverlight.ServiceAccueil.CsSite>;
                foreach (Galatee.Silverlight.ServiceAccueil.CsSite item in lstSiteSelect)
                {
                    List <Galatee.Silverlight.ServiceAccueil.CsCentre> stCentreS = SessionObject.LstCentre.Where(t => t.FK_IDCODESITE == item.PK_ID).ToList();
                    foreach (Galatee.Silverlight.ServiceAccueil.CsCentre items in stCentreS)
                    {
                        lstCentre.Add(items.PK_ID);
                    }
                }
            }
            else
            {
                if (Cbo_Centre.Tag == null && Cbo_Site.Tag == null)
                {
                    lstCentre = SessionObject.LstIdCentreDuPerimetreAction;
                }
            }
            //List<int> lstCentreCaisse = string.IsNullOrEmpty( this.Txt_CodeCentre .Text) ? SessionObject.LstIdCentreDuPerimetreAction:  ((CsCentre)Txt_CodeCentre.Tag).PK_ID
            CaisseServiceClient service1 = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            service1.RetourneSuppervisionCaisseCompleted += (es, argss) =>
            {
                List <CsHabilitationCaisse> LstHabilCaisse = new List <CsHabilitationCaisse>();
                if (argss != null && argss.Cancelled)
                {
                    return;
                }
                LstHabilCaisse            = argss.Result;
                dtgEtatCaisse.ItemsSource = null;
                dtgEtatCaisse.ItemsSource = LstHabilCaisse;
            };
            service1.RetourneSuppervisionCaisseAsync(lstCentre, DateCaisse, IsEncour);
            service1.CloseAsync();
        }
        private void RetourneTypeTimbre()
        {
            CaisseServiceClient service = new  CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            service.RetouneTypeTimbreCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
            };
            service.RetouneTypeTimbreAsync();
            service.CloseAsync();
        }
Example #5
0
        private void RetourneListeDesLibelleTop()
        {
            CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            service.RetourneTousLibelleTopCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                SessionObject.LstDesLibelleTop = args.Result;
            };
            service.RetourneTousLibelleTopAsync();
            service.CloseAsync();
        }
        private void RetourneTypeTimbre()
        {
            CaisseServiceClient service = new  CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            service.RetouneTypeTimbreCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                cbo_TypeTimbre.ItemsSource       = args.Result;
                cbo_TypeTimbre.DisplayMemberPath = "LIBELLE";
            };
            service.RetouneTypeTimbreAsync();
            service.CloseAsync();
        }
        void RetourneReglementEncaisse()
        {
            try
            {
                this.OKButton.IsEnabled = false;
                CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                service.RetourneRecuDeCaissePourAnnulationAsync(SessionObject.LaCaisseCourante.PK_ID);
                service.RetourneRecuDeCaissePourAnnulationCompleted += (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 || args.Result.Count == 0)
                    {
                        ValidationFermetureCaisse(SessionObject.LaCaisseCourante);
                        this.DialogResult = true;
                        return;
                    }

                    List <CsLclient> _LstReglement = new List <CsLclient>();
                    _LstReglement = args.Result;
                    if (_LstReglement != null && _LstReglement.Count != 0)
                    {
                        List <CsLclient> lstReglementAnnulationEncour = _LstReglement.Where(t => (!string.IsNullOrEmpty(t.STATUS) && t.STATUS == SessionObject.Enumere.StatusDemandeInitier)).ToList();
                        if (lstReglementAnnulationEncour != null && lstReglementAnnulationEncour.Count != 0)
                        {
                            Message.ShowError(Langue.MsgImposibleArretCaisse, Langue.errorTitle);
                            this.DialogResult = true;
                            return;
                        }
                        else
                        {
                            ValidationFermetureCaisse(SessionObject.LaCaisseCourante);
                            this.DialogResult = true;
                        }
                    }
                };
                service.CloseAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }
        void RetourneReglementEncaisse()
        {
            try
            {
                CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
                service.RetourneRecuDeCaissePourAnnulationAsync(SessionObject.LaCaisseCourante.PK_ID);
                service.RetourneRecuDeCaissePourAnnulationCompleted += (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 || args.Result.Count == 0)
                    {
                        Message.ShowError("Aucun encaissement n'a été effectué.", Langue.errorTitle);
                        return;
                    }

                    List <ServiceCaisse.CsLclient> _LstReglement = new List <ServiceCaisse.CsLclient>();
                    _LstReglement    = args.Result;
                    _LstrefReglement = _LstReglement;



                    if (_LstReglement != null && _LstReglement.Count != 0)
                    {
                        List <ServiceCaisse.CsLclient> lstReglementClient = _LstReglement.Where(t => (string.IsNullOrEmpty(t.STATUS) || t.STATUS == SessionObject.Enumere.StatusDemandeRetirer)).ToList();
                        this.dtg_FactureAAnnule.ItemsSource = null;
                        this.dtg_FactureAAnnule.ItemsSource = RetourneEltsDataGrid1(lstReglementClient);

                        List <ServiceCaisse.CsLclient> lstReglementClientEncour = _LstReglement.Where(t => (!string.IsNullOrEmpty(t.STATUS) && t.STATUS != SessionObject.Enumere.StatusDemandeRetirer)).ToList();
                        this.dtg_FactureAjouter.ItemsSource = null;
                        this.dtg_FactureAjouter.ItemsSource = RetourneEltsDataGrid2(lstReglementClientEncour);
                    }
                };
                service.CloseAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #9
0
        private void RetourneListeDesModReglement()
        {
            if (SessionObject.ListeModesReglement != null && SessionObject.ListeModesReglement.Count != 0)
            {
                return;
            }
            CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));

            service.RetourneModesReglementCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                SessionObject.ListeModesReglement = args.Result;
            };
            service.RetourneModesReglementAsync();
            service.CloseAsync();
        }
 void ReturneAllMonaie()
 {
     try
     {
         CaisseServiceClient service = new CaisseServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Caisse"));
         service.ReturneAllMonaieAsync();
         service.ReturneAllMonaieCompleted += (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;
             }
             this.Lsv_Monaie.ItemsSource = null;
             this.Lsv_Monaie.ItemsSource = args.Result;
         };
         service.CloseAsync();
     }
     catch (Exception)
     {
         throw;
     }
 }