public IActionResult Index()
        {
            var owneresult = UserM.GetDtoUser(User.Identity.Name);
            var count      = ConnM.FriendCount(owneresult.UserId);

            ViewBag.Count = count;

            var postlist = ConnM.GetFriendsConn(owneresult.UserId);

            return(View(new PostuserModel
            {
                posts = postlist,
                User = owneresult
            }));
        }
示例#2
0
        public IActionResult ProfilIndex(int id)
        {
            var result = UserM.GetDtoUserbyId(id);
            var owner  = UserM.GetDtoUser(User.Identity.Name);

            if (result == null)
            {
                return(RedirectToAction("Error", "Home"));
            }
            if (result.UserId == owner.UserId)
            {
                ViewBag.durum = "Profili Düzenle";
            }

            DtoConnection f1 = ConnM.getconnection1(result.UserId, owner.UserId);
            DtoConnection f2 = ConnM.getconnection2(result.UserId, owner.UserId);


            if (result.UserId != owner.UserId)
            {
                ViewBag.UserType = "Guest";
            }

            if (f1 == null && f2 == null)
            {
                ViewBag.NotFriends = "True";
            }
            if (f1 != null)
            {
                if (!f1.IsActive)
                {
                    ViewBag.NotFriends = "Pending";
                }
            }
            if (f2 != null)
            {
                if (!f2.IsActive)
                {
                    ViewBag.NotFriends = "Pending";
                }
            }

            PostuserModel model = new PostuserModel();

            model.User  = result;
            model.posts = UserM.sprofiltweet(id);
            return(View(model));
        }