Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
        public Core.Business.WaterElectricityFees Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectWaterElectricityFees);

            if (reader != null && !reader.IsClosed && 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);

                reader.Close();
                return waterElectricityFees;

            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }