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());
     }
 }
Exemple #2
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 SignUp(AdminTable admin)
 {
     try
     {
         // TODO: Add insert logic here
         admin.AdminPassword = getHash(admin.AdminPassword);
         db.Admins.Add(admin);
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #4
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());
     }
 }