public static DataTable getDataTableDachSachMaQuanLi(string ID, bool NhapHang = false) { DataTable dt = null; using (PTTKHTEntities context = new PTTKHTEntities()) { if (NhapHang) { string query = String.Format("select * from HangHoa where QuanLy={0} and SoLuongTon<SLmin", ID); dt = context.DataTable(query); } else { string query = String.Format("select * from HangHoa where QuanLy={0}", ID); dt = context.DataTable(query); } } return(dt); }
public static DataTable getDataTable(string search) { DataTable dt = null; using (PTTKHTEntities context = new PTTKHTEntities()) { if (search != "") { List <DoiTacQuangCao> LoaiHangs = context.DoiTacQuangCaos.ToList(); string query = String.Format("select * from DoiTacQuangCao where TenDoiTac like '%{0}%'", search); dt = context.DataTable(query); } else { dt = context.DataTable(( from lh in context.DoiTacQuangCaos select lh ).ToString()); } } return(dt); }
public static DataTable getDataTable(string search) { DataTable dt = null; using (PTTKHTEntities context = new PTTKHTEntities()) { if (search != "") { List <NhanVien> LoaiHangs = context.NhanViens.ToList(); string query = String.Format("select * from NhanVien where HoTen like '%{0}%'", search); dt = context.DataTable(query); } else { dt = context.DataTable(( from lh in context.NhanViens select lh ).ToString()); } } return(dt); }