コード例 #1
0
 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
        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");
            }
        }