Ejemplo n.º 1
0
 public ActionResult Edit(CourseTable course)
 {
     try
     {
         // TODO: Add update logic here
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(StudentTable student)
 {
     try
     {
         // TODO: Add update logic here
         if (student.StudentPassword.Length < 20)
         {
             student.StudentPassword = getHash(student.StudentPassword);
         }
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Homepage", new { id = student.StudentId }));
     }
     catch
     {
         return(View());
     }
 }
Ejemplo n.º 3
0
 public ActionResult Edit(TeacherTable teacher)
 {
     try
     {
         // TODO: Add update logic here
         if (teacher.TeacherPassword.Length < 20)
         {
             teacher.TeacherPassword = getHash(teacher.TeacherPassword);
         }
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("HomePage", new { id = teacher.TeacherId }));
     }
     catch
     {
         return(View());
     }
 }