コード例 #1
0
        public Comment SaveComment(Comment comment, string userId)
        {
            var commentDTO = new DTO.CommentDTO()
            {
                CommentId = comment.CommentId,
                Body      = comment.Body,
                MediaId   = comment.MediaId,
            };

            var returnedComment = this._dataService.SaveComment(commentDTO, userId);

            var user = _userService.GetAspNetUser(userId);

            if (user != null)
            {
                var roleName = user.RoleName;
                if (roleName == "client")
                {
                    // send email to admin
                    string userName = user.FirstName + ' ' + user.LastName;
                    SendCommentEmailToAdmin(commentDTO, userName);
                }
                //else if (roleName == "admin")
                //{
                //    //send email to owner of project
                //    SendCommentEmailToClient(commentDTO, user);
                //}
            }
            return(MapEFToModel(returnedComment));
        }
コード例 #2
0
 public System.Threading.Tasks.Task InsertCommentOnActorIdAsync(DTO.CommentDTO comment, int ActorId)
 {
     return(base.Channel.InsertCommentOnActorIdAsync(comment, ActorId));
 }
コード例 #3
0
 public void InsertCommentOnActorId(DTO.CommentDTO comment, int ActorId)
 {
     base.Channel.InsertCommentOnActorId(comment, ActorId);
 }
コード例 #4
0
 public System.Threading.Tasks.Task <bool> InsertCommentOnActorIdAsync(int actorId, DTO.CommentDTO commentDTO)
 {
     return(base.Channel.InsertCommentOnActorIdAsync(actorId, commentDTO));
 }
コード例 #5
0
 public bool InsertCommentOnActorId(int actorId, DTO.CommentDTO commentDTO)
 {
     return(base.Channel.InsertCommentOnActorId(actorId, commentDTO));
 }
コード例 #6
0
 public void InsertCommentOnActorId(int actorId, DTO.CommentDTO commentDTO)
 {
     base.Channel.InsertCommentOnActorId(actorId, commentDTO);
 }