public IEnumerable <Review> GetReviews(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Reviews.Include(x => x.Book).Include(x => x.ApplicationUser) .Where(delegate(Review r) { if (MyConvert.ConvertToUnSign(r.Book.NameBook.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(r.ApplicationUser.Email.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(r.Comment.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || r.Book.NameBook.ToUpper().Contains(keyword.ToUpper()) || r.ApplicationUser.Email.ToUpper().Contains(keyword.ToUpper()) || r.Comment.Contains(keyword)) { return true; } else { return false; } } ).AsEnumerable()); } return(_dbContext.Reviews.Include(x => x.Book).Include(x => x.ApplicationUser).AsEnumerable()); }
public IEnumerable <District> GetShippingLocations(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Districts.Include(x => x.City).Where(delegate(District d) { if (MyConvert.ConvertToUnSign(d.City.city.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(d.district.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || d.district.ToUpper().Contains(keyword.ToUpper()) || d.City.city.ToUpper().Contains(keyword.ToUpper())) { return true; } else { return false; } }) .AsEnumerable()); } return(_dbContext.Districts.Include(x => x.City).AsEnumerable()); }
public IEnumerable <Contact> GetContacts(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Contacts .Where(delegate(Contact c) { if (MyConvert.ConvertToUnSign(c.Email.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(c.Status.AsString(EnumFormat.Description).ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(c.Name.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || c.Email.ToUpper().Contains(keyword.ToUpper()) || c.Status.AsString(EnumFormat.Description).ToUpper().Contains(keyword.ToUpper()) || String.Format("{0:d/M/yyyy}", c.Date).ToUpper().Contains(keyword.ToUpper()) || c.Phone.ToUpper().Contains(keyword.ToUpper())) { return true; } else { return false; } }).AsEnumerable()); } return(_dbContext.Contacts.AsEnumerable()); }
public IEnumerable <Categories> GetCategories(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Categories.Where(delegate(Categories c) { if (MyConvert.ConvertToUnSign(c.Category.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || c.Category.ToUpper().Contains(keyword.ToUpper())) { return true; } else { return false; } }) .AsEnumerable()); } return(_dbContext.Categories.AsEnumerable()); }
public IEnumerable <Publisher> GetPublishers(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Publishers.Where(delegate(Publisher p) { if (MyConvert.ConvertToUnSign(p.publisher.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || p.publisher.ToUpper().Contains(keyword.ToUpper())) { return true; } else { return false; } }) .AsEnumerable()); } return(_dbContext.Publishers.AsEnumerable()); }
public IEnumerable <Book> GetBooksForUser(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_dbContext.Books.Include(x => x.Reviews) .Where(delegate(Book b) { if (MyConvert.ConvertToUnSign(b.NameBook.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || MyConvert.ConvertToUnSign(b.Author.ToUpper()).IndexOf(keyword.ToUpper(), StringComparison.CurrentCultureIgnoreCase) >= 0 || b.NameBook.ToUpper().Contains(keyword.ToUpper()) || b.Author.ToUpper().Contains(keyword.ToUpper())) { return true; } else { return false; } }) .AsEnumerable()); } return(_dbContext.Books.Include(x => x.Reviews).AsEnumerable()); }