public List <ElementAnatomique> GetBindingUnitDataAnatomie(Grid grid) { List <ElementAnatomique> elements = new List <ElementAnatomique>(); foreach (UnitDataBiometrie control in grid.Children) { object o = control.DataContext; ElementAnatomique elt = o as ElementAnatomique; if (elt is ElementAnatomique) { elements.Add(elt); } } return(elements); }
public List <ElementAnatomique> GetBindingUnitAnatomie(Grid grid) { List <ElementAnatomique> elements = new List <ElementAnatomique>(); foreach (Panel control in grid.Children) { Grid g = control as Grid; if (g is Grid) { if (g.Background.ToString() == "#00FFFFFF") { object o = g.DataContext; ElementAnatomique elt = o as ElementAnatomique; if (elt is ElementAnatomique) { elements.Add(elt); } } } } return(elements); }
public List <ElementAnatomique> GetElementsAnatomiques1T() { FbConnection connexion = new FbConnection(ChaineConnection()); List <ElementAnatomique> l = new List <ElementAnatomique>(); using (FbCommand commande = connexion.CreateCommand()) { commande.CommandText = "GET_ELEMENTS_MORPHO_1T"; commande.CommandType = System.Data.CommandType.StoredProcedure; try { connexion.Open(); FbDataReader reader = commande.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { ElementAnatomique a = new ElementAnatomique(); a.CleElement = (int)reader[0]; a.Label = (string)reader[1]; a.Evaluation = -1; l.Add(a); } connexion.Close(); return(l); } connexion.Close(); return(null); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); connexion.Close(); return(null); } } }