Ejemplo n.º 1
0
 public void StudentNameIsEdited()
 {
     _nameModel = new NameModel
     {
         FirstName = "New",
         LastName = "Beginning"
     };
     _profilePage.EditName(_nameModel);
 }
Ejemplo n.º 2
0
        public virtual JsonResult EditStudentName(NameModel model)
        {
            if (!ModelState.IsValid)
            {
                var nglErrors = ModelState.GetNglErrors();
                return Json(new { nglErrors }, JsonRequestBehavior.AllowGet);
            }

            var student = _studentRepository.GetByUSI(model.StudentUsi);
            _studentNameToStudentMapper.Map(model, student);

            _repository.Save();

            TempData["ShowSuccess"] = true;
            return Json(true, JsonRequestBehavior.AllowGet);
        }