예제 #1
0
        public IActionResult AddUser(UserViewModel addUser)
        {
            if (!ModelState.IsValid)
            {
                return(View(addUser));
            }
            _userAppService.Register(addUser);

            if (!_notification.HasNotofications())
            {
                return(RedirectToAction("Index"));
            }
            foreach (var item in _notification.GetDomainNotifications())
            {
                ModelState.AddModelError(string.Empty, item.Value);
            }
            return(View(addUser));
        }
예제 #2
0
 public bool Commit()
 {
     if (_notification.HasNotofications())
     {
         return(false);
     }
     if (_unitOfWork.Commit())
     {
         return(true);
     }
     _bus.RaiseEvent(new DomainNotificationEvent("Commit", "提交数据保存出错"));
     return(false);
 }