private void btn_Centre_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (_ListeLotri != null)
         {
             this.btn_Centre.IsEnabled = false;
             CsLotri leLotSelect = new CsLotri();
             if (this.Txt_NumBatch.Tag != null)
             {
                 leLotSelect = (CsLotri)this.Txt_NumBatch.Tag;
             }
             List <CsLotri> _lstLotAfficher = ClasseMethodeGenerique.RetourneDistinctCentre(_ListeLotri.Where(t => t.NUMLOTRI == leLotSelect.NUMLOTRI && t.PERIODE == leLotSelect.PERIODE).ToList());
             Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();
             _LstColonneAffich.Add("CENTRE", "CENTRE");
             _LstColonneAffich.Add("LIBELLECENTRE", "LIBELLE");
             foreach (CsLotri item in _lstLotAfficher)
             {
                 item.CODE    = item.CENTRE;
                 item.LIBELLE = item.LIBELLECENTRE;
             }
             UcGenerique ctrl = new UcGenerique(_lstLotAfficher, true, "Liste des centres");
             ctrl.Closed += new EventHandler(ucgCentre);
             ctrl.Show();
             this.btn_Centre.IsEnabled = true;
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, "Erreur");
     }
 }
Пример #2
0
        void galatee_OkClickedBtnZone1(object sender, EventArgs e)
        {
            ListeDesSelectTourneeLot.Clear();
            UcGenerique ctrs = sender as UcGenerique;

            if (ctrs.isOkClick)
            {
                List <CsLotri> LestourneeDuLot = (List <CsLotri>)ctrs.MyObjectList;
                if (LestourneeDuLot != null && LestourneeDuLot.Count > 0)
                {
                    int passage = 1;
                    foreach (CsLotri item in LestourneeDuLot)
                    {
                        if (passage == 1)
                        {
                            this.Txt_zone.Text = item.TOURNEE;
                        }
                        else
                        {
                            this.Txt_zone.Text = this.Txt_zone.Text + "  " + item.TOURNEE;
                        }
                        passage++;
                    }
                    this.Txt_zone.Tag        = LestourneeDuLot;
                    ListeDesSelectTourneeLot = LestourneeDuLot;
                }
            }
        }
Пример #3
0
        private void ucgCentre(object sender, EventArgs e)
        {
            this.btn_Centre.IsEnabled = true;
            ListeDesSelectCentreLot.Clear();
            UcGenerique ctrs = sender as UcGenerique;

            if (ctrs.isOkClick)
            {
                List <CsLotri> LesCentreeDuLot = (List <CsLotri>)ctrs.MyObjectList;
                if (LesCentreeDuLot != null && LesCentreeDuLot.Count > 0)
                {
                    int passage = 1;
                    foreach (CsLotri item in LesCentreeDuLot)
                    {
                        if (passage == 1)
                        {
                            this.Txt_Centre.Text = item.CENTRE;
                        }
                        else
                        {
                            this.Txt_Centre.Text = this.Txt_Centre.Text + "  " + item.CENTRE;
                        }
                        passage++;
                    }
                    this.Txt_Centre.Tag        = LesCentreeDuLot;
                    ListeDesSelectCentreLot    = LesCentreeDuLot;
                    this.btn_tournee.IsEnabled = true;
                    this.Txt_zone.IsReadOnly   = false;
                }
            }
        }
Пример #4
0
        private void btn_tournee_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <string> _LstColonneAffich = new List <string>();
                _LstColonneAffich.Add("CENTRE");
                _LstColonneAffich.Add("TOURNEE");
                if (this.Txt_NumBatch.Tag != null)
                {
                    List <int> lsidCentre = new List <int>();
                    foreach (CsLotri item in ListeDesSelectCentreLot)
                    {
                        lsidCentre.Add(item.FK_IDCENTRE);
                    }

                    List <CsLotri> lstLotSelect = ListeDesTourneeLot.Where(p => p.NUMLOTRI == this.Txt_NumBatch.Text && lsidCentre.Contains(p.FK_IDCENTRE)).OrderBy(t => t.CENTRE).ThenBy(y => y.TOURNEE).ToList();
                    foreach (CsLotri item in lstLotSelect)
                    {
                        item.CODE    = item.CENTRE;
                        item.LIBELLE = item.TOURNEE;
                    }
                    UcGenerique ctrl = new UcGenerique(lstLotSelect, true, "Liste des tournées");
                    ctrl.Closed += new EventHandler(galatee_OkClickedBtnZone1);
                    ctrl.Show();
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, "Erreur");
            }
        }
        private void ucgCentre(object sender, EventArgs e)
        {
            UcGenerique ctrs = sender as UcGenerique;

            if (ctrs.isOkClick)
            {
                List <CsLotri> LesCentreeDuLot = (List <CsLotri>)ctrs.MyObjectList;
                if (LesCentreeDuLot != null && LesCentreeDuLot.Count > 0)
                {
                    int passage = 1;
                    foreach (CsLotri item in LesCentreeDuLot)
                    {
                        if (passage == 1)
                        {
                            this.Txt_Centre.Text = item.CENTRE;
                        }
                        else
                        {
                            this.Txt_Centre.Text = this.Txt_Centre.Text + "  " + item.CENTRE;
                        }
                        passage++;
                    }
                    this.Txt_Centre.Tag        = LesCentreeDuLot.Select(o => o.FK_IDCENTRE).ToList();
                    this.btn_Tournee.IsEnabled = true;
                    this.Txt_zone.IsEnabled    = true;
                }
            }
        }