public void StudentNameIsEdited()
 {
     _nameModel = new NameModel
     {
         FirstName = "New",
         LastName = "Beginning"
     };
     _profilePage.EditName(_nameModel);
 }
示例#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);
        }