Esempio n. 1
0
        }//void getstaffdata(Object sender, EventArgs e)

        //get research data
        public void getreasearch()
        {
            string   research     = getRestData("/research/");
            Research researchdata = JToken.Parse(research).ToObject <Research>();

            int brh = 0;

            //adding the dynamic data for the research buttons set
            for (int i = 0; i < researchdata.byInterestArea.Count(); i++)
            {
                Button button = new Button();
                button.Name     = researchdata.byInterestArea[i].areaName;
                button.Text     = researchdata.byInterestArea[i].areaName;
                button.Margin   = new Padding(10);
                button.TabIndex = 0;
                button.Click   += new EventHandler(getresearchdatabyinterest);
                button.Location = new Point(953, 95 + brh);
                button.Size     = new Size(100, 60);
                //flowpanel  data appending
                flowLayoutPanel3.Controls.Add(button);
            }//for (int i = 0; i < researchdata.byInterestArea.Count(); i++)

            //adding the button into the flow layout panel by faculty name
            for (int i = 0; i < researchdata.byFaculty.Count(); i++)
            {
                Button button = new Button();
                button.Name     = researchdata.byFaculty[i].username;
                button.Text     = researchdata.byFaculty[i].facultyName;
                button.Margin   = new Padding(10);
                button.TabIndex = 0;
                button.Click   += new EventHandler(getresearchdatabyfaculty);
                button.Location = new Point(953, 95 + brh);
                button.Size     = new Size(100, 60);
                //flowpanel name
                flowLayoutPanel4.Controls.Add(button);
            } //for (int i = 0; i < researchdata.byFaculty.Count(); i++)
        }     //end of public void getreasearch()
Esempio n. 2
0
        }//end of employment

        private void research_Enter(object sender, EventArgs e)
        {
            // get About information
            string jsonAbout = getRestData("/research/");

            // need a way to get the JSON form into a Research object
            Research research = JToken.Parse(jsonAbout).ToObject <Research>();
            int      i        = 0;

            //adding dynamic button to the page
            Button[] button = new Button[15];
            rtext.Text = research.byInterestArea[0].citations[0] + "\n";
            //adding area of interest citation
            for (int p = 1; p < research.byInterestArea[0].citations.Count(); p++)
            {
                rtext.Text += research.byInterestArea[0].citations[p] + "\n";
            }
            ftext.Text = research.byFaculty[0].citations[0] + "\n";
            //adding interest citation for faculty
            for (int p = 1; p < research.byFaculty[0].citations.Count(); p++)
            {
                ftext.Text += research.byInterestArea[0].citations[p] + "\n";
            }
            //button for each area
            foreach (ByInterestArea ar in research.byInterestArea)
            {
                button[i]          = new Button();
                button[i].Location = new Point(10, 35 * i);
                button[i].Size     = new Size(272, 35);
                button[i].Name     = ar.areaName;
                button[i].Text     = ar.areaName;
                button[i].Click   += buttonArea_click;
                i++;
            }
            areapanel.Controls.AddRange(button);

            //research by faculty
            Button[] buttonfac = new Button[40];
            i = 0;
            int j = 0;

            //adding button for each faculty study
            foreach (ByFaculty ar in research.byFaculty)
            {
                buttonfac[i]        = new Button();
                buttonfac[i].Size   = new Size(272, 40);
                buttonfac[i].Name   = ar.username;
                buttonfac[i].Text   = ar.facultyName;
                buttonfac[i].Click += buttonFac_click;
                if (i > 10)
                {
                    buttonfac[i].Location = new Point(10, 40 * j);
                    facultyPanel2.Controls.Add(buttonfac[i]);
                    j++;
                }
                else
                {
                    buttonfac[i].Location = new Point(10, 40 * i);
                    facultyPanel.Controls.Add(buttonfac[i]);
                }
                i++;
            }
        }//end of research