コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }