Ejemplo n.º 1
0
        public ICollection <CommentDto> FindAllComments(long eventId, int startIndex, int count)
        {
            Event myEvent = EventDao.Find(eventId);

            ICollection <Comment>    comments    = CommentDao.FindCommentsOrderByDate(eventId, startIndex, count);
            ICollection <CommentDto> commentsDto = new HashSet <CommentDto>();

            foreach (Comment comment in comments)
            {
                commentsDto.Add(new CommentDto(comment, eventId));
            }
            return(commentsDto);
        }
Ejemplo n.º 2
0
        public Comment AddComment(string comment, long eventId, long userId)
        {
            Event       e = EventDao.Find(eventId);
            UserProfile u = UserProfileDao.Find(userId);

            Comment c = new Comment();

            c.content     = comment;
            c.Event       = e;
            c.UserProfile = u;
            c.commentDate = DateTime.Now;
            c.Labels      = new List <Label>();
            c.loginName   = u.loginName;
            CommentDao.Create(c);

            return(c);
        }
Ejemplo n.º 3
0
        public Event FindEventById(long eventId)
        {
            Event myEvent = EventDao.Find(eventId);

            return(myEvent);
        }