コード例 #1
0
 public ActionResult Edit([Bind(Include = "FirstName,LastName,Email,ExcursionID")] Member member, int id)
 {
     member.MemberID = id;
     if (ModelState.IsValid)
     {
         db.Entry(member).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { id = member.ExcursionID }));
     }
     return(View(member));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Location,Budget,LeadID,ExcursionID,Start_Date,End_Date")] Excursion excursion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(excursion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LeadID = new SelectList(db.AspNetUsers, "Id", "FirstName", excursion.LeadID);
     return(View(excursion));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "Genre,URL,Image,IsFinal,ChoiceID,ExcursionID,ChoiceName,Votes")] Choice choice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(choice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ExcursionID = new SelectList(db.Excursions, "ExcursionID", "Location", choice.ExcursionID);
     return(View(choice));
 }