Пример #1
0
 private void DetailsForParentAreEdited(int parentNumber)
 {
     var editParentPanel = _profilePage.EditParent(parentNumber);
     _parentModel = new EditProfileParentModelBuilder().Build();
     if (parentNumber > 1)
     {
         _parentModel = new EditProfileParentModelBuilder().WithNewValues().Build();
     }
     editParentPanel.Edit(parentNumber, _parentModel);
 }
 private static void NativeParentPropertiesShouldBeMapped(Parent parent, EditProfileParentModel editProfileParentModel)
 {
     editProfileParentModel.FirstName.ShouldBe(parent.FirstName);
     editProfileParentModel.LastName.ShouldBe(parent.LastSurname);
     editProfileParentModel.Sex.ShouldBe(((SexTypeEnum) parent.SexTypeId.GetValueOrDefault()));
     editProfileParentModel.TelephoneNumber.ShouldBe(parent.ParentTelephones.First().TelephoneNumber);
 }
Пример #3
0
        public virtual JsonResult EditParentInfo(EditProfileParentModel model)
        {
            if (!ModelState.IsValid)
            {
                var nglErrors = ModelState.GetNglErrors();

                return Json(new { nglErrors }, JsonRequestBehavior.AllowGet);
            }

            var parent = _parentRepository.GetByUSI(model.ParentUSI);
            _editProfileParentModelToParentMapper.Map(model, parent);
            _repository.Save();

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