public PhongInfo Phong_GetItem(int PhongID) { SQLDataHelper SQLDB = new SQLDataHelper(); SQLDB.Addparameter("@PhongID", PhongID); SqlDataReader rd = SQLDB.executereader("sp_Phong_GetItem", CommandType.StoredProcedure); PhongInfo item = null; while (rd.Read()) { item = new PhongInfo(); item.PhongID = int.Parse(rd["PhongID"].ToString()); item.PhongName = rd["PhongName"].ToString(); item.LoaiPhongID = int.Parse(rd["LoaiPhongID"].ToString()); item.TienNghiID = int.Parse(rd["TienNghiID"].ToString()); item.SoGiuong = int.Parse(rd["SoGiuong"].ToString()); item.SoNguoi = int.Parse(rd["SoNguoi"].ToString()); item.TienNghiName = rd["TienNghiName"].ToString(); } return item; }
public List<PhongInfo> Phong_GetItems([Optional,DefaultParameterValue(0)] int PhongID) { SQLDataHelper SQLDB = new SQLDataHelper(); SQLDB.Addparameter("@PhongID", PhongID); SqlDataReader rd = SQLDB.executereader("sp_Phong_GetItems", CommandType.StoredProcedure); List<PhongInfo> list = new List<PhongInfo>(); PhongInfo item = null; while (rd.Read()) { item = new PhongInfo(); item.PhongID = int.Parse(rd["PhongID"].ToString()); item.PhongName = rd["PhongName"].ToString(); item.LoaiPhongID = int.Parse(rd["LoaiPhongID"].ToString()); item.LoaiPhongName = rd["LoaiPhongName"].ToString(); item.SoGiuong = int.Parse(rd["SoGiuong"].ToString()); item.SoNguoi = int.Parse(rd["SoNguoi"].ToString()); item.TienNghiName = rd["TienNghiName"].ToString(); list.Add(item); } return list; }
public List<PhongInfo> Phong_GetItemsOnService() { SQLDataHelper SQLDB = new SQLDataHelper(); SqlDataReader rd = SQLDB.executereader("sp_Phong_GetItemsOnService", CommandType.StoredProcedure); List<PhongInfo> list = new List<PhongInfo>(); PhongInfo item = null; while (rd.Read()) { item = new PhongInfo(); item.PhongID = int.Parse(rd["PhongID"].ToString()); item.PhongName = rd["PhongName"].ToString(); list.Add(item); } return list; }