Пример #1
0
        public IEnumerable<CommentServiceModel> getCommentsByKeyword(string text)
        {
            CommentsRepository repo = new CommentsRepository(entities);
            List<CommentServiceModel> models = new List<CommentServiceModel>();
            IEnumerable<Comment> comments = repo.FindCommentsByKeyword(text);

            foreach (Comment comment in comments) {
                models.Add(DefectUtil.mapCommentEntityToModel(comment));
            }

            return models;
        }
Пример #2
0
        public IEnumerable<CommentServiceModel> getCommentsBeforeDate(DateTime dateTimeStamp)
        {
            CommentsRepository repo = new CommentsRepository(entities);
            List<CommentServiceModel> models = new List<CommentServiceModel>();
            IEnumerable<Comment> comments = repo.FindAllCommentsBeforeDate(dateTimeStamp);

            foreach (Comment comment in comments) {
                models.Add(DefectUtil.mapCommentEntityToModel(comment));
            }

            return models;
        }
Пример #3
0
        public IEnumerable<CommentServiceModel> getCommentsByUser(int id)
        {
            CommentsRepository repo = new CommentsRepository(entities);
            List<CommentServiceModel> models = new List<CommentServiceModel>();
            IEnumerable<Comment> comments = repo.FindAllCommentsForDefect(id);

            foreach (Comment comment in comments) {
                models.Add(DefectUtil.mapCommentEntityToModel(comment));
            }

            return models;
        }
Пример #4
0
 public CommentServiceModel getCommentById(int id)
 {
     CommentsRepository repo = new CommentsRepository(entities);
     Comment comment = repo.GetCommentById(id);
     return DefectUtil.mapCommentEntityToModel(comment);
 }
Пример #5
0
 public void deleteCommentById(int id)
 {
     CommentsRepository repo = new CommentsRepository(entities);
     Comment comment = repo.GetCommentById(id);
     repo.DeleteComment(comment);
 }
Пример #6
0
 public int insertComment(CommentServiceModel comment)
 {
     CommentsRepository repo = new CommentsRepository(entities);
     Comment model = DefectUtil.unmapCommentEntityToModel(comment);
     return repo.InsertComment(model);
 }