public DataTable List(string search) { var dt = model.List(search); if (dt == null) { view.Message = "Resource not found!. null"; } var tb = new DataTable(); tb.Columns.Add("ID"); tb.Columns.Add("Ten"); tb.Columns.Add("StatusId"); tb.Columns.Add("TGStart"); tb.Columns.Add("IdLoaiPhong"); tb.Columns.Add("TenLoaiPhong"); tb.Columns.Add("GiaNgay"); tb.Columns.Add("GiaDem"); foreach (var item in dt) { var loaiphong = modelLoaiPhong.GetOne(item.IdLoaiPhong); tb.Rows.Add(item.ID, item.Ten, item.StatusID, item.TGStart, item.IdLoaiPhong, loaiphong.Ten, loaiphong.GiaNgay, loaiphong.GiaDem); } return(tb); }
public LOAIPHONG GetOne(int id) { return(model.GetOne(id)); }