public ActionResult ShowUnchecked() { var lots = service.GetAllByPredicate(l => l.IsChecked == false); var list = new ListLotViewModel(); list.lots = new List <LotViewModel>(); foreach (LotEntity lot in lots) { list.lots.Add(lot.ToLotViewModel()); } list.lots = list.lots.OrderBy(e => e.EndDate).ToList(); ViewBag.lots = list; return(View()); }
public ActionResult Index(string word) { IEnumerable <LotEntity> lots = null; if (word != null) { lots = service.GetAllByPredicate(l => l.IsChecked == true && l.Name.Contains(word)); } else { lots = service.GetAllByPredicate(l => l.IsChecked == true); } var list = new ListLotViewModel(); list.lots = new List <LotViewModel>(); foreach (LotEntity lot in lots) { list.lots.Add(lot.ToLotViewModel()); } ViewBag.lots = list; return(View()); }