private void GetDropTipoEquipamento() { TIPOMANUTENCAOProvider TIPOMANUTENCAOP = new TIPOMANUTENCAOProvider(); TIPOMANUTENCAOColl = TIPOMANUTENCAOP.ReadCollectionByParameter(null, "NOME"); cbTipoManutencao.DisplayMember = "NOME"; cbTipoManutencao.ValueMember = "IDTIPOMANUTENCAO"; TIPOMANUTENCAOEntity TIPOMANUTENCAOTy = new TIPOMANUTENCAOEntity(); TIPOMANUTENCAOTy.NOME = ConfigMessage.Default.MsgDrop; TIPOMANUTENCAOTy.IDTIPOMANUTENCAO = -1; TIPOMANUTENCAOColl.Add(TIPOMANUTENCAOTy); Phydeaux.Utilities.DynamicComparer <TIPOMANUTENCAOEntity> comparer = new Phydeaux.Utilities.DynamicComparer <TIPOMANUTENCAOEntity>(cbTipoManutencao.DisplayMember); TIPOMANUTENCAOColl.Sort(comparer.Comparer); cbTipoManutencao.DataSource = TIPOMANUTENCAOColl; cbTipoManutencao.SelectedIndex = 0; }
private static TIPOMANUTENCAOCollection ExecuteReader(ref TIPOMANUTENCAOCollection collection, ref FbDataReader dataReader, FbCommand dbCommand) { using (dataReader = dbCommand.ExecuteReader()) { collection = new TIPOMANUTENCAOCollection(); if (dataReader.HasRows) { while (dataReader.Read()) { collection.Add(FillEntityObject(ref dataReader)); } } if (!(dataReader.IsClosed)) { dataReader.Close(); } dataReader.Dispose(); } return(collection); }