Ejemplo n.º 1
0
        private void buttonSignOfZodiac_Click(object sender, EventArgs e)
        {
            string   value   = string.Empty;
            DateTime date    = m_FacebookServicesFacade.BirthdayOfUserDateTime(m_LoggedInUser);
            eZodiac  getLuck = m_FacebookServicesFacade.GetZodiac(date);

            m_FacebookServicesFacade.YourLuckData().TryGetValue(getLuck, out value);
            textBoxZodiac.Text = value;

            switch (getLuck)
            {
            case eZodiac.Aries:
                pictureBoxZodiac.Image = Properties.Resources.Aries;
                break;

            case eZodiac.Libra:
                pictureBoxZodiac.Image = Properties.Resources.Libra;
                break;

            case eZodiac.Scorpio:
                pictureBoxZodiac.Image = Properties.Resources.Scorpio;
                break;

            case eZodiac.Aquarius:
                pictureBoxZodiac.Image = Properties.Resources.Aquarius;
                break;

            case eZodiac.Cancer:
                pictureBoxZodiac.Image = Properties.Resources.Cancer;
                break;

            case eZodiac.Capricorn:
                pictureBoxZodiac.Image = Properties.Resources.Capricorn;
                break;

            case eZodiac.Gemini:
                pictureBoxZodiac.Image = Properties.Resources.Gemini;
                break;

            case eZodiac.Leo:
                pictureBoxZodiac.Image = Properties.Resources.Leo;
                break;

            case eZodiac.Pisces:
                pictureBoxZodiac.Image = Properties.Resources.Pisces;
                break;

            case eZodiac.Sagittarius:
                pictureBoxZodiac.Image = Properties.Resources.Sagittarius;
                break;

            case eZodiac.Taurus:
                pictureBoxZodiac.Image = Properties.Resources.Taurus;
                break;

            case eZodiac.Virgo:
                pictureBoxZodiac.Image = Properties.Resources.Virgo;
                break;
            }
        }
Ejemplo n.º 2
0
        public void ArrangeFriendsByZodiacSign()
        {
            List <User> allFriendLoggedIn = m_FacebookServicesFacade.GetAllUserFriends();

            int       indexOfRowFriend = 0;
            ImageList imgs             = new ImageList();

            imgs.ImageSize = new Size(50, 50);
            DateTime dataUser = m_FacebookServicesFacade.BirthdayOfUserDateTime(m_LoggedInUser);

            DateTime friendBirthday;
            eZodiac  userZodiacSign = m_FacebookServicesFacade.GetZodiac(dataUser);
            eZodiac  friendsZodiacSigns;

            foreach (User friend in allFriendLoggedIn)
            {
                friendBirthday     = DateTime.ParseExact(friend.Birthday, "MM/dd/yyyy", CultureInfo.InvariantCulture);
                friendsZodiacSigns = m_FacebookServicesFacade.GetZodiac(friendBirthday);

                if (userZodiacSign.Equals(friendsZodiacSigns))
                {
                    pictureBox4.Load(friend.PictureNormalURL);
                    imgs.Images.Add(pictureBox4.Image);
                    listViewFriendsLuck.SmallImageList = imgs;
                    listViewFriendsLuck.Items.Add(friend.Name, indexOfRowFriend);
                    indexOfRowFriend++;
                }
            }
        }
        public static eZodiac GetZodiac(DateTime i_DateTime)
        {
            eZodiac zodiacSign = eZodiac.Null;
            eMonth  month      = (eMonth)i_DateTime.Month;
            int     day        = i_DateTime.Day;

            switch (month)
            {
            case eMonth.January:
                zodiacSign = (day < 20) ? eZodiac.Capricorn : eZodiac.Aquarius;
                break;

            case eMonth.February:
                zodiacSign = (day < 19) ? eZodiac.Aquarius : eZodiac.Pisces;
                break;

            case eMonth.March:
                zodiacSign = (day < 21) ? eZodiac.Pisces : eZodiac.Aries;
                break;

            case eMonth.April:
                zodiacSign = (day < 20) ? eZodiac.Aries : eZodiac.Taurus;
                break;

            case eMonth.May:
                zodiacSign = (day < 21) ? eZodiac.Taurus : eZodiac.Gemini;
                break;

            case eMonth.June:
                zodiacSign = (day < 21) ? eZodiac.Gemini : eZodiac.Cancer;
                break;

            case eMonth.July:
                zodiacSign = (day < 23) ? eZodiac.Cancer : eZodiac.Leo;
                break;

            case eMonth.August:
                zodiacSign = (day < 23) ? eZodiac.Leo : eZodiac.Virgo;
                break;

            case eMonth.September:
                zodiacSign = (day < 23) ? eZodiac.Virgo : eZodiac.Libra;
                break;

            case eMonth.October:
                zodiacSign = (day < 23) ? eZodiac.Libra : eZodiac.Scorpio;
                break;

            case eMonth.November:
                zodiacSign = (day < 22) ? eZodiac.Scorpio : eZodiac.Sagittarius;
                break;

            case eMonth.December:
                zodiacSign = (day < 22) ? eZodiac.Sagittarius : eZodiac.Capricorn;
                break;
            }

            return(zodiacSign);
        }
        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);
        }
Ejemplo n.º 5
0
        private void buttonFamous_Click(object sender, EventArgs e)
        {
            {
                string   nameOfTheFamous = string.Empty;
                DateTime date            = m_FacebookServicesFacade.BirthdayOfUserDateTime(m_LoggedInUser);
                eZodiac  getLuck         = m_FacebookServicesFacade.GetZodiac(date);

                m_FacebookServicesFacade.CelebsData().TryGetValue(getLuck, out nameOfTheFamous);
                textBoxNameFamous.Text = nameOfTheFamous;

                switch (getLuck)
                {
                case eZodiac.Aries:
                    pictureBoxCeleb.Image = Properties.Resources.sarahJessicaParker;
                    break;

                case eZodiac.Libra:
                    pictureBoxCeleb.Image = Properties.Resources.gandhi;
                    break;

                case eZodiac.Scorpio:
                    pictureBoxCeleb.Image = Properties.Resources.billGates;
                    break;

                case eZodiac.Aquarius:
                    pictureBoxCeleb.Image = Properties.Resources.oprahWinfrey;
                    break;

                case eZodiac.Cancer:
                    pictureBoxCeleb.Image = Properties.Resources.ladyDiana;
                    break;

                case eZodiac.Capricorn:
                    pictureBoxCeleb.Image = Properties.Resources.elvisPresley;
                    break;

                case eZodiac.Gemini:
                    pictureBoxCeleb.Image = Properties.Resources.marilynMonroe;
                    break;

                case eZodiac.Leo:
                    pictureBoxCeleb.Image = Properties.Resources.Madonna;
                    break;

                case eZodiac.Pisces:
                    pictureBoxCeleb.Image = Properties.Resources.yitzhakRabin;
                    break;

                case eZodiac.Sagittarius:
                    pictureBoxCeleb.Image = Properties.Resources.bruceLee;
                    break;

                case eZodiac.Taurus:
                    pictureBoxCeleb.Image = Properties.Resources.davidBeckham;
                    break;

                case eZodiac.Virgo:
                    pictureBoxCeleb.Image = Properties.Resources.seanConnery;
                    break;
                }
            }
        }