public async Task <IActionResult> Create([Bind("ArticleID,Date,Title,TeaserText,Image,Text,ExternalLink,ReadmoreLink")] Article article) { if (ModelState.IsValid) { _context.Add(article); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(article)); }
public async Task <IActionResult> Create([Bind("LandID,Landenavn")] Land land) { if (ModelState.IsValid) { _context.Add(land); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(land)); }
public async Task <IActionResult> Create([Bind("StadionID,Navn,AttendanceCapacity")] Stadion stadion) { if (ModelState.IsValid) { _context.Add(stadion); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(stadion)); }
public async Task <IActionResult> Create([Bind("LigaID,Navn,Logo,LandID")] Liga liga) { if (ModelState.IsValid) { _context.Add(liga); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["LandID"] = new SelectList(_context.Land, "LandID", "Landenavn", liga.LandID); return(View(liga)); }
public async Task <IActionResult> Create([Bind("SponsorID,Title,SponsorText,Team2ID")] Sponsor sponsor) { if (ModelState.IsValid) { _context.Add(sponsor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Team2ID"] = new SelectList(_context.Team2s, "Id", "Name", sponsor.Team2ID); return(View(sponsor)); }
public async Task <IActionResult> Create([Bind("Id,Name,Address,StadionID,Seasontickets,Image,Logo,Sponsortext,LigaID")] Team2 team2) { if (ModelState.IsValid) { _context.Add(team2); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StadionID"] = new SelectList(_context.Stadion, "StadionID", "Navn", team2.StadionID); ViewData["LigaID"] = new SelectList(_context.Liga, "LigaID", "Navn", team2.LigaID); return(View(team2)); }
public async Task <IActionResult> Create([Bind("Id,Date,HomeTeamId,AwayTeamId,HomeScore,GuestScore,Attendance,Tv,StadionID,LigaID,IsCorona")] Game game) { if (ModelState.IsValid) { _context.Add(game); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AwayTeamId"] = new SelectList(_context.Team2s, "Id", "Name", game.AwayTeamId); ViewData["HomeTeamId"] = new SelectList(_context.Team2s, "Id", "Name", game.HomeTeamId); ViewData["LigaID"] = new SelectList(_context.Liga, "LigaID", "Navn", game.LigaID); ViewData["StadionID"] = new SelectList(_context.Stadion, "StadionID", "Navn", game.StadionID); return(View(game)); }