Exemplo n.º 1
0
        public ActionResult RemoveActionCommentLike(ProfileActionCommentLike value)
        {
            _profileService.RemoveProfileActionCommentLike((long)value.ProfileActionCommentId,
                                                           (long)_applicationManager.CurrentUser.ProfileId);
            var result = new LoadCommentResult
            {
                Profile = _profileService.GetShortProfile((long)_applicationManager.CurrentUser.ProfileId),
                ProfileActionComment = _profileService.GetProfileActionsComment((long)value.ProfileActionCommentId)
            };

            if (result.ProfileActionComment != null)
            {
                result.Action = _profileService.GetProfileAction((long)result.ProfileActionComment.ProfileActionId);
            }
            result.Action = new ProfileAction();
            return(PartialView("LoadComment", result));
        }
Exemplo n.º 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));
        }