private void ChargerLotriAll(Dictionary <string, List <int> > lstSiteCentre)
        {
            ListeLotri = new List <CsLotri>();
            FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation"));

            service.ChargerLotriPourDefacturationCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                ListeLotri = args.Result;
                if (ListeLotri == null || ListeLotri.Count == 0)
                {
                    return;
                }
                ListeLotri = ListeLotri.ToList();
                foreach (CsLotri item in ListeLotri)
                {
                    if (item.DFAC != null && item.EXIG != null)
                    {
                        item.DATEEXIG = Convert.ToDateTime(Convert.ToDateTime(item.DFAC) + TimeSpan.FromDays((int)item.EXIG));
                    }
                }
                dataGridlLot.ItemsSource = null;
                dataGridlLot.ItemsSource = ClasseMethodeGenerique.DistinctLotri(ListeLotri);
            };
            service.ChargerLotriPourDefacturationAsync(lstSiteCentre, UserConnecte.matricule, true);
            service.CloseAsync();
        }
Exemplo n.º 2
0
        private void ChargerLotriAll(List <int> idCentre)
        {
            ListeLotri = new List <CsLotri>();
            FacturationServiceClient service = new FacturationServiceClient(Utility.Protocole(), Utility.EndPoint("Facturation"));

            service.ChargerLotriDejaFactureCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                ListeLotri = args.Result;
                if (ListeLotri == null || ListeLotri.Count == 0)
                {
                    return;
                }
                ListeLotri = ListeLotri.ToList();
                foreach (CsLotri item in ListeLotri)
                {
                    item.DATEEXIG = Convert.ToDateTime(Convert.ToDateTime(item.DFAC) + TimeSpan.FromDays((int)item.EXIG));
                }

                dataGridlLot.ItemsSource = null;
                dataGridlLot.ItemsSource = ClasseMethodeGenerique.DistinctLotri(ListeLotri);
            };
            service.ChargerLotriDejaFactureAsync(idCentre);
            service.CloseAsync();
        }
        private void btn_Batch_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <object>  _LstObj = new List <object>();
                List <CsLotri> _Lstlot = new List <CsLotri>();
                Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();

                if (chk_LotIsole.IsChecked == true)
                {
                    _Lstlot = Facturation.ClasseMethodeGenerique.DistinctLotriPeriodeProduit(ListeLotri.Where(y => y.ETATFAC10 == "O").ToList());
                    _LstColonneAffich.Add("NUMLOTRI", "LOT");
                }
                else
                {
                    _Lstlot = Facturation.ClasseMethodeGenerique.DistinctLotriPeriodeProduit(ListeLotri.Where(y => y.ETATFAC10 != "O").ToList());
                    _LstColonneAffich.Add("NUMLOTRI", "LOT");
                    _LstColonneAffich.Add("PERIODE", "PERIODE");
                }
                _LstObj = ClasseMEthodeGenerique.RetourneListeObjet(ClasseMethodeGenerique.DistinctLotri(_Lstlot));

                List <object>             obj  = Shared.ClasseMEthodeGenerique.RetourneListeObjet(_LstObj);
                MainView.UcListeGenerique ctrl = new MainView.UcListeGenerique(obj, _LstColonneAffich, false, "Lots");
                ctrl.Closed += new EventHandler(galatee_OkClickedBatch);
                ctrl.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, "Error");
            }
        }
        private void btn_Batch_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <object> _LstObj = new List <object>();
                _LstObj = Shared.ClasseMEthodeGenerique.RetourneListeObjet(ClasseMethodeGenerique.DistinctLotri(ListeLotri));
                Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();
                _LstColonneAffich.Add("NUMLOTRI", "LOT");
                _LstColonneAffich.Add("PERIODE", "PERIODE");

                List <object>             obj  = Shared.ClasseMEthodeGenerique.RetourneListeObjet(_LstObj);
                MainView.UcListeGenerique ctrl = new MainView.UcListeGenerique(obj, _LstColonneAffich, false, "Lots");
                ctrl.Closed += new EventHandler(galatee_OkClickedBatch);
                ctrl.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, "Error");
            }
        }