예제 #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Male")] Fluss fluss)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fluss).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fluss));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Vorname,Familienname,GeborenInId")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GeborenInId = new SelectList(db.NamedObjects, "Id", "Name", person.GeborenInId);
     return(View(person));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,LiegtInId")] Stadt stadt)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stadt).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LiegtInId = new SelectList(db.Laender, "Id", "Name", stadt.LiegtInId);
     return(View(stadt));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "Id,Name,HauptStadtId")] Land land)
 {
     if (ModelState.IsValid)
     {
         db.Entry(land).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HauptStadtId = new SelectList(db.Staedte, "Id", "Name", land.HauptStadtId);
     return(View(land));
 }