public ActionResult Edit([Bind(Include = "LecturerID,FirstName,LastName,Email,Phone,Address,DateEntered")] Lecturer lecturer) { if (ModelState.IsValid) { db.Entry(lecturer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lecturer)); }
public ActionResult Edit([Bind(Include = "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 = "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 = "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 = "SubjectID,SubjectName,LecturerID")] Subject subject) { if (ModelState.IsValid) { db.Entry(subject).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.LecturerID = new SelectList(db.Lecturers, "LecturerID", "Name", subject.LecturerID); return(View(subject)); }
public ActionResult Edit([Bind(Include = "id,firstname,lastname,nic,Date,batch_id,course_id,phone,email,gender,salary")] Registration registration) { if (ModelState.IsValid) { db.Entry(registration).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.batch_id = new SelectList(db.Batches, "id", "batch1", registration.batch_id); ViewBag.course_id = new SelectList(db.Courses, "id", "course1", registration.course_id); return(View(registration)); }
public ActionResult Edit([Bind(Include = "StudentID,FirstName,LastName,DateOfBirth,Address,DateEntered")] Student student) { student.DateEntered = DateTime.Now; if (ModelState.IsValid) { db.Entry(student).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(student)); }
public ActionResult Edit([Bind(Include = "ID,SubjectID,Grade1,DateEntered,StudentID")] Grade grade) { grade.DateEntered = DateTime.Now; if (ModelState.IsValid) { db.Entry(grade).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details", "Students", new { id = grade.StudentID })); } ViewBag.StudentID = new SelectList(db.Students, "StudentID", "StudentID", grade.StudentID); ViewBag.SubjectID = new SelectList(db.Subjects, "SubjectID", "SubjectName", grade.SubjectID); return(View(grade)); }