Beispiel #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email")] Driver driver)
 {
     if (ModelState.IsValid)
     {
         db.Entry(driver).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(driver));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] SiblingGroup siblingGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(siblingGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(siblingGroup));
 }
 public ActionResult Edit([Bind(Include = "Id,SiblingId,Busydate")] UnavailableDate unavailableDate)
 {
     if (ModelState.IsValid)
     {
         db.Entry(unavailableDate).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("MyDates"));
     }
     ViewBag.SiblingId = new SelectList(db.Siblings, "Id", "FirstName", unavailableDate.SiblingId);
     return(View(unavailableDate));
 }
 public ActionResult Edit([Bind(Include = "Id,GroupId,FirstName,LastName,Address,PhoneNumber,Email")] Sibling sibling)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sibling).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GroupId = new SelectList(db.SiblingGroups, "Id", "Name", sibling.GroupId);
     return(View(sibling));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "Id,GroupId,VisitStart,VisitEnd,DriverId")] Visit visit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(visit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DriverId = new SelectList(db.Drivers, "Id", "Name", visit.DriverId);
     ViewBag.GroupId  = new SelectList(db.SiblingGroups, "Id", "Name", visit.GroupId);
     return(View(visit));
 }