Example #1
0
 public ActionResult Edited(Student student)
 {
     if (ModelState.IsValid)
     {
         StudentDAO Student_DAO = new StudentDAO();
         Student_DAO.UpdateStudentInfoWithStudentId(student);
         return(View(Student_DAO.GetStudenInfoForEditing(student.StudentId)));
     }
     else
     {
         return(View("Edit"));
     }
 }
Example #2
0
 public ActionResult Edit(int id)
 {
     if (id == 0)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (ModelState.IsValid)
     {
         StudentDAO Student_DAO = new StudentDAO();
         return(View(Student_DAO.GetStudenInfoForEditing(id)));
     }
     else
     {
         ModelState.AddModelError("", "Sorry Student information is not found.");
         return(View("SearchStudent"));
     }
 }