コード例 #1
0
 public ActionResult Edit([Bind(Include = "TeamName,City,Province")] Team team)
 {
     if (ModelState.IsValid)
     {
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(team));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,First_Name,Last_Name,Position,Number,Goals,Assists,City,Team_Name")] Retired_Players retired_Players)
 {
     if (ModelState.IsValid)
     {
         db.Entry(retired_Players).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(retired_Players));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Conference conference)
 {
     if (ModelState.IsValid)
     {
         db.Entry(conference).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(conference));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "PlayerId,LastName,FirstName,Position,TeamName")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeamName = new SelectList(db.Teams, "TeamName", "City", player.TeamName);
     return(View(player));
 }
コード例 #5
0
 public ActionResult Edit([Bind(Include = "Id,Name,Conference_Id")] Division division)
 {
     if (ModelState.IsValid)
     {
         db.Entry(division).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Conference_Id = new SelectList(db.Conferences, "Id", "Name", division.Conference_Id);
     return(View(division));
 }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "Id,First_Name,Last_Name,Position,Number,Goals,Assists,Salary,Team_Id")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Team_Id = new SelectList(db.Teams, "Id", "City", player.Team_Id);
     return(View(player));
 }
コード例 #7
0
 public ActionResult Edit([Bind(Include = "Id,City,Name,Points,Conference_Id,Division_Id")] Team team)
 {
     if (ModelState.IsValid)
     {
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Conference_Id = new SelectList(db.Conferences, "Id", "Name", team.Conference_Id);
     ViewBag.Division_Id   = new SelectList(db.Divisions, "Id", "Name", team.Division_Id);
     return(View(team));
 }