private void GetDropStatus() { try { STATUSTLMKProvider STATUSTLMKP = new STATUSTLMKProvider(); STATUSTLMKCollection STATUSTLMKColl = new STATUSTLMKCollection(); STATUSTLMKColl = STATUSTLMKP.ReadCollectionByParameter(null, "NOME"); cbStatus.DisplayMember = "NOME"; cbStatus.ValueMember = "IDSTATUSTLMK"; STATUSTLMKEntity STATUSTLMKTy = new STATUSTLMKEntity(); STATUSTLMKTy.NOME = ConfigMessage.Default.MsgDrop; STATUSTLMKTy.IDSTATUSTLMK = -1; STATUSTLMKColl.Add(STATUSTLMKTy); Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity> comparer = new Phydeaux.Utilities.DynamicComparer <STATUSTLMKEntity>(cbStatus.DisplayMember); STATUSTLMKColl.Sort(comparer.Comparer); cbStatus.DataSource = STATUSTLMKColl; } catch (Exception ex) { MessageBox.Show("Erro técnico: " + ex.Message); } }
private static STATUSTLMKCollection ExecuteReader(ref STATUSTLMKCollection collection, ref FbDataReader dataReader, FbCommand dbCommand) { using (dataReader = dbCommand.ExecuteReader()) { collection = new STATUSTLMKCollection(); if (dataReader.HasRows) { while (dataReader.Read()) { collection.Add(FillEntityObject(ref dataReader)); } } if (!(dataReader.IsClosed)) { dataReader.Close(); } dataReader.Dispose(); } return(collection); }