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();
 }
        public ActionResult ChangePassword()
        {
            var changePasswordViewModel = new ChangePasswordViewModel()
            {
                UserName = _customUserService.GetCurrentUser().UserName
            };

            return(View(changePasswordViewModel));
        }
        public ViewViewComponentResult Invoke()
        {
            var model = new UserSummaryViewModel();
            var user  = _customUserService.GetCurrentUser();

            model.FullName = user.FirstName + " " + user.Surname;
            return(View(model));
        }
Esempio n. 4
0
        public bool AddPost(Post post)
        {
            try
            {
                post.CreationDate = DateTime.Now;
                post.UserId       = _customUserService.GetCurrentUser().Id;
                post.IsActive     = true;

                _postDal.Add(post);
                _postDal.Save();

                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
Esempio n. 5
0
        public bool AddPost(PostDto postDto)
        {
            try
            {
                var post = new Post()
                {
                    CreationDate = postDto.CreationDate,
                    IsActive     = postDto.IsActive,
                    UserId       = _customUserService.GetCurrentUser().Id
                };

                _postDal.Add(post);
                _postDal.Save();

                return(true);
            }
            catch (Exception exp)
            {
                return(false);
            }
        }
Esempio n. 6
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();
        }