public FacStaff(Faculty me) { facName = me.username; string jsonResearch = rj.getRESTDataJSON("/research/"); research = JToken.Parse(jsonResearch).ToObject <Research>(); InitializeComponent(); pictureBox1.Load(me.imagePath); name.Text += me.name; name.Text += (" -- " + me.tagline); title.Text += me.title; interestArea.Text += me.interestArea; office.Text += me.office; phone.Text += me.phone; email.Text += me.email; website.Text += me.website; this.Text = me.name; }
private void Form1_Load(object sender, EventArgs e) { Console.WriteLine("From Load"); //go get /about/ string jsonAbout = rj.getRESTDataJSON("/about/"); //Console.WriteLine(jsonAbout); //cast it to the About object! about = JToken.Parse(jsonAbout).ToObject <About>(); //access //Console.WriteLine(about.title); label4.Text = about.description; label1.Text = about.quote; label2.Text = (" -- -- " + about.quoteAuthor); label3.Text = about.title; Console.WriteLine(about.quoteAuthor); string jsonResources = rj.getRESTDataJSON("/resources/"); resources = JToken.Parse(jsonResources).ToObject <Resources>(); //populate the linkLabel with the RITJobZoneLink! string jsonEmp = rj.getRESTDataJSON("/employment/"); employment = JToken.Parse(jsonEmp).ToObject <Employment>(); string jsonMinors = rj.getRESTDataJSON("/minors/"); minors = JToken.Parse(jsonMinors).ToObject <Minors>(); string jsonFooter = rj.getRESTDataJSON("/footer/"); footer = JToken.Parse(jsonFooter).ToObject <Footer>(); string jsonPeople = rj.getRESTDataJSON("/people/"); people = JToken.Parse(jsonPeople).ToObject <People>(); string jsonDegrees = rj.getRESTDataJSON("/degrees/"); degrees = JToken.Parse(jsonDegrees).ToObject <Degrees>(); string jsonResearch = rj.getRESTDataJSON("/research/"); research = JToken.Parse(jsonResearch).ToObject <Research>(); string jsonNews = rj.getRESTDataJSON("/news/"); news = JToken.Parse(jsonNews).ToObject <News>(); linkLabel1.Text = footer.quickLinks[0].href; linkLabel2.Text = "http://ist.rit.edu/api/contactForm.php"; linkLabel3.Text = footer.quickLinks[1].href; /*imageine that I have a bunch of tabs(like an admin) that the entire * application needs, but specific users don't - how do we handle that? * */ //names of the tabs that I have access to //string[] names = { "People", "ListView", "DataGrid", "tabPage4" }; //kill all athat I shouldn't have access to /*foreach (TabPage tab in tabControl1.TabPages) { * if (names.Contains(tab.Text)) * { * //kill it * int t = tabControl1.TabPages.IndexOf(tab); * tabControl1.TabPages.RemoveAt(t); * } * }*/ //how do I dynamically create one a new tab? //TabPage myNewTab = new TabPage("News"); //tabControl1.TabPages.Add(myNewTab); //TextBox tb = new TextBox(); //tb.BackColor = SystemColors.HotTrack; //tb.Location = new Point(10, 10); //tb.Size = new Size(180, 30); //tb.TabIndex = 1; //myNewTab.Controls.Add(tb); }