Example #1
0
 public ActionResult Details(StudentDetailsViewModel model)
 {
     ViewBag.Title = "Datos Personales";
     ViewBag.SelectedMenu = EnumStudentMenu.DatosPersonales;
     if (ModelState.IsValid)
     {
         try
         {
             model.Email = User.Identity.Name;
             _studentService.updateStudentInfo(model);
             return View(model);
         }
         catch (Exception ex)
         {
             ModelState.AddModelError("Error", ex);
             return View(model);
         }
     }
     return View(model);
 }
Example #2
0
 public void updateStudentInfo(StudentDetailsViewModel model)
 {
     var student = _studentRepository.Get().ToList().FirstOrDefault(s => s.Email == model.Email);
     student.Email = model.Email;
     student.Nombres = model.Nombres;
     student.ApellidoPaterno = model.ApellidoPaterno;
     student.ApellidoMaterno = model.ApellidoMaterno;
     student.Celular = model.NumeroCelular;
     student.Telefono = model.NumeroFijo;
     student.Direccion = model.Direccion;
     _studentRepository.Update(student);
 }