Exemplo n.º 1
0
        public ActionResult AddComment(PostViewModel postViewModel)
        {
            var userId = User.Identity.GetUserId();
            var user   = databaseEntities.AspNetUsers.Find(userId);

            postViewModel.addCommentFrom(user, databaseEntities, userId);
            var aspNetUser = databaseEntities.AspNetUsers.Find(userId);

            switch (postViewModel.appLocation)
            {
            case "Profile":
                return(RedirectToAction("Show", "Profile", new { id = user.Profile.Id }));

            case "Newsfeed":
                return(RedirectToAction("Index", "NewsFeed"));

            case "Groups":
                return(RedirectToAction("Show", "Groups"));

            case "Gallery":
                return(RedirectToAction("ShowPostFromAlbum", "Album", postViewModel));

            default:
                return(Index());
            }
        }
Exemplo n.º 2
0
        public ActionResult AddComment(PostViewModel postViewModel)
        {
            var userId = User.Identity.GetUserId();
            var user   = databaseEntities.AspNetUsers.Find(userId);

            postViewModel.addCommentFrom(user, databaseEntities, userId);
            return(RedirectToAction("Index"));
        }