private void GetDropTipoDuplicata() { TIPODUPLICATAProvider TIPODUPLICATAP = new TIPODUPLICATAProvider(); TIPODUPLICATAColl = TIPODUPLICATAP.ReadCollectionByParameter(null, "NOME"); cbTipo.DisplayMember = "NOME"; cbTipo.ValueMember = "IDTIPODUPLICATA"; TIPODUPLICATAEntity TIPODUPLICATATy = new TIPODUPLICATAEntity(); TIPODUPLICATATy.NOME = ConfigMessage.Default.MsgDrop; TIPODUPLICATATy.IDTIPODUPLICATA = -1; TIPODUPLICATAColl.Add(TIPODUPLICATATy); Phydeaux.Utilities.DynamicComparer <TIPODUPLICATAEntity> comparer = new Phydeaux.Utilities.DynamicComparer <TIPODUPLICATAEntity>(cbTipo.DisplayMember); TIPODUPLICATAColl.Sort(comparer.Comparer); cbTipo.DataSource = TIPODUPLICATAColl; cbTipo.SelectedIndex = 0; }
private static TIPODUPLICATACollection ExecuteReader(ref TIPODUPLICATACollection collection, ref FbDataReader dataReader, FbCommand dbCommand) { using (dataReader = dbCommand.ExecuteReader()) { collection = new TIPODUPLICATACollection(); if (dataReader.HasRows) { while (dataReader.Read()) { collection.Add(FillEntityObject(ref dataReader)); } } if (!(dataReader.IsClosed)) { dataReader.Close(); } dataReader.Dispose(); } return(collection); }