void getCloseAfterSelectionOne() { try { if (Closed != null) { ObjectSelect = Lst_Liste.SelectedItems.OfType <ServiceAccueil.CParametre>().FirstOrDefault(t => t.IsSelect); MyObject = ObjectSelect; Closed(this, new EventArgs()); } } catch (Exception ex) { throw ex; } }
private void Regroupement_OkClicked(object sender, EventArgs e) { try { Shared.UcListeParametre ctrs = sender as Shared.UcListeParametre; if (ctrs.isOkClick) { ServiceAccueil.CParametre _LeControleurSelect = ctrs.MyObject as ServiceAccueil.CParametre; this.Txt_LibelleRegroupement.Text = string.IsNullOrEmpty(_LeControleurSelect.LIBELLE) ? string.Empty : _LeControleurSelect.LIBELLE; this.Txt_LibelleRegroupement.Tag = _LeControleurSelect.CODE; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void controller_OkClicked(object sender, EventArgs e) { try { Shared.UcListeParametre ctrs = sender as Shared.UcListeParametre; if (ctrs.isOkClick) { ServiceAccueil.CParametre _LeControleurSelect = ctrs.MyObject as ServiceAccueil.CParametre; this.Txt_AgentRecourvrement.Text = string.IsNullOrEmpty(_LeControleurSelect.CODE) ? string.Empty : _LeControleurSelect.CODE; this.Txt_LibelleAgentRecouvrement.Text = string.IsNullOrEmpty(_LeControleurSelect.LIBELLE) ? string.Empty : _LeControleurSelect.LIBELLE; this.Txt_AgentRecourvrement.Tag = ListeTourneepIA.FirstOrDefault(t => t.MATRICULEPIA == _LeControleurSelect.CODE);; ListeTourneepIASelect = ListeTourneepIA.Where(t => t.FK_IDCENTRE == (int)this.Txt_Centre.Tag && t.NOMAGENTPIA == _LeControleurSelect.LIBELLE).ToList(); if (ListeTourneepIASelect != null && ListeTourneepIASelect.Count != 0) { this.btnzone.IsEnabled = true; } } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void dgMyDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DataGrid dg = (sender as DataGrid); var allObjects = dg.ItemsSource as List <ServiceAccueil.CParametre>; if (!IsMultiselect) { allObjects.ForEach(t => t.IsSelect = false); } if (dg.SelectedItem != null) { ServiceAccueil.CParametre SelectedObject = (ServiceAccueil.CParametre)dg.SelectedItem; if (SelectedObject.IsSelect == false) { SelectedObject.IsSelect = true; } else { SelectedObject.IsSelect = false; } } }