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)); }
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 = "LecturerID,LecturerName")] Lecturer lecturer) { if (ModelState.IsValid) { db.Entry(lecturer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lecturer)); }
public ActionResult Edit([Bind(Include = "StudentID,StudentFName,StudentLName")] Student student) { if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentID = new SelectList(db.StudentSubjects, "StudentID", "StudentID", student.StudentID); return(View(student)); }
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)); }