public List <User> ZodiacFriends(IFriendsBy i_FriendsBy, List <User> i_allFriends) { List <User> friendsByZoaidc = new List <User>(); foreach (User friend in i_allFriends) { eZodiac friendsZodiacSigns = GetZodiac(DateTime.ParseExact(friend.Birthday, "MM/dd/yyyy", CultureInfo.InvariantCulture)); if (i_FriendsBy.FriendsBy(friendsZodiacSigns.ToString())) { friendsByZoaidc.Add(friend); } } return(friendsByZoaidc); }
public List <User> AllFriendByZodiacSign(IFriendsBy i_FriendsBy) { List <User> allMyFriends = m_FacebookBasicFeatures.GetAllUserFriends(); return(m_YourLuckFeature.ZodiacFriends(i_FriendsBy, allMyFriends)); }
private void listBoxZodiacSignFriends_SelectedValueChanged(object sender, EventArgs e) { listBoxFriendHaveSign.Items.Clear(); string zodiac = listBoxZodiacSignFriends.SelectedItem as string; IFriendsBy whichSign = null; switch (zodiac) { case "Aquarius": whichSign = new FriendsByAquarius(); break; case "Aries": whichSign = new FriendsByAries(); break; case "Cancer": whichSign = new FriendsByCancer(); break; case "Capricorn": whichSign = new FriendsByCapricorn(); break; case "Gemini": whichSign = new FriendsByGemini(); break; case "Leo": whichSign = new FriendsByLeo(); break; case "Libra": whichSign = new FriendsByLibra(); break; case "Pisces": whichSign = new FriendsByPisces(); break; case "Sagittarius": whichSign = new FriendsBySagittarius(); break; case "Scorpio": whichSign = new FriendsByScorpio(); break; case "Taurus": whichSign = new FriendsByTaurus(); break; case "Virgo": whichSign = new FriendsByVirgo(); break; } List <User> friendBy = m_FacebookServicesFacade.AllFriendByZodiacSign(whichSign); foreach (User friend in friendBy) { listBoxFriendHaveSign.Items.Add(friend.Name); } }