Exemplo n.º 1
0
        public static HBankRateCollection HBankRateGetAllItemByHouseCode(string HouseCode)
        {
            HBankRateCollection ItemCollection = new HBankRateCollection();
            HBankRate           item;

            try
            {
                Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
                DbCommand dbCommand = db.GetStoredProcCommand("HBankRate_GetByHouseCode");

                db.AddInParameter(dbCommand, "HousceCode", DbType.String, HouseCode);
                using (IDataReader dataReader = db.ExecuteReader(dbCommand))
                {
                    while (dataReader.Read())
                    {
                        item = GetItemFromReader(dataReader);
                        ItemCollection.Add(item);
                    }
                }
            }
            catch (Exception objEx)
            {
                item = new HBankRate()
                {
                    HousceCode = objEx.Message
                };
                ItemCollection.Add(item);
            }


            return(ItemCollection);
        }
Exemplo n.º 2
0
        public static HBankRateCollection GetAllItem()
        {
            HBankRateCollection collection = new HBankRateCollection();

            using (var reader = SqlHelper.ExecuteReader("HBankRate_GetList", null))
            {
                HBankRate objItem;
                while (reader.Read())
                {
                    objItem = GetItemFromReader(reader);
                    if (objItem != null)
                    {
                        collection.Add(objItem);
                    }
                }
            }
            return(collection);
        }
Exemplo n.º 3
0
        public static HBankRateCollection HBankRateDefaultByHouseCode(DBtblHouseBanking objHouseItem)
        {
            HBankRateCollection collection = new HBankRateCollection();

            if (objHouseItem != null)
            {
                HBankRate objItem;
                for (int i = 0; i < objHouseItem.BYear; i++)
                {
                    objItem = new HBankRate()
                    {
                        HouseRateID = 0,
                        Year        = i + 1,
                        Rate        = objHouseItem.BRate
                    };
                    collection.Add(objItem);
                }
            }
            return(collection);
        }