public ActionResult Index(string SearchString) { if (!string.IsNullOrEmpty(SearchString)) { return(View(Dao.ListAll().Where(x => x.LanguageId.Contains(SearchString) || x.Description.Contains(SearchString)).OrderBy(x => x.LanguageId).ToList())); } else { return(View(Dao.ListAll().OrderBy(x => x.LanguageId).ToList())); } }
public ActionResult Add() { ViewBag.CategoryId = new SelectList(DaoCategories.ListAllByTaxonomy("Product"), "Id", "Title"); ViewBag.LanguageId = new SelectList(DaoLanguage.ListAll(), "LanguageId", "Description", "vi"); return(View()); }