public string getInteractionCount(string fbUserId, Guid UserId, int days) { string strStories = string.Empty; try { FacebookInsightStatsRepository objfbiRepo = new FacebookInsightStatsRepository(); ArrayList arrList = objfbiRepo.getFacebookInsightStatsById(fbUserId, UserId, days); foreach (var item in arrList) { Array temp = (Array)item; if (temp.GetValue(7) != null) { //strDate = strDate + temp.GetValue(9) + ","; strStories = strStories + temp.GetValue(7) + ","; } } strStories = strStories.Substring(0, strStories.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } return strStories; }
public string getStoriesCount(string fbUserId, int days) { string strStoriescount = string.Empty; string strStories = string.Empty; string strDate = string.Empty; try { FacebookInsightStatsRepository objfbiRepo1 = new FacebookInsightStatsRepository(); ArrayList arrList = objfbiRepo1.getFacebookInsightStatsById(fbUserId, days); //foreach (var item in arrList) //{ // Array temp = (Array)item; // if (temp.GetValue(7) != null) // { // strDate = strDate + temp.GetValue(10) + ","; // strStories = strStories + temp.GetValue(7) + ","; // } //} //if (arrList.Count < 7) //{ // for (int i = 0; i < 7 - arrList.Count; i++) // { // strStories = strStories + "0,"; // strDate = strDate + " ,"; // } //} for (int i = 0; i < 10; i++) { strDate += RandomDay() + ","; strStories += getrandomno() + ","; System.Threading.Thread.Sleep(10); } strStoriescount = strDate.Substring(0, strDate.Length - 1) + "@" + strStories.Substring(0, strStories.Length - 1); //strStoriescount = strDate.Substring(0, strDate.Length - 1) + "@" + strStories.Substring(0, strStories.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } return strStoriescount; }
public string getPageImressions(string fbUserId, Guid UserId, int days) { string strPageImpression = string.Empty; try { string strDate = string.Empty; string strImpression = string.Empty; FacebookInsightStatsRepository objfbiRepo = new FacebookInsightStatsRepository(); ArrayList arrList = objfbiRepo.getFacebookInsightStatsById(fbUserId, UserId, days); foreach (var item in arrList) { Array temp = (Array)item; if (temp.GetValue(9) != null && temp.GetValue(8) != null) { strDate = strDate + temp.GetValue(8) + ","; strImpression = strImpression + temp.GetValue(9) + ","; } } if (arrList.Count < 7) { for (int i = 0; i < 7 - arrList.Count; i++) { strImpression = strImpression + "0,"; strDate = strDate + " ,"; } } strPageImpression = strDate.Substring(0, strDate.Length - 1) + "@" + strImpression.Substring(0, strImpression.Length - 1); } catch (Exception Err) { Console.Write(Err.StackTrace); } return strPageImpression; }