public ActionResult Records(int?olympicEventId) { if (!olympicEventId.HasValue) { return(ChooseAnEvent()); } var olympicEvent = _eventService.GetOlympicEventById(olympicEventId.Value); var records = _recordService.GetRecordsByEventId(olympicEventId.Value, onlyBestForCompetitors: true); var viewModel = RecordListViewModel.Build(records, olympicEvent); return(View(viewModel)); }
public ActionResult EditEvent(int olympicEventId) { var olympicEvent = _eventService.GetOlympicEventById(olympicEventId); var eventTypes = _eventTypeService.GetEventTypes(); var viewModel = EditEventViewModel.Build(olympicEvent, eventTypes); ViewBag.EditType = "Edit"; return(View(viewModel)); }