Example #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);
        }
Example #2
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);
        }