Пример #1
0
        public ActionResult AcceptFriendRequest(FRIEND friend)
        {
            if (Session["CurrentUserName"] == null)
            {
                return(RedirectToAction("Login", "Pastebook"));
            }
            var userName = string.Empty;

            if (friend != null)
            {
                friend.USER_ID = (int)Session["CurrentUserID"];
                friend         = friendManager.GetFriend(friend.USER_ID, friend.FRIEND_ID);
                var getValue = friendManager.AcceptFriend(friend);
                userName = userManager.GetUserNameByID(friend.FRIEND_ID);
            }

            return(RedirectToAction("ViewProfile", "Pastebook", new { userName = userName }));
        }