public ActionResult EditStudent(StudentModel model) { HttpCookie loggedStudent = Request.Cookies["LoggedUser"]; UserServices services = new UserServices(); StudentModel student = services.GetStudent(loggedStudent.Values.Get("Login")); services.ChangePassword(student.Login, student.Name, student.Surname, model.Password); UserLoginModel logged = new UserLoginModel(); logged.Login = student.Login; logged.Name = student.Name; logged.Surname = student.Surname; return RedirectToAction("Index",logged); }
public ActionResult EditTeacher(TeacherModel model) { HttpCookie loggedTeacher = Request.Cookies["LoggedUser"]; UserServices services = new UserServices(); TeacherModel teacher = services.GetTeacher(loggedTeacher.Values.Get("Login")); services.ChangePassword(teacher.Login, teacher.Imię, teacher.Nazwisko, model.Hasło); UserLoginModel logged = new UserLoginModel(); logged.Login = model.Login; logged.Name = model.Imię; logged.Surname = model.Nazwisko; return RedirectToAction("Index", logged); }