private static CAMPOSTELACollection ExecuteReader(ref CAMPOSTELACollection collection, ref FbDataReader dataReader, FbCommand dbCommand) { using (dataReader = dbCommand.ExecuteReader()) { collection = new CAMPOSTELACollection(); if (dataReader.HasRows) { while (dataReader.Read()) { collection.Add(FillEntityObject(ref dataReader)); } } if (!(dataReader.IsClosed)) { dataReader.Close(); } dataReader.Dispose(); } return(collection); }
private void GetCamposTela(int IdTela) { cbCamposTela.DisplayMember = "NOMECAMPOS"; cbCamposTela.ValueMember = "IDCAMPOSTELA"; RowsFiltroCollection RowsFiltroCamposTela = new RowsFiltroCollection(); RowsFiltroCamposTela.Add(new RowsFiltro("IDTELA", "System.Int32", "=", IdTela.ToString())); CAMPOSTELAColl = CAMPOSTELAP.ReadCollectionByParameter(RowsFiltroCamposTela, "NOMECAMPOS"); CAMPOSTELAEntity CAMPOSTELATy = new CAMPOSTELAEntity(); CAMPOSTELATy.NOMECAMPOS = ConfigMessage.Default.MsgDrop; CAMPOSTELATy.IDCAMPOSTELA = -1; CAMPOSTELAColl.Add(CAMPOSTELATy); Phydeaux.Utilities.DynamicComparer <CAMPOSTELAEntity> comparer = new Phydeaux.Utilities.DynamicComparer <CAMPOSTELAEntity>(cbCamposTela.DisplayMember); CAMPOSTELAColl.Sort(comparer.Comparer); cbCamposTela.DataSource = CAMPOSTELAColl; cbCamposTela.SelectedIndex = 0; }