// populates rich text box based on which button is clicked private void populateMinorBox(int minorID) { string jsonMinors = rest.getRESTData("/minors/"); Minors minors = JToken.Parse(jsonMinors).ToObject <Minors>(); lbl_minor_title.Text = minors.UgMinors[minorID].title; rtb_minor_desc.Text = minors.UgMinors[minorID].description; rtb_minor_note.Text = minors.UgMinors[minorID].note; minor_course_listView.Clear(); minor_course_listView.View = View.Details; minor_course_listView.Columns.Add("Courses", 100); ListViewItem item; for (var i = 0; i < minors.UgMinors[minorID].courses.Count; i++) { item = new ListViewItem(new string[] { minors.UgMinors[minorID].courses[i] }); minor_course_listView.Items.Add(item); } }
public void createMinors() { string jsonMinors = istRest.getRESTData("/minors/UgMinors/"); // Cast the objects Minors minors = JToken.Parse(jsonMinors).ToObject <Minors>(); int x = 50; int y = 70; int y2 = 70; foreach (Minor minor in minors.UgMinors) { String title = minor.title; minorsTab.Controls.Add(e.createLabel(title, x, y, 230, 20)); y += 20; minorsTab.Controls.Add(e.createTextBox(minor.description, x, y, 230, 75)); y += 100; minorsTab.Controls.Add(e.createLabel("Courses", x, y)); foreach (String con in minor.courses) { y += 22; minorsTab.Controls.Add(e.createLabel(" \u2022" + con, x, y)); } x += 320; if (x > 1100) { y2 += 350; x = 50; } y = y2; } }
} //end of employment page private void tab_Minors_Enter(object sender, EventArgs e) { string jsonMinors = rest.getRESTData("/minors/"); Minors minors = JToken.Parse(jsonMinors).ToObject <Minors>(); for (int i = 0; i < minors.UgMinors.Count; i++) { var minor_btn = Controls.Find("btn_minor" + (i), true).FirstOrDefault(); minor_btn.Text = minors.UgMinors[i].name.ToUpper(); minor_btn.Click += new EventHandler(this.Minor_Btn_Click); } //end undergrad for loop } //end of minors page