Пример #1
0
        public long AddProfileActionComment(ProfileActionComment comment)
        {
            using (var uow = _unitOfWorkFactory.Create())
            {
                uow.ProfileActionComments.Add(comment);
                uow.Complete();

                return(comment.ProfileActionCommentId);
            }
        }
Пример #2
0
        public ActionResult AddComment(ProfileActionComment value)
        {
            if (_applicationManager.CurrentUser.ProfileId != value.ProfileId)
            {
                throw new AccessViolationException(nameof(value.ProfileId));
            }
            value.Date = DateTime.Now;
            var actionCommentId = _profileService.AddProfileActionComment(value);

            var result = new LoadCommentResult
            {
                Profile = _profileService.GetShortProfile((long)_applicationManager.CurrentUser.ProfileId),
                Action  = _profileService.GetProfileAction((long)value.ProfileActionId),
                ProfileActionComment = _profileService.GetProfileActionsComment(actionCommentId)
            };


            return(PartialView("LoadComment", result));
        }
Пример #3
0
 public void RemoveComment(ProfileActionComment value)
 {
     _profileService.RemoveProfileActionsComment(value.ProfileActionCommentId,
                                                 (long)_applicationManager.CurrentUser.ProfileId);
 }