示例#1
0
        private void GetDropBanco()
        {
            BANCOProvider BANCOP = new BANCOProvider();

            BANCOColl = BANCOP.ReadCollectionByParameter(null, "NOMEBANCO");

            cbBanco.DisplayMember = "NOMEBANCO";
            cbBanco.ValueMember   = "IDBANCO";

            BANCOEntity BANCOTy = new BANCOEntity();

            BANCOTy.NOMEBANCO = ConfigMessage.Default.MsgDrop;
            BANCOTy.IDBANCO   = -1;
            BANCOColl.Add(BANCOTy);

            Phydeaux.Utilities.DynamicComparer <BANCOEntity> comparer = new Phydeaux.Utilities.DynamicComparer <BANCOEntity>(cbBanco.DisplayMember);

            BANCOColl.Sort(comparer.Comparer);
            cbBanco.DataSource = BANCOColl;

            cbBanco.SelectedIndex = 0;
        }
示例#2
0
        private static BANCOCollection ExecuteReader(ref BANCOCollection collection, ref FbDataReader dataReader, FbCommand dbCommand)
        {
            using (dataReader = dbCommand.ExecuteReader())
            {
                collection = new BANCOCollection();

                if (dataReader.HasRows)
                {
                    while (dataReader.Read())
                    {
                        collection.Add(FillEntityObject(ref dataReader));
                    }
                }

                if (!(dataReader.IsClosed))
                {
                    dataReader.Close();
                }
                dataReader.Dispose();
            }

            return(collection);
        }