Пример #1
0
        public ActionResult Edit(ProfileViewModel profileViewEdit)
        {
            GroupPermissions(profileViewEdit);
            if (!ModelState.IsValid)
            {
                return(View(profileViewEdit));
            }

            List <string> errors = _profileAppService.Update(profileViewEdit);

            if (errors?.Count > 0)
            {
                if (errors.Contains(CodLogErrorEnum.CODELOGERROR.ToString()))
                {
                    this.Flash("Error", ResultMessages.AplicationException());
                }
                else
                {
                    AddModelStateError(errors);
                    return(View(profileViewEdit));
                }
            }
            else
            {
                this.Flash("Success", ResultMessages.Success());
            }

            return(RedirectToAction("Index"));
        }