Esempio n. 1
0
 public void DeleteCommentary(CommentaryDTO commentary)
 {
     try
     {
         service.DeleteCommentary(commentary);
     }
     catch
     {
         throw new Exception();
     }
 }
Esempio n. 2
0
        public static CommentaryDTO ToModel(this Comment comment)
        {
            CommentaryDTO commentModel = new CommentaryDTO()
            {
                Id = comment.Id,
                CreationTimestamp = comment.CreationTimestamp,
                Text = comment.Text
            };

            return(commentModel);
        }
Esempio n. 3
0
 public CommentaryDTO CreateCommentary(CommentaryDTO commentary)
 {
     try
     {
         return(service.CreateCommentary(commentary));
     }
     catch
     {
         return(null);
     }
 }
Esempio n. 4
0
 public void DeleteCommentary(CommentaryDTO commentary)
 {
     try
     {
         Commentary comment = _mapper.Map <Commentary>(commentary);
         _lateDA.DeleteCommentary(comment);
     }
     catch
     {
         throw new Exception();
     }
 }
Esempio n. 5
0
 public CommentaryDTO CreateCommentary(CommentaryDTO commentary)
 {
     try
     {
         Commentary comment = _mapper.Map <Commentary>(commentary);
         return(_mapper.Map <CommentaryDTO>(_lateDA.CreateCommentary(comment)));
     }
     catch
     {
         return(null);
     }
 }
        public IActionResult addComment(int idTicket, IFormCollection inputs)
        {
            var           idUser     = User.Claims.Where(x => x.Type == "UserID").FirstOrDefault().Value; //Get UserID in Cookie
            CommentaryDTO newComment = new CommentaryDTO
            {
                idlate  = idTicket,
                message = inputs["message"],
                iduser  = Int32.Parse(idUser),
                date    = new DateTime()
            };

            late.CreateCommentary(newComment);
            return(RedirectToAction("Index"));
        }
 public void Edit(CommentaryDTO commentary)
 {
     _fabric.CreateCommentsRepository().Update(commentary.ToEntity());
 }
 public void Delete(CommentaryDTO commentary)
 {
     _fabric.CreateCommentsRepository().Delete(commentary.ToEntity());
 }
Esempio n. 9
0
        public static Comment ToEntity(this CommentaryDTO comment)
        {
            var config = new MapperConfiguration(cfg => cfg.CreateMap <CommentaryDTO, Comment>());

            return(new Mapper(config).Map <CommentaryDTO, Comment>(comment));
        }
Esempio n. 10
0
        public void DeleteCommentary(CommentaryDTO commentary)
        {
            ServiceLate service = new ServiceLate();

            service.DeleteCommentary(commentary);
        }
Esempio n. 11
0
        public CommentaryDTO CreateCommentary(CommentaryDTO commentary)
        {
            ServiceLate service = new ServiceLate();

            return(service.CreateCommentary(commentary));
        }