public ActionResult Edit([Bind(Include = "SubjectID,SubjectName")] Subject subject)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subject).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subject));
 }
 public ActionResult Edit([Bind(Include = "StudentID,FirstName,SecondName")] Student student)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student));
 }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "LecturerID,LecturerName")] Lecturer lecturer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lecturer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(lecturer));
 }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "AttendanceID,AttendanceDate,SubjectID,StudentID,Present")] Attendance attendance)
 {
     if (ModelState.IsValid)
     {
         db.Entry(attendance).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentID = new SelectList(db.Students, "StudentID", "FirstName", attendance.StudentID);
     ViewBag.SubjectID = new SelectList(db.Subjects, "SubjectID", "SubjectName", attendance.SubjectID);
     return(View(attendance));
 }