public IList<Core.Business.WaterElectricityFees> GetAllWaterElectricityFees() { IList<Core.Business.WaterElectricityFees> waterElectricityFeeslist = new List<Core.Business.WaterElectricityFees>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllWaterElectricityFees); if(reader != null) { while(reader.Read()) { Core.Business.WaterElectricityFees waterElectricityFees = new Core.Business.WaterElectricityFees(); if (!reader.IsDBNull(0)) waterElectricityFees.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) waterElectricityFees.RcdCate = reader.GetString(1); if (!reader.IsDBNull(2)) waterElectricityFees.RoomNbr = reader.GetString(2); if (!reader.IsDBNull(3)) waterElectricityFees.Deposit = reader.GetDecimal(3); if (!reader.IsDBNull(4)) waterElectricityFees.BuildingNbr = reader.GetString(4); if (!reader.IsDBNull(5)) waterElectricityFees.YearNum = reader.GetString(5); if (!reader.IsDBNull(6)) waterElectricityFees.MonthNum = reader.GetInt32(6); waterElectricityFees.MarkOld(); waterElectricityFeeslist.Add(waterElectricityFees); } reader.Close(); } return waterElectricityFeeslist; }
public IList<WaterElectricityFees> IsExists(string roomNbr, string buildingNbr, string rcdCate, string year, int month) { IList<Core.Business.WaterElectricityFees> waterElectricityFeeslist = new List<Core.Business.WaterElectricityFees>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@roomNbr",SqlDbType.NVarChar,roomNbr); sql.AddParameter("@buildingNbr",SqlDbType.NVarChar,buildingNbr); sql.AddParameter("@rcdCate",SqlDbType.NVarChar,rcdCate); sql.AddParameter("@yearNum", SqlDbType.NVarChar, year); sql.AddParameter("@monthNum",SqlDbType.Int,month); SqlDataReader reader = sql.ExecuteSqlReader(SqlIsExists); if (reader != null) { while (reader.Read()) { Core.Business.WaterElectricityFees waterElectricityFees = new Core.Business.WaterElectricityFees(); if (!reader.IsDBNull(0)) waterElectricityFees.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) waterElectricityFees.RcdCate = reader.GetString(1); if (!reader.IsDBNull(2)) waterElectricityFees.RoomNbr = reader.GetString(2); if (!reader.IsDBNull(3)) waterElectricityFees.Deposit = reader.GetDecimal(3); if (!reader.IsDBNull(4)) waterElectricityFees.BuildingNbr = reader.GetString(4); if (!reader.IsDBNull(5)) waterElectricityFees.YearNum = reader.GetString(5); if (!reader.IsDBNull(6)) waterElectricityFees.MonthNum = reader.GetInt32(6); waterElectricityFees.MarkOld(); waterElectricityFeeslist.Add(waterElectricityFees); } reader.Close(); } return waterElectricityFeeslist; }