//[OutputCache(Duration = 45, Location = OutputCacheLocation.Client, NoStore = true)] public ActionResult AddLoadNewFacebookWallPosts(string profileid, string type) { string datetime = Helper.Extensions.ToClientTime(DateTime.UtcNow); //string datetime = Request.Form["localtime"].ToString(); ViewBag.datetime = datetime; bool isUserFeedsCalled = false; if (type != null) { if (type.Equals("userfeeds") && !string.IsNullOrEmpty(type)) { isUserFeedsCalled = true; } } Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>(); Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups(); Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups))); Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook(); List<Domain.Socioboard.MongoDomain.FacebookMessage> lstFacebookMessage; try { lstFacebookMessage = (List<Domain.Socioboard.MongoDomain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebook.AddNewFacebookWallPosts(profileid, objGroups.UserId.ToString()), typeof(List<Domain.Socioboard.MongoDomain.FacebookMessage>))); } catch (Exception ex) { lstFacebookMessage = new List<Domain.Socioboard.MongoDomain.FacebookMessage>(); } List<object> lstobject = new List<object>(); foreach (var item in lstFacebookMessage) { //if (isUserFeedsCalled) //{ // if (item.FromId != item.ProfileId) // { // lstobject.Add(item); // } //} //else //{ lstobject.Add(item); //} } dictwallposts.Add("facebook", lstobject); //if (isUserFeedsCalled) //{ // return PartialView("_Panel3Partial", dictwallposts); //} //else //{ return PartialView("_Panel1Partial", dictwallposts); //} }
public ActionResult AddLoadNewFacebookWallPosts(string profileid, string type) { bool isUserFeedsCalled = false; if (type!=null) { if (type.Equals("userfeeds") && !string.IsNullOrEmpty(type)) { isUserFeedsCalled = true; } } Dictionary<string, List<object>> dictwallposts = new Dictionary<string, List<object>>(); Api.Groups.Groups ApiobjGroups = new Api.Groups.Groups(); Domain.Socioboard.Domain.Groups objGroups = (Domain.Socioboard.Domain.Groups)(new JavaScriptSerializer().Deserialize(ApiobjGroups.GetGroupDetailsByGroupId(Session["group"].ToString()), typeof(Domain.Socioboard.Domain.Groups))); Api.Facebook.Facebook ApiobjFacebook = new Api.Facebook.Facebook(); List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookMessage = (List<Domain.Socioboard.Domain.FacebookMessage>)(new JavaScriptSerializer().Deserialize(ApiobjFacebook.AddNewFacebookWallPosts(profileid, objGroups.UserId.ToString()), typeof(List<Domain.Socioboard.Domain.FacebookMessage>))); List<object> lstobject = new List<object>(); foreach (var item in lstFacebookMessage) { //if (isUserFeedsCalled) //{ // if (item.FromId != item.ProfileId) // { // lstobject.Add(item); // } //} //else //{ lstobject.Add(item); //} } dictwallposts.Add("facebook", lstobject); //if (isUserFeedsCalled) //{ // return PartialView("_Panel3Partial", dictwallposts); //} //else //{ return PartialView("_Panel1Partial", dictwallposts); //} }