public ActionResult Edit([Bind(Include = "StatisticId,Picture")] Statistic statistic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(statistic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(statistic));
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "TeamId,Name,Image")] Team team)
 {
     if (ModelState.IsValid)
     {
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(team));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "CoachId,Name")] Coach coach)
 {
     if (ModelState.IsValid)
     {
         db.Entry(coach).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CoachId = new SelectList(db.team, "TeamId", "Name", coach.CoachId);
     return(View(coach));
 }
 public ActionResult Edit([Bind(Include = "ID,Name,LastName,TeamId,Age,DateOfBirth,Nationality,Picture,Position,Number")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeamId = new SelectList(db.team, "TeamId", "Name", player.TeamId);
     return(View(player));
 }
 public ActionResult Edit([Bind(Include = "MatchDetailsId,Content,MatchId")] MatchDetails matchDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(matchDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     // ViewBag.MatchId = new SelectList(db.matches, "MatchId", "MatchId", matchDetails.MatchId);
     return(View(matchDetails));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "ID,Ime,Prezime,PrimeniGolovi,TeamId")] GoalKeeper goalKeeper)
 {
     if (ModelState.IsValid)
     {
         db.Entry(goalKeeper).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeamId = new SelectList(db.team, "TeamId", "Name", goalKeeper.TeamId);
     return(View(goalKeeper));
 }
 public ActionResult Edit([Bind(Include = "MatchDetailsId,Min,ID,StatisticId")] MatchDetails matchDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(matchDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     // ViewBag.MatchId = new SelectList(db.matches, "MatchId", "MatchId", matchDetails.MatchId);
     ViewBag.ID          = new SelectList(db.player, "ID", "Ime", matchDetails.ID);
     ViewBag.StatisticId = new SelectList(db.statistic, "StatisticId", "Picture", matchDetails.StatisticId);
     return(View(matchDetails));
 }
Пример #8
0
 public ActionResult Edit([Bind(Include = "MatchId,HomeTeamId,GuestTeamId,HomeGoals,AwayGoals,Date,Hours")] Match match, string checkbox)
 {
     if (ModelState.IsValid)
     {
         if (!String.IsNullOrEmpty(checkbox))
         {
             match.Finish = true;
         }
         else
         {
             match.Finish = false;
         }
         db.Entry(match).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GuestTeamId = new SelectList(db.team, "TeamId", "Name", match.GuestTeamId);
     ViewBag.HomeTeamId  = new SelectList(db.team, "TeamId", "Name", match.HomeTeamId);
     return(View(match));
 }