Пример #1
0
        public void Setup_give_pool(string find)
        {
            string[] my_pools = user.Load_pools(find);

            string[] pool_info;

            //block 1
            pool_info = my_pools[0].Split('|');

            person tmp_usr = new person(pool_info[0]);

            info21.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            string directory = Directory.GetCurrentDirectory();

            pic21.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating21.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time21.Content  = pool_info[2] + " on " + pool_info[4];
            dest21.Content  = pool_info[3];

            //block 2
            pool_info = my_pools[1].Split('|');

            tmp_usr        = new person(pool_info[0]);
            info22.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            pic22.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating22.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time22.Content  = pool_info[2] + " on " + pool_info[4];
            dest22.Content  = pool_info[3];

            //block 3
            pool_info = my_pools[2].Split('|');

            tmp_usr        = new person(pool_info[0]);
            info23.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            pic23.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating23.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time23.Content  = pool_info[2] + " on " + pool_info[4];
            dest23.Content  = pool_info[3];

            //block 4
            pool_info = my_pools[3].Split('|');

            tmp_usr        = new person(pool_info[0]);
            info24.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            pic24.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating24.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time24.Content  = pool_info[2] + " on " + pool_info[4];
            dest24.Content  = pool_info[3];

            //block 5
            pool_info = my_pools[4].Split('|');

            tmp_usr        = new person(pool_info[0]);
            info25.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            pic25.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating25.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time25.Content  = pool_info[2] + " on " + pool_info[4];
            dest25.Content  = pool_info[3];

            //block 6
            pool_info = my_pools[5].Split('|');

            tmp_usr        = new person(pool_info[0]);
            info26.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            pic26.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));

            rating26.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time26.Content  = pool_info[2] + " on " + pool_info[4];
            dest26.Content  = pool_info[3];
        }
Пример #2
0
        public void Setup_my_pool(string find)
        {
            string[] my_pools = user.Load_pools(find);

            string[] pool_info;

            if (my_pools[0] == null)
            {
                return;
            }
            //block 1
            pool_info = my_pools[0].Split('|');

            person tmp_usr = new person(pool_info[0]);

            info1.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            string directory = Directory.GetCurrentDirectory();

            try
            {
                pic1.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
            }
            catch (Exception ex)
            {
                pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                Console.WriteLine("Error loading file");
            }
            rating1.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time1.Content  = pool_info[2] + " on " + pool_info[4];
            dest1.Content  = pool_info[3];

            //block 2
            if (my_pools[1] == null)
            {
                return;
            }
            pool_info = my_pools[1].Split('|');

            tmp_usr       = new person(pool_info[0]);
            info2.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            try
            {
                pic2.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
            }
            catch (Exception ex)
            {
                pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                Console.WriteLine("Error loading file");
            }
            rating2.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time2.Content  = pool_info[2] + " on " + pool_info[4];
            dest2.Content  = pool_info[3];

            //block 3
            if (my_pools[2] == null)
            {
                return;
            }
            pool_info = my_pools[2].Split('|');

            tmp_usr       = new person(pool_info[0]);
            info3.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();

            try
            {
                pic3.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
            }
            catch (Exception ex)
            {
                pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                Console.WriteLine("Error loading file");
            }
            rating3.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time3.Content  = pool_info[2] + " on " + pool_info[4];
            dest3.Content  = pool_info[3];

            //block 4
            if (my_pools[3] == null)
            {
                return;
            }
            pool_info = my_pools[3].Split('|');

            tmp_usr       = new person(pool_info[0]);
            info4.Content = tmp_usr.getFirstName() + ": " + tmp_usr.getBio();
            try
            {
                pic4.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
            }
            catch (Exception ex)
            {
                pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                Console.WriteLine("Error loading file");
            }
            rating4.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
            time4.Content  = pool_info[2] + " on " + pool_info[4];
            dest4.Content  = pool_info[3];
        }
Пример #3
0
        private void Display_msg(int msg_index, string[] parts)
        {
            string directory = Directory.GetCurrentDirectory();
            string msg       = parts[3];
            string time      = parts[2];

            person sender = new person(parts[1]);

            if (msg_index == 0)
            {
                name1.Content = sender.getFirstName();
                msg1.Content  = msg;
                time1.Content = time;
                pic1.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }

            else if (msg_index == 1)
            {
                name2.Content = sender.getFirstName();
                msg2.Content  = msg;
                time2.Content = time;
                pic2.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 2)
            {
                name3.Content = sender.getFirstName();
                msg3.Content  = msg;
                time3.Content = time;
                pic3.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 3)
            {
                name4.Content = sender.getFirstName();
                msg4.Content  = msg;
                pic4.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 4)
            {
                name5.Content = sender.getFirstName();
                msg5.Content  = msg;
                pic5.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 5)
            {
                name6.Content = sender.getFirstName();
                msg6.Content  = msg;
                pic6.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 6)
            {
                name7.Content = sender.getFirstName();
                msg7.Content  = msg;
                pic7.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 7)
            {
                name8.Content = sender.getFirstName();
                msg8.Content  = msg;
                pic8.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 8)
            {
                name9.Content = sender.getFirstName();
                msg9.Content  = msg;
                pic9.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
            else if (msg_index == 9)
            {
                name10.Content = sender.getFirstName();
                msg10.Content  = msg;
                pic10.Source   = new BitmapImage(new Uri(directory + "\\" + sender.getPhotoPath()));
            }
        }
Пример #4
0
        public Page6(string usr_email)
        {
            InitializeComponent();
            user = new person(usr_email);

            my_pools   = user.Load_pools(user.getEmail());
            get_pools  = user.Load_pools("GET");
            give_pools = user.Load_pools("GIVE");

            //[email protected]|GIVE|TIME|DEST|DATE|STATUS|POOLER_EMAIL
            Console.WriteLine(my_pools);
            string[] pool_info;

            if (my_pools[0] != null)
            {
                pool_info = my_pools[0].Split('|');

                person tmp_usr = new person(pool_info[0]);
                info2.Content = tmp_usr.getBio();

                string directory = Directory.GetCurrentDirectory();
                try
                {
                    pic2.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
                }
                catch (Exception ex)
                {
                    pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                    Console.WriteLine("Error loading file");
                }

                rating2.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
                time2.Content  = pool_info[2];
                dest2.Content  = pool_info[3];

                pool_info = my_pools[1].Split('|');

                tmp_usr       = new person(pool_info[0]);
                info3.Content = tmp_usr.getBio();

                try
                {
                    pic3.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
                }
                catch (Exception ex)
                {
                    pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                    Console.WriteLine("Error loading file");
                }

                rating3.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
                time3.Content  = pool_info[2];
                dest3.Content  = pool_info[3];

                pool_info = my_pools[2].Split('|');

                tmp_usr       = new person(pool_info[0]);
                info4.Content = tmp_usr.getBio();

                try
                {
                    pic4.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
                }
                catch (Exception ex)
                {
                    pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                    Console.WriteLine("Error loading file");
                }

                rating4.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
                time4.Content  = pool_info[2];
                dest4.Content  = pool_info[3];

                pool_info = my_pools[3].Split('|');

                tmp_usr       = new person(pool_info[0]);
                info5.Content = tmp_usr.getBio();

                try
                {
                    pic5.Source = new BitmapImage(new Uri(directory + "\\" + tmp_usr.getPhotoPath()));
                }
                catch (Exception ex)
                {
                    pic2.Source = new BitmapImage(new Uri(@"C:\Users\Ahmad\Documents\WpfApp1\WpfApp1\unkown.png"));
                    Console.WriteLine("Error loading file");
                }

                rating5.Source = new BitmapImage(new Uri(directory + "\\rating.png"));
                time5.Content  = pool_info[2];
                dest5.Content  = pool_info[3];
            }
        }
Пример #5
0
 public Page16(string usr_email)
 {
     InitializeComponent();
     user = new person(usr_email);
 }