private void tb_Employment_Click(object sender, EventArgs e) { string jsonEmployment = get.GET("/employment/"); employment = JToken.Parse(jsonEmployment).ToObject <Employment>(); lb_employment_title.Text = employment.introduction.title; lb_title1.Text = employment.introduction.content[0].title; lb_description1.Text = employment.introduction.content[0].description; }
private Employment loadData() { if (employment == null) { string jsonEmployment = rest.getRESTData("/employment/"); employment = JToken.Parse(jsonEmployment).ToObject <Employment>(); } return(employment); }
// Consumes employment data and displays the introduction data to the form public void Introduction() { string jsonEmployment = getRESTData("/employment"); Employment emp = JToken.Parse(jsonEmployment).ToObject <Employment>(); // Intro lblIntroTitle.Text = emp.introduction.title; lblIntroEmp.Text = emp.introduction.content[0].title; rtbIntroEmp.Text = emp.introduction.content[0].description; lblIntroCoop.Text = emp.introduction.content[1].title; rtbIntroCoop.Text = emp.introduction.content[1].description; }
private Employment loadData() { if (employment == null) { // Get employment data string jsonEmployment = rest.getRESTData("/employment/"); // Cast to the object employment = JToken.Parse(jsonEmployment).ToObject <Employment>(); } return(employment); }
// Consumes employment data and displays degreeStatistics data to the form public void Stats() { string jsonEmployment = getRESTData("/employment"); Employment emp = JToken.Parse(jsonEmployment).ToObject <Employment>(); // Stats lblStats.Text = emp.degreeStatistics.title; gbStat1.Text = emp.degreeStatistics.statistics[0].value; rtbStat1.Text = emp.degreeStatistics.statistics[0].description; gbStat2.Text = emp.degreeStatistics.statistics[1].value; rtbStat2.Text = emp.degreeStatistics.statistics[1].description; gbStat3.Text = emp.degreeStatistics.statistics[2].value; rtbStat3.Text = emp.degreeStatistics.statistics[2].description; gbStat4.Text = emp.degreeStatistics.statistics[3].value; rtbStat4.Text = emp.degreeStatistics.statistics[3].description; }
private void tabEmployment_Click(object sender, EventArgs e) { string jsonEmployment = get.GET("/employment/"); employment = JToken.Parse(jsonEmployment).ToObject <Employment>(); lb_employment_title.Text = employment.introduction.title; int x = 0; int y = 0; for (int i = 0; i < employment.introduction.content.Count; i++) { Label labelEmployment = new Label(); tabEmployment.Controls.Add(labelEmployment); labelEmployment.Location = new Point(x, y); y += 10; labelEmployment.Text = "test"; } }
// Consumes employment data and diplays coopTable data to a treeNode in the form public void CoopTable() { string jsonEmployment = getRESTData("/employment"); Employment coop = JToken.Parse(jsonEmployment).ToObject <Employment>(); lblCoopTable.Text = coop.coopTable.title; // Adds coopTable info to a treeview in the form foreach (CoopInformation coopTable in coop.coopTable.coopInformation) { TreeNode employer = new TreeNode(coopTable.employer); TreeNode degree = new TreeNode("Degree: " + coopTable.degree); TreeNode city = new TreeNode("City: " + coopTable.city); TreeNode term = new TreeNode("Term: " + coopTable.term); employer.Nodes.Add(degree); employer.Nodes.Add(city); employer.Nodes.Add(term); tvCoop.Nodes.Add(employer); } }
// Consumes employment data and displays employerTable data to a treeNode in the form public void EmpTable() { string jsonEmployment = getRESTData("/employment"); Employment emp = JToken.Parse(jsonEmployment).ToObject <Employment>(); lblEmpTable.Text = emp.employmentTable.title; // Adds employmentTable data to a treeview in the form foreach (ProfessionalEmploymentInformation empTable in emp.employmentTable.professionalEmploymentInformation) { TreeNode employer = new TreeNode(empTable.employer); TreeNode degree = new TreeNode("Degree: " + empTable.degree); TreeNode city = new TreeNode("City: " + empTable.city); TreeNode title = new TreeNode("Title: " + empTable.title); TreeNode startDate = new TreeNode("Start Date: " + empTable.startDate); employer.Nodes.Add(degree); employer.Nodes.Add(city); employer.Nodes.Add(title); employer.Nodes.Add(startDate); tvEmp.Nodes.Add(employer); } }
// Consumes employment data and displays employers and careers data displaying it to the form public void EmployersCareers() { string jsonEmployment = getRESTData("/employment"); Employment emp = JToken.Parse(jsonEmployment).ToObject <Employment>(); // Employers lblEmpTitle.Text = emp.employers.title; rtbEmps.Text = emp.employers.employerNames[0] + "\n"; rtbEmps.AppendText(emp.employers.employerNames[1] + "\n"); rtbEmps.AppendText(emp.employers.employerNames[2] + "\n"); rtbEmps.AppendText(emp.employers.employerNames[3] + "\n"); rtbEmps.AppendText(emp.employers.employerNames[4] + "\n"); rtbEmps.AppendText(emp.employers.employerNames[5]); // Careers lblCareersTitle.Text = emp.careers.title; rtbCareers.Text = emp.careers.careerNames[0] + "\n"; rtbCareers.AppendText(emp.careers.careerNames[1] + "\n"); rtbCareers.AppendText(emp.careers.careerNames[2] + "\n"); rtbCareers.AppendText(emp.careers.careerNames[3] + "\n"); rtbCareers.AppendText(emp.careers.careerNames[4] + "\n"); rtbCareers.AppendText(emp.careers.careerNames[5]); }
// Change body view to Employment section when "EMPLOYMENT" is clicked private void emp_btn_Click(object sender, EventArgs e) { processButtons(sender); body.SelectedTab = emp_tab; // Ensure we have data, fetch if we don't if (employment == null) { Console.WriteLine("Loading employment..."); // go get the /employment info string jsonEmp = rj.getRestJSON("/employment/"); employment = JToken.Parse(jsonEmp).ToObject <Employment>(); Introduction intro = employment.introduction; DegreeStatistics stats = employment.degreeStatistics; Employers employers = employment.employers; Careers careers = employment.careers; // Load stuff emptitle.Text = intro.title; for (int i = 0; i < employers.employerNames.Count; i++) { employer_stats.AppendText("\u2022 " + employers.employerNames[i]); if (i != employers.employerNames.Count - 1) { employer_stats.AppendText(Environment.NewLine); } } for (int i = 0; i < careers.careerNames.Count; i++) { careers_stats.AppendText("\u2022 " + careers.careerNames[i]); if (i != careers.careerNames.Count - 1) { careers_stats.AppendText(Environment.NewLine); } } for (int i = 0; i < stats.statistics.Count; i++) { stats_rtb.AppendText("\u2022 " + stats.statistics[i].value + " -- " + stats.statistics[i].description); if (i != stats.statistics.Count - 1) { stats_rtb.AppendText(Environment.NewLine); } } // Coop tab coop_desc.Text = intro.content[1].description; // populate the dataGridView... for (int i = 0; i < employment.coopTable.coopInformation.Count; i++) { DataGridView1.Rows.Add(); DataGridView1.Rows[i].Cells[0].Value = employment.coopTable.coopInformation[i].employer; DataGridView1.Rows[i].Cells[1].Value = employment.coopTable.coopInformation[i].degree; DataGridView1.Rows[i].Cells[2].Value = employment.coopTable.coopInformation[i].city; DataGridView1.Rows[i].Cells[3].Value = employment.coopTable.coopInformation[i].term; } // Professional emp tab prof_emp_desc.Text = intro.content[0].description; // populate the dataGridView... for (int i = 0; i < employment.employmentTable.professionalEmploymentInformation.Count; i++) { dataGridView2.Rows.Add(); dataGridView2.Rows[i].Cells[0].Value = employment.employmentTable.professionalEmploymentInformation[i].degree; dataGridView2.Rows[i].Cells[1].Value = employment.employmentTable.professionalEmploymentInformation[i].employer; dataGridView2.Rows[i].Cells[2].Value = employment.employmentTable.professionalEmploymentInformation[i].title; dataGridView2.Rows[i].Cells[3].Value = employment.employmentTable.professionalEmploymentInformation[i].city; dataGridView2.Rows[i].Cells[4].Value = employment.employmentTable.professionalEmploymentInformation[i].startDate; } } }
private void Start() { //get the about get = new GetClass(); // get people string jsonPeople = get.GET("/people/"); people = JToken.Parse(jsonPeople).ToObject <People>(); //get degrees string jsonDegrees = get.GET("/degrees/"); degrees = JToken.Parse(jsonDegrees).ToObject <Degrees>(); //get employment string jsonEmployment = get.GET("/employment/"); employment = JToken.Parse(jsonEmployment).ToObject <Employment>(); //get footer string jsonFooter = get.GET("/footer/"); footer = JToken.Parse(jsonFooter).ToObject <Footer>(); lb_socialTitle.Text = footer.social.title; lbtweet.Text = footer.social.tweet; ///////////////TwitterLink////////////////////// LinkLabel.Link facebookLink = new LinkLabel.Link(); facebookLink.LinkData = footer.social.facebook; link_facebook.Text = "Facebook"; link_facebook.Links.Add(facebookLink); LinkLabel.Link twitterLink = new LinkLabel.Link(); twitterLink.LinkData = footer.social.twitter; link_twitter.Text = "Twitter"; link_twitter.Links.Add(twitterLink); ////////////////About///////////////////////////////// string jsonAbout = get.GET("/about/"); about = JToken.Parse(jsonAbout).ToObject <About>(); //Console.WriteLine(jsonAbout); lbl_about_title.Text = about.title; lbl_about_description.Text = about.description; lbl_about_quote.Text = "\"" + about.quote + "\""; lbl_about_quoteAuthor.Text = "~" + about.quoteAuthor; //Console.WriteLine(jsonDegrees); int x = 20; int y = 20; foreach (Undergraduate allDegrees in degrees.undergraduate) { //create objects Label labelTitle = new Label(); Label labelDescription = new Label(); ListBox concentrationsListBox = new ListBox(); //properties labelDescription.Location = new Point(x, 130); concentrationsListBox.Location = new Point(x, 300); labelTitle.Location = new Point(x, y); x += 400; // labelTitle location labelTitle.AutoSize = false; labelTitle.Height = 100; labelTitle.Width = 200; labelDescription.AutoSize = false; labelDescription.Height = 100; labelDescription.Width = 250; concentrationsListBox.Height = 100; concentrationsListBox.Width = 250; // lopp to get all concentrations for (int i = 0; i < allDegrees.concentrations.Count(); i++) { concentrationsListBox.Items.Add(allDegrees.concentrations[i]); } this.tabUndergradDegree.Controls.Add(labelTitle); this.tabUndergradDegree.Controls.Add(labelDescription); this.tabUndergradDegree.Controls.Add(concentrationsListBox); labelTitle.Text = allDegrees.title; labelDescription.Text = allDegrees.description; ////////////////////Faculty Listview/////////////////////////// // populates listView foreach (Faculty member in people.faculty) { ListViewItem memberItem = new ListViewItem(new String[] { member.name, member.username, member.tagline, member.title, member.interestArea, member.office, member.website, member.phone, member.email, member.facebook, member.twitter } ); peopleListView.Items.Add(memberItem); } foreach (Staff staff in people.staff) { ListViewItem staffItem = new ListViewItem(new String[] { staff.name, staff.username, staff.tagline, staff.title, staff.interestArea, staff.office, staff.website, staff.phone, staff.email, staff.facebook, staff.twitter } ); staffListView.Items.Add(staffItem); } } }
private void Form1_Load(object sender, EventArgs e) { Populate(); //Get the objects... //get employment string jsonEmp = rj.getJSON("/employment/"); employment = JToken.Parse(jsonEmp).ToObject <Employment>(); lbl_emp_int_title.Text = employment.introduction.title; lbl_emp_cnt_title.Text = employment.introduction.content[0].title; txt_emp_cnt_desc.Text = employment.introduction.content[0].description; lbl_emp_cnt_title2.Text = employment.introduction.content[1].title; txt_emp_cnt2_desc.Text = employment.introduction.content[1].description; foreach (string s in employment.employers.employerNames) { txt_emp_employers.AppendText(s); txt_emp_employers.AppendText("\n"); } foreach (string s in employment.careers.careerNames) { txt_emp_careers.AppendText(s); txt_emp_careers.AppendText("\n"); } //set up the listView... //make columns... //for co-op table listView1.View = View.Details;//text listView1.GridLines = true; listView1.FullRowSelect = true; listView1.Width = 820; listView1.Columns.Add("EMPLOYER", 235); listView1.Columns.Add("DEGREE", 235); listView1.Columns.Add("CITY", 235); listView1.Columns.Add("TERM", 115); ListViewItem item; for (var i = 0; i < employment.coopTable.coopInformation.Count; i++) { item = new ListViewItem( new string[] { employment.coopTable.coopInformation[i].employer, employment.coopTable.coopInformation[i].degree, employment.coopTable.coopInformation[i].city, employment.coopTable.coopInformation[i].term } ); //append the row listView1.Items.Add(item); } //for employment table listView2.View = View.Details;//text listView2.GridLines = true; listView2.FullRowSelect = true; listView2.Width = 820; listView2.Columns.Add("DEGREE", 175); listView2.Columns.Add("EMPLOYER", 175); listView2.Columns.Add("LOCATION", 175); listView2.Columns.Add("TITLE", 175); listView2.Columns.Add("START DATE", 120); ListViewItem empl; for (var i = 0; i < employment.employmentTable.professionalEmploymentInformation.Count; i++) { empl = new ListViewItem( new string[] { employment.employmentTable.professionalEmploymentInformation[i].employer, employment.employmentTable.professionalEmploymentInformation[i].degree, employment.employmentTable.professionalEmploymentInformation[i].city, employment.employmentTable.professionalEmploymentInformation[i].title, employment.employmentTable.professionalEmploymentInformation[i].startDate } ); //append the row listView2.Items.Add(empl); } //get minors string jsonMnr = rj.getJSON("/minors/"); minors = JToken.Parse(jsonMnr).ToObject <Minors>(); //get degrees string jsonDegree = rj.getJSON("/degrees/"); degrees = JToken.Parse(jsonDegree).ToObject <Degrees>(); //get research string jsonResearch = rj.getJSON("/research/"); research = JToken.Parse(jsonResearch).ToObject <Research>(); //get resources string jsonResource = rj.getJSON("/resources/"); resources = JToken.Parse(jsonResource).ToObject <Resources>(); //get news string jsonnew = rj.getJSON("/news/"); News news = JToken.Parse(jsonnew).ToObject <News>(); //appending to the news tab page rtb_news_latest.Text = news.year[0].title + "\n" + news.year[0].date + "\n" + " " + news.year[0].description + "\n" + "\n" + news.year[1].title + "\n" + news.year[1].date + "\n" + " " + news.year[1].description + "\n" + "\n" + news.year[3].title + "\n" + news.year[3].date + "\n" + " " + news.year[3].description + "\n" + "\n" + news.year[4].title + "\n" + news.year[4].date + "\n" + " " + news.year[4].description + "\n" + "\n" + news.year[5].title + "\n" + news.year[5].date + "\n" + " " + news.year[5].description; rtb_news_quarter.Text = news.quarter[0].title + "\n" + news.quarter[0].date + "\n" + " " + news.quarter[0].description + "\n" + "\n" + news.quarter[1].title + "\n" + news.quarter[1].date + "\n" + " " + news.quarter[1].description; rtb_news_older.Text = news.older[0].title + "\n" + news.older[0].date + "\n" + " " + news.older[0].description + "\n" + "\n" + news.older[1].title + "\n" + news.older[1].date + "\n" + " " + news.older[1].description + "\n" + "\n" + news.older[2].title + "\n" + news.older[2].date + "\n" + " " + news.older[2].description + "\n" + "\n" + news.older[3].title + "\n" + news.older[3].date + "\n" + " " + news.older[3].description + "\n" + "\n" + news.older[4].title + "\n" + news.older[4].date + "\n" + " " + news.older[4].description + "\n" + "\n" + news.older[5].title + "\n" + news.older[5].date + "\n" + " " + news.older[5].description; //get people string jsonPeople = rj.getJSON("/people/"); people = JToken.Parse(jsonPeople).ToObject <People>(); //get images of faculties for their research areas pic_rec_fac1.ImageLocation = people.faculty[1].imagePath; pic_rec_fac2.ImageLocation = people.faculty[3].imagePath; pic_rec_fac3.ImageLocation = people.faculty[4].imagePath; pic_rec_fac4.ImageLocation = people.faculty[5].imagePath; pic_rec_fac5.ImageLocation = people.faculty[7].imagePath; pic_rec_fac6.ImageLocation = people.faculty[8].imagePath; pic_rec_fac7.ImageLocation = people.faculty[9].imagePath; pic_rec_fac8.ImageLocation = people.faculty[11].imagePath; pic_rec_fac9.ImageLocation = people.faculty[12].imagePath; pic_rec_fac10.ImageLocation = people.faculty[13].imagePath; pic_rec_fac11.ImageLocation = people.faculty[15].imagePath; pic_rec_fac12.ImageLocation = people.faculty[17].imagePath; pic_rec_fac13.ImageLocation = people.faculty[19].imagePath; pic_rec_fac14.ImageLocation = people.faculty[22].imagePath; pic_rec_fac15.ImageLocation = people.faculty[24].imagePath; pic_rec_fac16.ImageLocation = people.faculty[26].imagePath; pic_rec_fac17.ImageLocation = people.faculty[28].imagePath; pic_rec_fac18.ImageLocation = people.faculty[29].imagePath; pic_rec_fac19.ImageLocation = people.faculty[30].imagePath; pic_rec_fac20.ImageLocation = people.faculty[31].imagePath; pic_rec_fac21.ImageLocation = people.faculty[32].imagePath; }