public ActionResult Home() { TwitterModal _twitterModal = new TwitterModal(); Person userModel; if (Session["UserInfo"] != null) { userModel = (Person)Session["UserInfo"]; _twitterModal._person.fullname = userModel.fullname; _twitterModal._person.email = userModel.email; _twitterModal._person.user_id = userModel.user_id; _twitterModal._tweets = _Repository.getAllTweets(userModel.user_id); _twitterModal._following = _Repository.getFollowings(userModel.user_id); _twitterModal._follower = _Repository.getFollowers(userModel.user_id); } return(View(_twitterModal)); }
public PartialViewResult GetTweetMessages(int userId) { if (Session["UserInfo"] != null && userId == 0) { Person userModel = (Person)Session["UserInfo"]; userId = userModel.user_id; } List <Tweet> _Tweets = new List <Tweet>(); try { _Tweets = _Repository.getAllTweets(userId); } catch (Exception ex) { AddErrors(ex, "Twitter", "GetTweetMessages"); } return(PartialView("Tweets", _Tweets)); }