コード例 #1
0
 public ActionResult Edit([Bind(Include = "AgentId,ImagePath,FirstName,LastName,Cellphone,Email")] Agent agent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(agent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(agent));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "LeadId,FirstName,LastName,Email,Message")] Lead lead)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lead).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(lead));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "ListingId,ImagePath,Price,Bedrooms,RefNumber,Description,Suburb,AgentId,MarketingHeading")] Listing listing)
 {
     if (ModelState.IsValid)
     {
         db.Entry(listing).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AgentId = new SelectList(db.Agents, "AgentId", "ImagePath", listing.AgentId);
     return(View(listing));
 }