public DataTable List(string search) { var dt = model.List(search); if (dt == null) { view.Message = "Resource not found!. null"; return(null); } var tb = new DataTable(); tb.Columns.Add("ID"); tb.Columns.Add("Ten"); tb.Columns.Add("GiaNgay"); tb.Columns.Add("GiaDem"); foreach (var item in dt) { tb.Rows.Add(item.ID, item.Ten, item.GiaNgay, item.GiaDem ); } return(tb); }
public List <LOAIPHONG> GetAllLoaiPhong() { var dt = modelLoaiPhong.List(null); if (dt == null) { view.Message = "Resource not found!"; return(null); } return(dt); }