public DateTime GetBestTimeToPost(PromoterFactory.ePromoterType i_PostOption) { Promoter promoter; promoter = PromoterFactory.PromoterCreator(i_PostOption, LoggedInUser); return(promoter.FindBestTimeToPost()); }
private string bestTimeToPostIdentifierAndStringMaking(PromoterFactory.ePromoterType i_OptionChoosed, ref int o_BestHourToPost) { string bestTimeToPostText; switch (i_OptionChoosed) { case PromoterFactory.ePromoterType.Photo: m_BestToPostAPhoto = FBEngine.Instance.GetBestTimeToPost(i_OptionChoosed); o_BestHourToPost = m_BestToPostAPhoto.Hour; break; case PromoterFactory.ePromoterType.Status: m_BestToPostAStatus = FBEngine.Instance.GetBestTimeToPost(i_OptionChoosed); o_BestHourToPost = m_BestToPostAStatus.Hour; break; } bestTimeToPostText = string.Format("The best time to post {0}:\n{1}:00:00", i_OptionChoosed.ToString(), o_BestHourToPost); return(bestTimeToPostText); }
public void FindBestTimeToPost() { PromoterFactory.ePromoterType optionChoosed = radioButtonPhoto.Checked ? PromoterFactory.ePromoterType.Photo : PromoterFactory.ePromoterType.Status; int bestHourToPost = 0; string bestTimeToPostText = null; try { bestTimeToPostText = bestTimeToPostIdentifierAndStringMaking(optionChoosed, ref bestHourToPost); } catch { labelBestTimeToPost.Text = "Please login first!"; } labelBestTimeToPost.Invoke(new Action(() => { labelBestTimeToPost.Text = bestTimeToPostText; radioButtonPostAtBestTime.Enabled = true; buttonGetBestTime.Enabled = true; })); }