Exemplo n.º 1
0
 public ActionResult ProfilePage()
 {
     string userId = Request.RawUrl.Split('=').Last();
     userId = userId == null ? User.Identity.GetUserId() : userId;
     WhiskeyLogic mngr = new WhiskeyLogic();
     List<Drink> myList = new List<Drink>();
     myList = mngr.GetTopList("","", "", "", "", 500000, 1, userId);
     ViewBag.FriendsTopList = mngr.GetFriendsToplist(userId);
     ViewBag.Friends = mngr.GetFriends(userId);
     return View(myList);
 }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            WhiskeyLogic mngr = new WhiskeyLogic();
            List<Drink> mylist = mngr.GetTopList("","", "", "", "", 50000, 1,"");

            List<Drink> mostPopularList = mngr.GetMostPopularList(mylist);
            ViewBag.mostPopularList = mostPopularList;

            mylist = mylist.Take(10).ToList();
            return View(mylist);
        }
Exemplo n.º 3
0
        public ActionResult UserProfilePage()
        {
            string userId = Request.RawUrl.Split('=').Last();
            if(userId == User.Identity.GetUserId())
            {
                return Redirect("~/Home/ProfilePage?User="******"", "", "", "", "", 500000, 1, userId);
            ViewBag.FriendsTopList = mngr.GetFriendsToplist(userId);
            ViewBag.Friends = mngr.GetFriends(userId);
            ViewBag.UserId = userId;
            ViewBag.Username = mngr.FindUserById(userId);
            ViewBag.CurrentUserFriends = mngr.GetFriends(User.Identity.GetUserId());

            List<Friend> mylist = mngr.FindUser("", User.Identity.GetUserId());
            List<Friend> FriendList = mngr.GetFriends(User.Identity.GetUserId());

            foreach (var user in mylist)
            {
                foreach (var friend in FriendList)
                {
                    if (friend.FriendId == user.FriendId)
                    {
                        user.IsFriend = true;
                    }
                }
            }
                Friend f = mylist.First(x => x.FriendId == userId);
                ViewBag.IsFriend = f.IsFriend ? true : false;

            return View(myList);
        }