Пример #1
0
        private void Chargelotri(Dictionary <string, List <int> > lesDeCentre, bool IsLotCourant, string Periode)
        {
            FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));

            service.ChargerLotriPourSaisieCompleted += (_, es) =>
            {
                try
                {
                    if (es != null && es.Cancelled)
                    {
                        Message.ShowError("Aucun lot trouvé", "Facturation");
                        return;
                    }

                    if (es.Result == null || es.Result.Count == 0)
                    {
                        Message.ShowError("Aucun lot trouvé", "Facturation");
                        return;
                    }
                    if (es.Result != null && es.Result.Count != 0)
                    {
                        listeBatchInit = es.Result;
                        listeBatch     = ClasseMethodeGenerique.RetourneDistinctNumLot(es.Result);
                        if (listeBatch != null && listeBatch.Count == 1)
                        {
                            Txt_NumBatch.Text     = listeBatch.First().NUMLOTRI;
                            this.Txt_NumBatch.Tag = listeBatch.First();

                            _lstCentreDuLot = ClasseMethodeGenerique.RetourneDistinctCentre(listeBatch.Where(t => t.NUMLOTRI == listeBatch.First().NUMLOTRI&& t.PERIODE == listeBatch.First().PERIODE).ToList());
                            if (_lstCentreDuLot != null && _lstCentreDuLot.Count == 1)
                            {
                                this.Txt_Centre.Text     = _lstCentreDuLot.First().CENTRE;
                                this.Txt_Centre.Tag      = _lstCentreDuLot.First();
                                ListeDesSelectTourneeLot = listeBatchInit.Where(t => t.FK_IDCENTRE == _lstCentreDuLot.First().FK_IDCENTRE&& t.NUMLOTRI == Txt_NumBatch.Text).ToList();
                                if (ListeDesSelectTourneeLot != null && ListeDesSelectTourneeLot.Count == 1)
                                {
                                    this.Txt_zone.Text = ListeDesSelectTourneeLot.First().TOURNEE;
                                }
                            }
                        }
                    }
                    ListeDesTourneeLot = new List <CsLotri>();
                    if (listeBatch.Count != 0)
                    {
                        ListeDesTourneeLot = ClasseMethodeGenerique.RetourneDistinctTournee(listeBatch);
                    }
                    this.btn_batch.IsEnabled     = true;
                    this.Txt_NumBatch.IsReadOnly = false;
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, "Erreur");
                }
            };
            service.ChargerLotriPourSaisieAsync(lesDeCentre, UserConnecte.matricule, IsLotCourant, Periode);
        }
        private void ChargerListeLotri(Dictionary <string, List <int> > lesDeCentre, bool IsLotCourant, string Periode)
        {
            _ListeLotri = new List <CsLotri>();
            try
            {
                FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));
                service.ChargerLotriPourEditionIndexCompleted += (s, args) =>
                {
                    try
                    {
                        if (args.Error != null && args.Cancelled)
                        {
                            Message.ShowError("Erreur d'invocation du service.", "Erreur");
                            return;
                        }

                        if (args.Result == null)
                        {
                            Message.ShowError("Aucune donnée retournée du système.", "Erreur");
                            return;
                        }
                        _ListeLotri              = args.Result;
                        ListeDesLotriAfficher    = new List <CsLotri>();
                        ListeDesTourneeLot       = new List <CsLotri>();
                        this.btn_batch.IsEnabled = true;
                        if (_ListeLotri.Count != 0)
                        {
                            ListeDesLotriAfficher = ClasseMethodeGenerique.RetourneDistinctLotri(_ListeLotri);
                            ListeDesTourneeLot    = ClasseMethodeGenerique.RetourneDistinctTournee(_ListeLotri);
                        }
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, "Erreur");
                    }
                };
                service.ChargerLotriPourEditionIndexAsync(lesDeCentre, IsLotCourant, Periode);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        private void Chargelotri(List <int> lstCentreHAbilite)
        {
            FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));

            service.RetourneListeLotNonTraiteCompleted += (_, es) =>
            {
                try
                {
                    if (es != null && es.Cancelled)
                    {
                        Message.ShowError("", "");
                        //LoadingManager.EndLoading(result);
                        return;
                    }

                    if (es.Result == null || es.Result.Count == 0)
                    {
                        Message.ShowError("", "");
                        //LoadingManager.EndLoading(result);
                        return;
                    }

                    if (es.Result != null && es.Result.Count != 0)
                    {
                        listeBatch = ClasseMethodeGenerique.RetourneDistinctNumLot(es.Result);
                    }

                    ListeDesTourneeLot = new List <CsLotri>();
                    if (listeBatch.Count != 0)
                    {
                        ListeDesTourneeLot = ClasseMethodeGenerique.RetourneDistinctTournee(listeBatch);
                    }

                    this.btn_batch.IsEnabled = true;
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, "Erreur");
                }
            };
            service.RetourneListeLotNonTraiteAsync(lstCentreHAbilite);
        }
        private void ChargerLotriPourEnquete(Dictionary <string, List <int> > lesDeCentre, bool IsFacturationCourante, string Periode)
        {
            FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));

            service.ChargerLotriPourEnqueteCompleted += (_, es) =>
            {
                try
                {
                    if (es != null && es.Cancelled)
                    {
                        Message.ShowError("", "");
                        return;
                    }

                    if (es.Result == null || es.Result.Count == 0)
                    {
                        Message.ShowError("", "");
                        return;
                    }

                    if (es.Result != null && es.Result.Count != 0)
                    {
                        listeBatchInit = es.Result;
                        listeBatch     = ClasseMethodeGenerique.RetourneDistinctNumLot(es.Result);
                    }

                    ListeDesTourneeLot = new List <CsLotri>();
                    if (listeBatch.Count != 0)
                    {
                        ListeDesTourneeLot = ClasseMethodeGenerique.RetourneDistinctTournee(listeBatch);
                    }

                    this.btn_batch.IsEnabled = true;
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, "Erreur");
                }
            };
            service.ChargerLotriPourEnqueteAsync(lesDeCentre, IsFacturationCourante, Periode);
        }