internal static eZodiacs GetZodiacName(DateTime i_DateOfBirth) { //Set defualt eZodiacs zodiac = eZodiacs.Capricorn; switch (i_DateOfBirth.Month) { case (int)eMonth.January: zodiac = (i_DateOfBirth.Day <= 19) ? eZodiacs.Capricorn : eZodiacs.Aquarius; break; case (int)eMonth.February: zodiac = (i_DateOfBirth.Day <= 18) ? eZodiacs.Aquarius : eZodiacs.Pisces; break; case (int)eMonth.March: zodiac = (i_DateOfBirth.Day <= 20) ? eZodiacs.Pisces : eZodiacs.Aries; break; case (int)eMonth.April: zodiac = (i_DateOfBirth.Day <= 20) ? eZodiacs.Aries : eZodiacs.Taurus; break; case (int)eMonth.May: zodiac = (i_DateOfBirth.Day <= 20) ? eZodiacs.Taurus : eZodiacs.Gemini; break; case (int)eMonth.June: zodiac = (i_DateOfBirth.Day <= 20) ? eZodiacs.Gemini : eZodiacs.Cancer; break; case (int)eMonth.July: zodiac = (i_DateOfBirth.Day <= 22) ? eZodiacs.Cancer : eZodiacs.Leo; break; case (int)eMonth.August: zodiac = (i_DateOfBirth.Day <= 22) ? eZodiacs.Leo : eZodiacs.Virgo; break; case (int)eMonth.September: zodiac = (i_DateOfBirth.Day <= 22) ? eZodiacs.Virgo : eZodiacs.Libra; break; case (int)eMonth.October: zodiac = (i_DateOfBirth.Day <= 22) ? eZodiacs.Libra : eZodiacs.Scorpio; break; case (int)eMonth.November: zodiac = (i_DateOfBirth.Day <= 21) ? eZodiacs.Scorpio : eZodiacs.Sagittarius; break; case (int)eMonth.December: zodiac = (i_DateOfBirth.Day <= 21) ? eZodiacs.Sagittarius : eZodiacs.Capricorn; break; } return(zodiac); }
internal static Image GetZodiacImage(eZodiacs i_Zodiac) { Image image = null; switch (i_Zodiac) { case eZodiacs.Aquarius: image = Properties.Resources.Aquarius_Astrology_Img; break; case eZodiacs.Aries: image = Properties.Resources.Aries_Astrology_Img; break; case eZodiacs.Cancer: image = Properties.Resources.Cancer_Astrology_Img; break; case eZodiacs.Capricorn: image = Properties.Resources.capricorn_Astrology_Img; break; case eZodiacs.Gemini: image = Properties.Resources.Gemini_Astrology_Img; break; case eZodiacs.Leo: image = Properties.Resources.Leo_Astrology_Img; break; case eZodiacs.Libra: image = Properties.Resources.Libra_Astrology_Img; break; case eZodiacs.Pisces: image = Properties.Resources.Pisces_Astrology_Img; break; case eZodiacs.Sagittarius: image = Properties.Resources.sagittarius_Astrology_Img; break; case eZodiacs.Scorpio: image = Properties.Resources.Scorpio_Astrology_Img; break; case eZodiacs.Taurus: image = Properties.Resources.Taurus_Astrology_Img; break; case eZodiacs.Virgo: image = Properties.Resources.Virgo_Astrology_Img; break; } return(image); }
private void fetchHoroscopeNameAndImage() { string dateOfBirth = FBAgent.LoggedInUser.Birthday; DateTime userDOB = DateTime.ParseExact(dateOfBirth, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); m_ZodiacName = HoroscopeAgent.GetZodiacName(userDOB); pictureBoxHoroscope.Image = HoroscopeAgent.GetZodiacImage(m_ZodiacName); labelHoroscopeTitle.Text = string.Format("You Are {0}!", m_ZodiacName.ToString()); }
internal static string GetHoroscope(eZodiacs i_Zodiac) { string horoscope = null; string horoscopeURL = "http://horoscope-api.herokuapp.com/horoscope/today/" + i_Zodiac.ToString(); string response = HttpGetRequest(horoscopeURL); horoscope = getHoroscopeText(response); return(horoscope); }