public ActionResult History(int id) { var stockItem = stockItemService.GetById(id); var viewData = new StockItemHistoryViewData { StockItem = stockItem, History = stockItem.History, Start = stockItem.History.Min(x => x.DateTime), End = stockItem.History.Max(x => x.DateTime) }; return View("History", viewData); }
public ActionResult HistoryQuery(StockItemHistoryQuery query) { var stockItem = stockItemService.GetById(query.StockItemId); var history = stockItemService.GetHistory(stockItem, query.Start, query.End).ToList(); var viewData = new StockItemHistoryViewData { StockItem = stockItem, History = history, Start = query.Start, End = query.End }; return View("History", viewData); }