示例#1
0
 public ActionResult Edit([Bind(Include = "school_id,school_name,Xth_marks,XIIth_marks")] school school)
 {
     if (ModelState.IsValid)
     {
         db.Entry(school).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(school));
 }
 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));
 }
 public ActionResult Edit([Bind(Include = "user_id,firstname,lastname,username,password")] user user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.user_id = new SelectList(db.users, "user_id", "firstname", user.user_id);
     ViewBag.user_id = new SelectList(db.users, "user_id", "firstname", user.user_id);
     return(View(user));
 }
 public ActionResult Edit([Bind(Include = "register_id,Name,Address,course_id,school_id,telno")] register register)
 {
     if (ModelState.IsValid)
     {
         db.Entry(register).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.course_id = new SelectList(db.courses, "course_id", "Course1", register.course_id);
     ViewBag.school_id = new SelectList(db.schools, "school_id", "school_name", register.school_id);
     return(View(register));
 }