public ActionResult MyLikedNotes()
        {
            var liked = likeManager.ListQueryable().
                        Include("LikedUser").Include("Note").
                        Where(x => x.LikedUser.Id == SessionManager.User.Id).
                        Select(x => x.Note).Include("Category").Include("Owner").
                        OrderByDescending(x => x.CreateOn);

            return(View("Index", liked.ToList()));
        }
Ejemplo n.º 2
0
        public ActionResult MyLikes()
        {
            MyLikesViewModel model = new MyLikesViewModel();

            model.Likes = _likeManager.ListQueryable().Where(x => x.AppUserId == CurrentSession.User.Id).ToList();
            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult MyLikedFoods()
        {
            var foods = likeManager.ListQueryable().Include("LikedUsers").Include("Food").Where(
                x => x.LikedUsers.Id == UserSession.User.Id).Select(
                x => x.Food).Include("Category").Include("Owner").OrderByDescending(
                x => x.Modified);

            return(View("Index", foods.ToList()));
        }
Ejemplo n.º 4
0
        public ActionResult MyLikedNotes()
        {
            var notes = likeManager.ListQueryable().Include("LikedUser").Include("Note").Where(
                x => x.LikedUser.Id == CurrentSession.User.Id).Select(
                x => x.Note).Include("Category").Include("Owner").OrderByDescending(
                x => x.ModifiedOn);

            return(View("Index", notes.ToList()));
        }
Ejemplo n.º 5
0
        public ActionResult BlogPost(Guid?Blog)
        {
            if (Blog == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            BlogPostViewModel model = new BlogPostViewModel();

            model.Blog      = CacheHelper.GetBlogsWithOutDraftDeleteFromCache().FirstOrDefault(x => x.Id == Blog);
            model.Comments  = _commentManager.ListQueryable().Where(x => x.BlogId == Blog).OrderByDescending(x => x.CreatedOn).ToList();
            model.LikeCount = _likeManager.ListQueryable().Where(x => x.BlogId == Blog).ToList().Count();


            return(View(model));
        }
Ejemplo n.º 6
0
        public ActionResult AdminDetails(Guid?userId)
        {
            if (userId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            AdminDetailsViewModel model = new AdminDetailsViewModel();
            var usr = _userManager.Find(x => x.Id == userId);

            if (usr == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            else
            {
                var roleId   = _roleManager.GetAdminRoleId();
                var userRole = _userRoleManager.Find(x => x.AppUserId == userId && x.AppRoleId == roleId);

                if (userRole == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                else
                {
                    model.Admin = usr;

                    model.Blogs      = _blogManager.ListQueryable().Where(x => x.AppUserId == userId).ToList();
                    model.Comments   = _commentManager.ListQueryable().Where(x => x.AppUserId == userId).ToList();
                    model.LastVisits = _visitManager.ListQueryable().Where(x => x.AppUserId == userId).ToList();
                    model.Likes      = _likeManager.ListQueryable().Where(x => x.AppUserId == userId).ToList();
                    model.Logs       = _logManager.ListQueryable().Where(x => x.Username == usr.Username).ToList();
                    model.UserRoles  = _userRoleManager.ListQueryable().Where(x => x.AppUserId == userId).ToList();

                    return(View(model));
                }
            }
        }
Ejemplo n.º 7
0
        // GET: User/Account
        public ActionResult MyLikes()
        {
            var likes = _likeManager.ListQueryable().Where(x => x.AppUserId == CurrentSession.User.Id).ToList();

            return(View(likes));
        }