Exemple #1
0
        public async Task <IActionResult> Create([Bind("PositionID,PositionDescription")] PlayerPositions playerPositions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(playerPositions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(playerPositions));
        }
        public async Task <IActionResult> Create([Bind("TeamID,TeamName")] Teams teams)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teams);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teams));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("CompetitionID,CompetitionName")] Competitions competitions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(competitions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(competitions));
        }
        public async Task <IActionResult> Create([Bind("FixtureID,FixtureDate,FixtureTime,HomeTeamID,AwayTeamID,CompetitionID")] Fixtures fixtures)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fixtures);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompetitionID"] = new SelectList(_context.Competitions, "CompetitionID", "CompetitionName", fixtures.CompetitionID);
            return(View(fixtures));
        }
        public async Task <IActionResult> Create([Bind("FixtureID,PlayerID,GoalsScoredID")] PlayerFixtures playerFixtures)
        {
            if (ModelState.IsValid)
            {
                _context.Add(playerFixtures);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FixtureID"] = new SelectList(_context.Fixtures, "FixtureID", "FixtureID", playerFixtures.FixtureID);
            ViewData["PlayerID"]  = new SelectList(_context.Players, "PlayerID", "PlayerID", playerFixtures.PlayerID);
            return(View(playerFixtures));
        }
Exemple #6
0
        public async Task <IActionResult> Create([Bind("PlayerID,TeamID,PlayerName,PlayerSquadNumber,PositionID")] Players players)
        {
            if (ModelState.IsValid)
            {
                _context.Add(players);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PositionID"] = new SelectList(_context.PlayerPositions, "PositionID", "PositionID", players.PositionID);
            ViewData["TeamID"]     = new SelectList(_context.Teams, "TeamID", "TeamName", players.TeamID);
            return(View(players));
        }