public DataTable List(string search) { var dt = model.List(search); if (dt == null) { return(null); } var tb = new DataTable(); tb.Columns.Add("ID"); tb.Columns.Add("Ten"); tb.Columns.Add("DonGiaNhap"); tb.Columns.Add("DonGiaBan"); tb.Columns.Add("SLTon"); foreach (var item in dt) { tb.Rows.Add(item.ID, item.Ten, item.DonGiaNhap, item.DonGiaBan, item.SLTon); } return(tb); }
public List <HANG> GetAllHang() { var dt = modelhang.List(null); if (dt == null) { view.Message = "Resource not found!"; return(null); } return(dt); }