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()); }
private static void ShowLots() { try { log.Trace("ShowLots"); var list = lotService.GetAllByPredicate(lot => lot.IsChecked == true).ToList(); if (list != null) { foreach (var lot in list) { Console.WriteLine("N: {0}, Name: {1}, Start Date: {2}, End date: {3}, Description: {4}", lot.Id, lot.Name, lot.StartDate.ToString("dd.MM.yyyy"), lot.EndDate.ToString("dd.MM.yyyy"), lot.Description); } } } catch (SystemException se) { log.Error("Error (ShowLots): Operation with service is wrong: " + se.ToString()); } }