Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public System.Threading.Tasks.Task InsertCommentOnActorIdAsync(DTO.CommentDTO comment, int ActorId)
 {
     return(base.Channel.InsertCommentOnActorIdAsync(comment, ActorId));
 }
Exemplo n.º 3
0
 public void InsertCommentOnActorId(DTO.CommentDTO comment, int ActorId)
 {
     base.Channel.InsertCommentOnActorId(comment, ActorId);
 }
Exemplo n.º 4
0
 public System.Threading.Tasks.Task <bool> InsertCommentOnActorIdAsync(int actorId, DTO.CommentDTO commentDTO)
 {
     return(base.Channel.InsertCommentOnActorIdAsync(actorId, commentDTO));
 }
Exemplo n.º 5
0
 public bool InsertCommentOnActorId(int actorId, DTO.CommentDTO commentDTO)
 {
     return(base.Channel.InsertCommentOnActorId(actorId, commentDTO));
 }
Exemplo n.º 6
0
 public void InsertCommentOnActorId(int actorId, DTO.CommentDTO commentDTO)
 {
     base.Channel.InsertCommentOnActorId(actorId, commentDTO);
 }