Exemple #1
0
        public async Task <IActionResult> Create([Bind("PlayerID,PlayerFname,PlayerLname,DoB,Address")] Player player)
        {
            if (ModelState.IsValid)
            {
                _context.Add(player);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(player));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("EventID,Eventname,StartDate,EndDate,EventDuration")] Event @event)
        {
            if (ModelState.IsValid)
            {
                _context.Add(@event);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(@event));
        }
        public async Task <IActionResult> Create([Bind("Fixture_Id,vs_Team,Country,Date,Ground_Name")] Fixture fixture)
        {
            if (ModelState.IsValid)
            {
                _context.Add(fixture);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(fixture));
        }
Exemple #4
0
        public async Task <IActionResult> Create([Bind("ID,PlayerID,EventID")] Ranking ranking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ranking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EventID"]  = new SelectList(_context.Event, "EventID", "EventID", ranking.EventID);
            ViewData["PlayerID"] = new SelectList(_context.Player, "PlayerID", "PlayerID", ranking.PlayerID);
            return(View(ranking));
        }