コード例 #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
ファイル: Page6.xaml.cs プロジェクト: ksdhami/School-Carpool
        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];
            }
        }