private async void bt_coop_Click(object sender, EventArgs e) { spinner.Visible = true; dataGridView1.Visible = true; bt_coop.Enabled = false; if (listView1.Visible) { listView1.Visible = false; } // MessageBox.Show("test"); if (employment == null) { await Task.Run(() => { MessageBox.Show("employment"); //go get the /employment/info.. string jsonEmp = rj.getRestJSON("/employment/"); employment = JToken.Parse(jsonEmp).ToObject <Employment>(); }); } //have I build? if (dataGridView1.Rows.Count < 2) { sw.Reset(); sw.Start(); //populate the dataFridView 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; } } spinner.Visible = false; }
private void Form1_Load(object sender, EventArgs e) { //go get the /about/info.. string jsonAbout = rj.getRestJSON("/about/"); about = JToken.Parse(jsonAbout).ToObject <About>(); rtb_about_desc.Text += about.title; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += about.description; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += about.quote; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += "\n"; rtb_about_desc.Text += about.quoteAuthor; //go get the resources string jsonResources = rj.getRestJSON("/resources/"); resources = JToken.Parse(jsonResources).ToObject <Resources>(); linkLabel1.Text = "Click me for the pdf"; linkLabel1.Tag = resources.coopEnrollment.RITJobZoneGuidelink; linkLabel2.Text = "Click me for the application"; linkLabel2.Tag = resources.studentAmbassadors.applicationFormLink; string jsonDegree = getRestData("/degrees/graduate/"); //have to return a string jsonAbout into an object //ABout Object.... graduat = JToken.Parse(jsonDegree).ToObject <GraduateDegree>(); string jsonUDegree = getRestData("/degrees/undergraduate/"); //have to return a string jsonAbout into an object //Undergrad.... undgraduat = JToken.Parse(jsonUDegree).ToObject <Undergrad>(); string jsonUmin = getRestData("/minors/UgMinors"); //have to return a string jsonAbout into an object //Undergrad.... ugmin = JToken.Parse(jsonUmin).ToObject <ugminors>(); string jsonCourse = getRestData("/course/"); //have to return a string jsonAbout into an object //Undergrad.... // courses = JToken.Parse(jsonCourse).ToObject<cours>(); string jsonEmp = getRestData("/employment/"); //have to return a string jsonAbout into an object //Employee.... employment = JToken.Parse(jsonEmp).ToObject <Employment>(); string jsonPeople = rj.getRestJSON("/people/"); people = JToken.Parse(jsonPeople).ToObject <People>(); // Let's assume that we are going to get a list of acceptable tabs to show the user from a call. //retrived from the server string jsonfooter = rj.getRestJSON("/footer/"); fsoc = JToken.Parse(jsonfooter).ToObject <fsocial>(); }