public ActionResult Edit([Bind(Include = "Id,Players,SponsorLogoUrl,Organizer,Deadline,Sport,TournamentName,Date,Location,ParticipantsLimit")] Tournament tournament)
 {
     if (tournament.Deadline == null)
     {
         tournament.Deadline = tournament.Date;
     }
     if (tournament.Deadline > tournament.Date)
     {
         ViewBag.errorMessage = "Deadline must be placed before start of the tournament.";
         return(View(tournament));
     }
     if (tournament.Date < DateTime.Now)
     {
         ViewBag.errorMessage = "You can't upload past tournaments.";
         return(View(tournament));
     }
     ModelState.Clear();
     TryValidateModel(tournament);
     if (ModelState.IsValid)
     {
         db.Entry(tournament).State = EntityState.Modified;
         db.SaveChanges();
         return(View("Index", db.Tournament.ToList()));
     }
     return(View(tournament));
 }
 public ActionResult Edit([Bind(Include = "Id,name,location,discipline,organisator,requestLimit,deadline,playersCount")] Tournament tournament)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tournament).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tournament));
 }