Exemple #1
0
        public void createResearchTab()
        {
            String jsonResearch = istRest.getRESTData("/research/");

            // Cast the objects
            Research research = JToken.Parse(jsonResearch).ToObject <Research>();
            int      x        = 50;
            int      y        = 50;

            foreach (ByFaculty fac in research.byFaculty)
            {
                Panel panel = new Panel();
                panel.Size      = new Size(400, 50);
                panel.BackColor = Color.Orange;
                panel.Click    += (s, e) =>
                {
                    PopupForm p = new PopupForm(fac.citations);
                    p.ShowDialog();
                };
                Label label = e.createLabel(fac.facultyName, 0, 0);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(fac.citations);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                panel.Location = new Point(x, y);
                researchTab.Controls.Add(panel);
                y += 90;
            }
            x += 500;
            y  = 50;
            foreach (ByInterestArea area in research.byInterestArea)
            {
                Panel panel = new Panel();
                panel.Size      = new Size(400, 50);
                panel.BackColor = Color.Orange;
                panel.Click    += (s, e) =>
                {
                    PopupForm p = new PopupForm(area.citations);
                    p.ShowDialog();
                };
                Label label = e.createLabel(area.areaName, 0, 0);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(area.citations);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                panel.Location = new Point(x, y);
                researchTab.Controls.Add(panel);
                y += 90;
            }
        }
Exemple #2
0
        //Creates the content for the people tab
        public void createPPl()
        {
            string jsonPeople = istRest.getRESTData("/people/");

            // Cast the objects
            People people = JToken.Parse(jsonPeople).ToObject <People>();

            pplTab.Controls.Add(e.createLabel(people.title, 10, 10));
            pplTab.Controls.Add(e.createLabel(people.subTitle, 10, 40, 500, 20));

            // Print out all the faculty names
            int x = 20;
            int y = 90;

            pplTab.Controls.Add(e.createLabel("Our Faculty", x, y));
            y += 40;
            foreach (Faculty thisFac in people.faculty)
            {
                PictureBox pb = new PictureBox();
                pb.Size     = new Size(150, 150);
                pb.Location = new Point(x, y);
                pb.SizeMode = PictureBoxSizeMode.StretchImage;
                pb.Load(thisFac.imagePath);
                pb.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(thisFac);
                    p.ShowDialog();
                };
                pplTab.Controls.Add(pb);
                y += 160;
                pplTab.Controls.Add(e.createLabel(thisFac.name, x, y));
                y -= 160;
                if (x >= 650)
                {
                    x  = 20;
                    y += 210;
                }
                else
                {
                    x += 200;
                }
            }
            y += 240;
            x  = 20;
            pplTab.Controls.Add(e.createLabel("Our Staff", x, y));
            y += 30;
            foreach (Staff staff in people.staff)
            {
                PictureBox pb = new PictureBox();
                pb.Size     = new Size(150, 150);
                pb.Location = new Point(x, y);
                pb.SizeMode = PictureBoxSizeMode.StretchImage;
                pb.Load(staff.imagePath);
                pb.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(staff);
                    p.ShowDialog();
                };
                pplTab.Controls.Add(pb);
                y += 160;
                pplTab.Controls.Add(e.createLabel(staff.name, x, y));
                y -= 160;
                if (x >= 650)
                {
                    x  = 20;
                    y += 210;
                }
                else
                {
                    x += 200;
                }
            }
            y += 240;
            x  = 20;
            pplTab.Controls.Add(e.createLabel("Our Staff", x, y));
        }
Exemple #3
0
        public void createNewsTab()
        {
            String jsonEmployment = istRest.getRESTData("/news/");

            // Cast the objects
            News news = JToken.Parse(jsonEmployment).ToObject <News>();
            int  x    = 50;
            int  y    = 50;

            foreach (Article article in news.year)
            {
                Panel panel = new Panel();
                panel.Size      = new Size(400, 50);
                panel.BackColor = Color.Orange;
                panel.Click    += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                Label label = e.createLabel(article.title, 0, 0);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                label        = e.createLabel(article.date, 0, 20);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                panel.Location = new Point(x, y);
                newsTab.Controls.Add(panel);
                y += 90;
            }
            x += 450;
            y  = 50;
            foreach (Article article in news.older)
            {
                Panel panel = new Panel();
                panel.Size      = new Size(400, 50);
                panel.BackColor = Color.Orange;
                panel.Click    += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                Label label = e.createLabel(article.title, 0, 0);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                label        = e.createLabel(article.date, 0, 20);
                label.Click += (s, e) =>
                {
                    PopupForm p = new PopupForm(article.description);
                    p.ShowDialog();
                };
                panel.Controls.Add(label);
                panel.Location = new Point(x, y);
                newsTab.Controls.Add(panel);
                y += 90;
            }
        }