Beispiel #1
0
 public IResult Add(Comment comment)
 {
     _validation = new Validation <CommentValidator>();
     _validation.Validate(comment);
     _commentDal.Add(comment);
     return(new SuccessDataResult <Comment>(comment));
 }
 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();
 }
Beispiel #3
0
        public bool Add(Comment comment)
        {
            bool result = _commentDal.Add(comment);

            if (result)
            {
                return(true);
            }

            return(false);
        }
Beispiel #4
0
 public IResult Add(Comment comment)
 {
     try
     {
         _commentDal.Add(comment);
         return(new SuccessResult(Messages.SuccessAdded));
     }
     catch (Exception)
     {
         return(new ErrorResult(Messages.ErrorAdded));
     }
 }
Beispiel #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));
        }
Beispiel #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));
        }
 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
     {
     }
 }
        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));
        }
Beispiel #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());
        }
        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",
            });
        }
Beispiel #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();
        }
Beispiel #13
0
 public IResult Add(Comment entity)
 {
     _commentDal.Add(entity);
     return(new SuccessResult(Messages.CommentAdded));
 }
 public IResult Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(new SuccessResult());
 }
Beispiel #15
0
 public Comment Add(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
Beispiel #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));
 }
Beispiel #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);
 }
Beispiel #21
0
 public bool Add(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
 public Comment Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(comment);
 }
 public void Add(Comment comment)
 {
     ValidationTool.Validate(new CommentValidator(), comment);
     commentDal.Add(comment);
 }
Beispiel #24
0
 public Comment Insert(Comment comment)
 {
     return(_commentDal.Add(comment));
 }
 public void Add(Comment entity)
 {
     commentDal.Add(entity);
 }
 public void Add(Comment commend)
 {
     _commentDal.Add(commend);
 }
Beispiel #27
0
 public IResult Add(Comment comment)
 {
     _commentDal.Add(comment);
     return(new SuccessResult(Messages.CommnetAdded));
 }