public async Task<ActionResult> BindInboxMessage(string load, string arrmsgtype, string arrid) { string AllProfileId = string.Empty; string MessageType = string.Empty; List<Domain.Socioboard.Domain.InboxMessages> lstmsg = new List<Domain.Socioboard.Domain.InboxMessages>(); Api.InboxMessages.InboxMessages ApiInboxMessages = new Api.InboxMessages.InboxMessages(); Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; if (load == "first") { Dictionary<Domain.Socioboard.Domain.GroupProfile, object> allprofileofuser = new Dictionary<Domain.Socioboard.Domain.GroupProfile, object>(); try { allprofileofuser = await SBHelper.GetGroupProfiles(); } catch (Exception Err) { Console.Write(Err.StackTrace); } foreach (var item in allprofileofuser) { try { if (item.Key.ProfileType == "facebook" || item.Key.ProfileType == "twitter") { AllProfileId += item.Key.ProfileId + ","; } } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { AllProfileId = AllProfileId.Substring(0, (AllProfileId.Length - 1)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } inboxmessagecount = 0; MessageType = "twt_followers,twt_mention,twt_retweet,fb_notification"; //lstmsg = (List<Domain.Socioboard.Domain.InboxMessages>)new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetInboxMessage(objUser.Id.ToString(), AllProfileId, MessageType, "0", "10"), typeof(List<Domain.Socioboard.Domain.InboxMessages>)); } else if (load == "filter") { inboxmessagecount = 0; AllProfileId = arrid; MessageType = arrmsgtype; //lstmsg = (List<Domain.Socioboard.Domain.InboxMessages>)new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetInboxMessage(objUser.Id.ToString(), AllProfileId, MessageType, "0", "10"), typeof(List<Domain.Socioboard.Domain.InboxMessages>)); } else if (load == "scroll") { inboxmessagecount = inboxmessagecount + 10; AllProfileId = arrid; MessageType = arrmsgtype; } lstmsg = (List<Domain.Socioboard.Domain.InboxMessages>)new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetInboxMessage(objUser.Id.ToString(), AllProfileId, MessageType, inboxmessagecount.ToString(), "10"), typeof(List<Domain.Socioboard.Domain.InboxMessages>)); if (lstmsg.Count > 0) { return PartialView("_InboxPartial", lstmsg); } else { return Content("no_data"); } }
public ActionResult Followers(string ProfileId) { Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"]; Api.InboxMessages.InboxMessages ApiInboxMessages = new Api.InboxMessages.InboxMessages(); List<Domain.Socioboard.Domain.InboxMessages> lstInboxMessages = (List<Domain.Socioboard.Domain.InboxMessages>)new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetAllFollowersOfUser(_User.Id.ToString(), ProfileId), typeof(List<Domain.Socioboard.Domain.InboxMessages>)); return View(lstInboxMessages); }
public ActionResult ShowInboxMsgMailPopUp(string MsgId) { Domain.Socioboard.Domain.User _User = (Domain.Socioboard.Domain.User)Session["User"]; Api.InboxMessages.InboxMessages ApiInboxMessages = new Api.InboxMessages.InboxMessages(); Domain.Socioboard.Domain.InboxMessages _InboxMessages = (Domain.Socioboard.Domain.InboxMessages)new JavaScriptSerializer().Deserialize(ApiInboxMessages.getInboxMessageByMessageId(_User.Id.ToString(), MsgId), typeof(Domain.Socioboard.Domain.InboxMessages)); return PartialView("_MailMsgSendingPartial", _InboxMessages); }
public async Task<ActionResult> DisplayCount() { string AllProfileId = string.Empty; string FbProfileId = string.Empty; string TwtProfileId = string.Empty; int fbmsgcount = 0; int twtmsgcount = 0; int allsentmsgcount = 0; User objUser = (User)Session["User"]; Dictionary<Domain.Socioboard.Domain.GroupProfile, object> allprofileofuser =await SBHelper.GetGroupProfiles(); foreach (var item in allprofileofuser) { try { //Domain.Socioboard.Domain.TeamMemberProfile item = (Domain.Socioboard.Domain.TeamMemberProfile)(profile.Value); if (item.Key.ProfileType == "facebook" || item.Key.ProfileType == "facebook_page") { FbProfileId += item.Key.ProfileId + ','; } else if (item.Key.ProfileType == "twitter") { TwtProfileId += item.Key.ProfileId + ','; } AllProfileId += item.Key.ProfileId + ','; } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { FbProfileId = FbProfileId.Substring(0, FbProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { TwtProfileId = TwtProfileId.Substring(0, TwtProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { AllProfileId = AllProfileId.Substring(0, AllProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } //try //{ // Api.FacebookFeed.FacebookFeed objFacebookFeed = new Api.FacebookFeed.FacebookFeed(); // objFacebookFeed.Timeout = 300000; // //fbmsgcount = ((List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(objFacebookFeed.getAllFeedDetail1(FbProfileId, objUser.Id.ToString()), typeof(List<FacebookFeed>)))).Count; // fbmsgcount = objFacebookFeed.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} //try //{ // Api.TwitterMessage.TwitterMessage objTwitterMessage = new Api.TwitterMessage.TwitterMessage(); // objTwitterMessage.Timeout = 300000; // //twtmsgcount = ((List<TwitterMessage>)(new JavaScriptSerializer().Deserialize(objTwitterMessage.getAlltwtMessages1(TwtProfileId, objUser.Id.ToString()), typeof(List<TwitterMessage>)))).Count; // twtmsgcount = objTwitterMessage.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), TwtProfileId); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} try { Api.ScheduledMessage.ScheduledMessage objScheduledMessage = new Api.ScheduledMessage.ScheduledMessage(); objScheduledMessage.Timeout = 300000; //allsentmsgcount = ((List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(objScheduledMessage.getAllSentMessageDetails(AllProfileId, objUser.Id.ToString()), typeof(List<ScheduledMessage>)))).Count; allsentmsgcount = objScheduledMessage.GetSentMessageCountByProfileIdAndUserId(objUser.Id.ToString(), AllProfileId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } string _totalIncomingMessage = "0"; string _totalSentMessage = "0"; string _totalTwitterFollowers = "0"; string _totalFacebookFan = "0"; try { //_totalIncomingMessage = (fbmsgcount + twtmsgcount).ToString(); Api.InboxMessages.InboxMessages _InboxMessages = new Api.InboxMessages.InboxMessages(); _totalIncomingMessage = _InboxMessages.getInboxMessageCount(objUser.Id.ToString(), AllProfileId); } catch (Exception ex) { _totalIncomingMessage = "0"; Console.WriteLine(ex.StackTrace); } //try //{ // _totalIncomingMessage = (fbmsgcount + twtmsgcount).ToString(); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} try { _totalSentMessage = allsentmsgcount.ToString(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalTwitterFollowers = SBUtils.GetAllTwitterFollowersCountofUser(TwtProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalFacebookFan = SBUtils.GetAllFacebookFancountofUser(FbProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } ViewBag._totalIncomingMessage = _totalIncomingMessage; ViewBag._totalSentMessage = _totalSentMessage; ViewBag._totalTwitterFollowers = _totalTwitterFollowers; ViewBag._totalFacebookFan = _totalFacebookFan; return PartialView("_HomeUserActivityPartial"); }
public ActionResult DisplayCount() { string AllProfileId = string.Empty; string FbProfileId = string.Empty; string TwtProfileId = string.Empty; int fbmsgcount = 0; int twtmsgcount = 0; int allsentmsgcount = 0; User objUser = (User)Session["User"]; Dictionary <Domain.Socioboard.Domain.TeamMemberProfile, object> allprofileofuser = SBUtils.GetUserProfilesccordingToGroup(); foreach (var item in allprofileofuser) { try { //Domain.Socioboard.Domain.TeamMemberProfile item = (Domain.Socioboard.Domain.TeamMemberProfile)(profile.Value); if (item.Key.ProfileType == "facebook" || item.Key.ProfileType == "facebook_page") { FbProfileId += item.Key.ProfileId + ','; } else if (item.Key.ProfileType == "twitter") { TwtProfileId += item.Key.ProfileId + ','; } AllProfileId += item.Key.ProfileId + ','; } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { FbProfileId = FbProfileId.Substring(0, FbProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { TwtProfileId = TwtProfileId.Substring(0, TwtProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } try { AllProfileId = AllProfileId.Substring(0, AllProfileId.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } //try //{ // Api.FacebookFeed.FacebookFeed objFacebookFeed = new Api.FacebookFeed.FacebookFeed(); // objFacebookFeed.Timeout = 300000; // //fbmsgcount = ((List<FacebookFeed>)(new JavaScriptSerializer().Deserialize(objFacebookFeed.getAllFeedDetail1(FbProfileId, objUser.Id.ToString()), typeof(List<FacebookFeed>)))).Count; // fbmsgcount = objFacebookFeed.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), FbProfileId); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} //try //{ // Api.TwitterMessage.TwitterMessage objTwitterMessage = new Api.TwitterMessage.TwitterMessage(); // objTwitterMessage.Timeout = 300000; // //twtmsgcount = ((List<TwitterMessage>)(new JavaScriptSerializer().Deserialize(objTwitterMessage.getAlltwtMessages1(TwtProfileId, objUser.Id.ToString()), typeof(List<TwitterMessage>)))).Count; // twtmsgcount = objTwitterMessage.GetFeedCountByProfileIdAndUserId(objUser.Id.ToString(), TwtProfileId); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} try { Api.ScheduledMessage.ScheduledMessage objScheduledMessage = new Api.ScheduledMessage.ScheduledMessage(); objScheduledMessage.Timeout = 300000; //allsentmsgcount = ((List<ScheduledMessage>)(new JavaScriptSerializer().Deserialize(objScheduledMessage.getAllSentMessageDetails(AllProfileId, objUser.Id.ToString()), typeof(List<ScheduledMessage>)))).Count; allsentmsgcount = objScheduledMessage.GetSentMessageCountByProfileIdAndUserId(objUser.Id.ToString(), AllProfileId); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } string _totalIncomingMessage = "0"; string _totalSentMessage = "0"; string _totalTwitterFollowers = "0"; string _totalFacebookFan = "0"; try { //_totalIncomingMessage = (fbmsgcount + twtmsgcount).ToString(); Api.InboxMessages.InboxMessages _InboxMessages = new Api.InboxMessages.InboxMessages(); _totalIncomingMessage = _InboxMessages.getInboxMessageCount(objUser.Id.ToString(), AllProfileId); } catch (Exception ex) { _totalIncomingMessage = "0"; Console.WriteLine(ex.StackTrace); } //try //{ // _totalIncomingMessage = (fbmsgcount + twtmsgcount).ToString(); //} //catch (Exception ex) //{ // Console.WriteLine(ex.StackTrace); //} try { _totalSentMessage = allsentmsgcount.ToString(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalTwitterFollowers = SBUtils.GetAllTwitterFollowersCountofUser(TwtProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { _totalFacebookFan = SBUtils.GetAllFacebookFancountofUser(FbProfileId, objUser.Id.ToString()); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } ViewBag._totalIncomingMessage = _totalIncomingMessage; ViewBag._totalSentMessage = _totalSentMessage; ViewBag._totalTwitterFollowers = _totalTwitterFollowers; ViewBag._totalFacebookFan = _totalFacebookFan; return(PartialView("_HomeUserActivityPartial")); }
public async Task <ActionResult> BindMessage(string load, string arrmsgtype, string arrid) { string MessageType = string.Empty; string TwitterProfiles = string.Empty; Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; if (load == "first") { //Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> allprofileofuser = await SBUtils.GetUserProfilesccordingToGroup(); Dictionary <Domain.Socioboard.Domain.GroupProfile, object> allprofileofuser = await SBHelper.GetGroupProfiles(); foreach (var item in allprofileofuser) { try { if (item.Key.ProfileType == "twitter") { TwitterProfiles += item.Key.ProfileId + ','; } } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { TwitterProfiles = TwitterProfiles.Substring(0, (TwitterProfiles.Length - 1)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } messageCount = 0; MessageType = "twt_mention,twt_retweet"; } else if (load == "filter") { messageCount = 0; TwitterProfiles = arrid; MessageType = arrmsgtype; } else if (load == "scroll") { messageCount = messageCount + 10; TwitterProfiles = arrid; MessageType = arrmsgtype; } Api.InboxMessages.InboxMessages ApiInboxMessages = new Api.InboxMessages.InboxMessages(); List <Domain.Socioboard.Domain.InboxMessages> _InboxMessages = (List <Domain.Socioboard.Domain.InboxMessages>) new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetInboxMessageWithSentiments(objUser.Id.ToString(), TwitterProfiles, MessageType, messageCount.ToString(), "10"), typeof(List <Domain.Socioboard.Domain.InboxMessages>)); if (_InboxMessages.Count > 0) { return(PartialView("_MessagePartial", _InboxMessages)); } else { return(Content("no_data")); } }
public async Task<ActionResult> BindMessage(string load, string arrmsgtype, string arrid) { string MessageType = string.Empty; string TwitterProfiles = string.Empty; Domain.Socioboard.Domain.User objUser = (Domain.Socioboard.Domain.User)Session["User"]; if (load == "first") { //Dictionary<Domain.Socioboard.Domain.TeamMemberProfile, object> allprofileofuser = await SBUtils.GetUserProfilesccordingToGroup(); Dictionary<Domain.Socioboard.Domain.GroupProfile, object> allprofileofuser = await SBHelper.GetGroupProfiles(); foreach (var item in allprofileofuser) { try { if (item.Key.ProfileType == "twitter") { TwitterProfiles += item.Key.ProfileId + ','; } } catch (Exception Err) { Console.Write(Err.StackTrace); } } try { TwitterProfiles = TwitterProfiles.Substring(0, (TwitterProfiles.Length - 1)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } messageCount = 0; MessageType = "twt_mention,twt_retweet"; } else if (load == "filter") { messageCount = 0; TwitterProfiles = arrid; MessageType = arrmsgtype; } else if (load == "scroll") { messageCount = messageCount + 10; TwitterProfiles = arrid; MessageType = arrmsgtype; } Api.InboxMessages.InboxMessages ApiInboxMessages = new Api.InboxMessages.InboxMessages(); List<Domain.Socioboard.Domain.InboxMessages> _InboxMessages = (List<Domain.Socioboard.Domain.InboxMessages>)new JavaScriptSerializer().Deserialize(ApiInboxMessages.GetInboxMessageWithSentiments(objUser.Id.ToString(), TwitterProfiles, MessageType, messageCount.ToString(), "10"), typeof(List<Domain.Socioboard.Domain.InboxMessages>)); if (_InboxMessages.Count > 0) { return PartialView("_MessagePartial", _InboxMessages); } else { return Content("no_data"); } }