예제 #1
0
 public ActionResult Edit([Bind(Include = "Student_email")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Course_ID,Course_name,Credits,Requisites,Requisite")] 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 = "Term_ID,Course_ID,Student_email,Grade1")] Grade grade)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grade).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Course_ID     = new SelectList(db.Courses, "Course_ID", "Course_ID", grade.Course_ID);
     ViewBag.Student_email = new SelectList(db.Students, "Student_email", "Student_email", grade.Student_email);
     ViewBag.Term_ID       = new SelectList(db.Terms, "Term_ID", "Term_ID", grade.Term_ID);
     return(View(grade));
 }