Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Sex sex)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sex).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sex));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,SexId,Email")] Parent parent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(parent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SexId = new SelectList(db.Sexes, "Id", "Name", parent.SexId);
     return(View(parent));
 }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,SexId,Birthday,ParentId")] Child child)
 {
     if (ModelState.IsValid)
     {
         db.Entry(child).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ParentId = new SelectList(db.Parents, "Id", "Name", child.ParentId);
     ViewBag.SexId    = new SelectList(db.Sexes, "Id", "Name", child.SexId);
     return(View(child));
 }