public Shipper getshipper(int id, string companyName, string phone) { var query = Dbset.AsQueryable(); query = query.Where(x => x.ShipperId == id && x.CompanyName == companyName && x.Phone == phone); return(query.FirstOrDefault()); }
public List <Cart> Carts(string customerId) { var query = Dbset.AsQueryable(); query = query.Include(x => x.Customer).Where(x => x.CustomerId == customerId); return(query.ToList()); }
public OrderDetail getOrderDetail(int OrderId, int productId) { var query = Dbset.AsQueryable(); query = query.Where(x => x.OrderId == OrderId && x.ProductId == productId); return(query.FirstOrDefault()); }
public Product getProduct(int productId, string ProductName) { var query = Dbset.AsQueryable(); query = query.Where(x => x.ProductId == productId && x.ProductName == ProductName); return(query.FirstOrDefault()); }
public Category getCategory(int categoryId, string categoryName) { var query = Dbset.AsQueryable(); query = query.Where(x => x.CategoryId == categoryId && x.CategoryName == categoryName); return(query.FirstOrDefault()); }
public Order getOrder(int OrderId, string customerId, int?employeeId) { var query = Dbset.AsQueryable(); query = query.Where(x => x.CustomerId == customerId && x.OrderId == OrderId && x.EmployeeId == employeeId); return(query.FirstOrDefault()); }
public Employee GetInfor(int id) { var query = Dbset.AsQueryable(); query = query.Where(x => x.EmployeeId == id); return(query.FirstOrDefault()); }
public Employee getEmployee(int EmployeeId, string FirstName, string lastName) { var query = Dbset.AsQueryable(); query = query.Where(x => x.EmployeeId == EmployeeId && x.FirstName == FirstName && x.LastName == lastName); return(query.FirstOrDefault()); }
public Customer SignIn(string User, string Pass) { var query = Dbset.AsQueryable(); query = query.Where(x => x.User == User && x.Password == Pass); return(query.FirstOrDefault()); }
public Customer GetById(string customerId) { var query = Dbset.AsQueryable(); query = query.Where(x => x.CustomerId == customerId); return(query.FirstOrDefault()); }
public Customer getCustomer(string customerId, string ContactName, string CompanyName) { var query = Dbset.AsQueryable(); query = query.Where(x => x.CustomerId == customerId && x.ContactName == ContactName && x.CompanyName == CompanyName); return(query.FirstOrDefault()); }
public List <Order> Search(int currentPage, int pageSize, string textSearch, string sortColumn, string sortDirection, out int totalPage) { currentPage = (currentPage <= 0) ? 1 : currentPage; pageSize = (pageSize <= 0) ? 20 : pageSize; var query = Dbset.AsQueryable(); totalPage = query.Count(); if (!string.IsNullOrEmpty(sortColumn)) { query = query.OrderByField(sortColumn.Trim(), sortDirection); } else { query = query.OrderByDescending(c => c.OrderId); } return(query.Skip((currentPage - 1) * pageSize).Take(pageSize).ToList()); }
public List <Cart> GetAllProduct() { var query = Dbset.AsQueryable(); return(query.ToList()); }
public List <Category> GetListCategory() { var query = Dbset.AsQueryable(); return(query.ToList()); }