Пример #1
0
        public async Task <IActionResult> Navigator(string input = null)
        {
            _logger.LogInformation("veiw navigator");
            var viewModel = new NavigatorViewModels
            {
                Navigators = navigator.GetNavigators(User.Identity.Name),
                Text       = input
            };

            if (!(viewModel.Navigators[0] == null))
            {
                TempData["Navigators"] = viewModel.Navigators.Select(x => x.Id).ToArray();
            }
            return(this.View(viewModel));
        }
Пример #2
0
        public async Task <IActionResult> RallyЕntry(string input = null)
        {
            _logger.LogInformation("Vieew Rally Еntry");
            var user = User.Identity.Name;
            var team = await teams.FindUserAsync(user);

            var viewModel = new TeamViewModels
            {
                Id              = team.Id,
                Name            = team.Name,
                Cars            = cars.GetCar(user).Result,
                StartRaceDate   = competitions.GetStartDate().Result.ToString("D"),
                RallyPilots     = pilots.GetPilots(user),
                RallyNavigators = navigators.GetNavigators(user),
                Runway          = await runways.GetRunwayForCurrentRaceAsync(),
                TeamId          = await teams.GetTeamIdAsync(user),
                CompetitionId   = competitions.GetCompetitionId().Result,
                CompetitionName = competitions.GetCompetitionName().Result,
                Text            = input,
            };

            return(this.View(viewModel));
        }