public ActionResult Edit([Bind(Include = "batch_id,batch1,Year")] batch batch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(batch).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(batch));
 }
 public ActionResult Edit([Bind(Include = "course_id,course1,Duration")] course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "id,FirstName,lastName,username,password")] user_ user_)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user_).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user_));
 }
 public ActionResult Edit([Bind(Include = "person_id,FirstName,LastName,nic,course_id,batch_id,Contact")] registration registration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(registration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.batch_id  = new SelectList(db.batches, "batch_id", "batch1", registration.batch_id);
     ViewBag.course_id = new SelectList(db.courses, "course_id", "course1", registration.course_id);
     return(View(registration));
 }