//code to show undergraduate degree private void undergraduateFn() { string degreelink = baseurl.getRestData("/degrees/"); //Console.WriteLine(degreelink); degree = JToken.Parse(degreelink).ToObject <DegreePrograms>(); List <Undergraduate> ugdegree = degree.undergraduate; ugTitle.Text = "Undergraduate Degrees"; ugTitle.MaximumSize = new Size(1000, 0); ugTitle.Location = new Point(((this.ClientSize.Width - ugTitle.Width) / 2) - 75, 50); ugTitle.AutoSize = true; TableLayoutPanel panelUg = new TableLayoutPanel(); panelUg.Location = new Point((this.ClientSize.Width - panelUg.Width) / 6, 100); panelUg.RowCount = 1; panelUg.ColumnCount = 3; ugPage.Controls.Add(panelUg); for (int i = 0; i < ugdegree.Count; i++) { Undergraduate ug = ugdegree[i]; MetroFramework.Controls.MetroTile tile = new MetroFramework.Controls.MetroTile(); tile.Size = new Size(300, 200); tile.TextAlign = ContentAlignment.MiddleCenter; tile.Style = MetroFramework.MetroColorStyle.Orange; tile.Text = ug.title; tile.Click += new EventHandler(TileClickEvent); tile.Name = ug.degreeName; panelUg.Controls.Add(tile, i, 0); } panelUg.Size = new Size(ugdegree.Count * 300, 200); }
//code to show graduate degree offered private void graduateFn() { string degreelink = baseurl.getRestData("/degrees/"); //Console.WriteLine(degreelink); degree = JToken.Parse(degreelink).ToObject <DegreePrograms>(); List <Graduate> gdegree = degree.graduate; gTitle.Text = "Graduate Degrees"; gTitle.MaximumSize = new Size(1000, 0); gTitle.Location = new Point(((this.ClientSize.Width - gTitle.Width) / 2) - 75, 50); gTitle.AutoSize = true; TableLayoutPanel panelg = new TableLayoutPanel(); panelg.Location = new Point((this.ClientSize.Width - panelg.Width) / 6, 100); panelg.RowCount = 1; panelg.ColumnCount = gdegree.Count - 1; gPage.Controls.Add(panelg); for (int i = 0; i < gdegree.Count; i++) { Graduate g = gdegree[i]; if (g.availableCertificates == null) { MetroFramework.Controls.MetroTile tile = new MetroFramework.Controls.MetroTile(); tile.Size = new Size(300, 200); tile.TextAlign = ContentAlignment.MiddleCenter; tile.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(g.title); tile.Click += new EventHandler(TileClickEventG); tile.Style = MetroFramework.MetroColorStyle.Orange; tile.Name = g.degreeName; panelg.Controls.Add(tile, i, 0); } else { Label label = new Label(); gPage.Controls.Add(label); label.BackColor = Color.Transparent; label.Font = new Font("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); label.ForeColor = Color.Black; label.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(g.degreeName); label.AutoSize = true; label.Location = new Point(((this.ClientSize.Width - label.Width) / 2), 350); //label.MaximumSize = new Size(this.Width / 2, 0); label.TextAlign = ContentAlignment.MiddleCenter; int count = 10; foreach (string cont in g.availableCertificates) { count = count + 40; Label label1 = new Label(); gPage.Controls.Add(label1); label1.BackColor = Color.Transparent; label1.Font = new Font("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); label1.ForeColor = Color.Black; label1.Name = cont; label1.Text = cont; label1.AutoSize = true; label1.Location = new Point(((this.ClientSize.Width - label1.Width) / 2), 350 + count); //label.MaximumSize = new Size(this.Width / 2, 0); label1.TextAlign = ContentAlignment.MiddleCenter; } } } panelg.Size = new Size((gdegree.Count - 1) * 300, 200); }