Пример #1
0
 public IResult Add(Comment comment)
 {
     _validation = new Validation <CommentValidator>();
     _validation.Validate(comment);
     _commentDal.Add(comment);
     return(new SuccessDataResult <Comment>(comment));
 }
Пример #2
0
 public void AddComment(Comment comment)
 {
     comment.UserId      = _customUserService.GetCurrentUser().Id;
     comment.CommentDate = DateTime.Now;
     comment.IsActive    = true;
     _commentDal.Add(comment);  //Repository'ye gideceğiz..
     _commentDal.Save();
 }
Пример #3
0
        public bool Add(Comment comment)
        {
            bool result = _commentDal.Add(comment);

            if (result)
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
 public IResult Add(Comment comment)
 {
     try
     {
         _commentDal.Add(comment);
         return(new SuccessResult(Messages.SuccessAdded));
     }
     catch (Exception)
     {
         return(new ErrorResult(Messages.ErrorAdded));
     }
 }
Пример #5
0
 public IResult Add(Comment comment)
 {
     try
     {
         comment.CommentDate = DateTime.Now;
         _commentDal.Add(comment);
         return(new SuccessResult());
     }
     catch (Exception)
     {
         return(new ErrorResult(Messages.ErrorWhileAddingEntity));
     }
 }
        public async Task <ActionResult <Comment> > PostComment(Comment comment)
        {
            if (comment == null)
            {
                return(BadRequest());
            }

            comment.PublishDate = DateTime.Now;

            await _commentDal.Add(comment);

            return(CreatedAtAction("GetComment", new { id = comment.Id }, comment));
        }
Пример #7
0
        public async Task <IResult> Add(CommentCreateDto commentCreateDto)
        {
            var comment = new Comment
            {
                Content   = commentCreateDto.Content,
                UserId    = commentCreateDto.UserId,
                ProductId = commentCreateDto.ProductId,
                Created   = DateTime.Now
            };
            await _commentDal.Add(comment);

            return(new SuccessResult(Messages.CommentAdded));
        }
Пример #8
0
 public void Add(Comment comment)
 {
     _commentDal.Add(comment);
     try
     {
         _emailProvider.Subject   = "YKK Data Sheet Bildirimi Hk.";
         _emailProvider.toAddress = GetToAddress(comment);
         _emailProvider.Content   = GetContent(comment);
         _emailProvider.SendMail();
     }
     catch
     {
     }
 }
Пример #9
0
        public IResult Add(CommentCreateDto commentCreateDto)//+++
        {
            var comment = new Comment
            {
                Content = commentCreateDto.Content,
                UserId  = commentCreateDto.UserId,
                PostId  = commentCreateDto.PostId,
                //Created = Convert.ToDateTime(commentCreateDto.Created)
                Created = DateTime.Now
            };

            _commentDal.Add(comment);
            return(new SuccessResult(Messages.CommentAdded));
        }
Пример #10
0
        public IResult Add(Comment comment)
        {
            IResult result = BusinessRule.Run
                             (
                CheckIfCommentAlreadyExist(comment.Id)
                             );

            if (result != null)
            {
                return(result);
            }

            _commentDal.Add(comment);

            return(new SuccessResult());
        }
Пример #11
0
        public DataResponse Add(Comment entity)
        {
            var comment = _commentDal.Add(entity);

            if (comment == null)
            {
                return new DataResponse
                       {
                           Mesaj      = "Yorum Eklenemedi",
                           Tamamlandi = false,
                       }
            }
            ;
            return(new DataResponse
            {
                Data = comment,
                Tamamlandi = true,
                Mesaj = comment.YorumBaslik + " Baslikli Yorum Eklendi",
            });
        }
Пример #12
0
        public void AddComment(CommentDto commentDto)
        {
            var addComment = new Comment()
            {
                UserId      = _customUserService.GetCurrentUser().Id,
                CommentDate = DateTime.Now,
                IsActive    = true,
                Content     = commentDto.Content, //TODO Kontrol
                PostId      = commentDto.PostId
            };

            _commentDal.Add(addComment);
            _commentDal.Save();


            //commentDto.UserId = _customUserService.GetCurrentUser().Id;
            //commentDto.CommentDate = DateTime.Now;
            //commentDto.IsActive = true;
            //_commentDal.Add(commentDto);  //Repository'ye gideceğiz..
            //_commentDal.Save();
        }
Пример #13
0
 public IResult Add(Comment entity)
 {
     _commentDal.Add(entity);
     return(new SuccessResult(Messages.CommentAdded));
 }
Пример #14
0
 public IResult Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(new SuccessResult());
 }
Пример #15
0
 public Comment Add(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
Пример #16
0
 public IResult Add(Comment comment)
 {
     comment.Status = false;
     _commentDal.Add(comment);
     return(new SuccessResult());
 }
 public IResult Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(new SuccessDataResult <Comment>(Messages.Added));
 }
Пример #18
0
 public void Add(Comments entity)
 {
     _commentDal.Add(entity);
 }
 public Comment Add(Comment entity)
 {
     return(_CommentDal.Add(entity));
 }
 public Comment Insert(Comment comment)
 {
     _commentDal.Add(comment);
     return(comment);
 }
Пример #21
0
 public bool Add(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
 public Comment Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(comment);
 }
Пример #23
0
 public void Add(Comment comment)
 {
     ValidationTool.Validate(new CommentValidator(), comment);
     commentDal.Add(comment);
 }
Пример #24
0
 public Comment Insert(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
Пример #25
0
 public void Add(Comment entity)
 {
     commentDal.Add(entity);
 }
 public void Add(Comment commend)
 {
     _commentDal.Add(commend);
 }
Пример #27
0
 public IResult Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(new SuccessResult(Messages.CommnetAdded));
 }