private void manager_record() { // Retrieve scientist's ID config.GetSingleResult("select ID from Scientist s, LoginInfo where s.ID = LoginInfo.ScientistID and LoginInfo.Username = '******' "); id = config.dt.Rows[0].Field <string>("ID"); // Get profile picture config.GetImage("select ProfilePic from Scientist where ID = '" + id + "' ", id, profilepicBox, "ProfilePic"); // Scientist information config.GetSingleResult("exec sp_ShowScientificInfo '" + id + "' "); sctidLabel.Text = config.dt.Rows[0].Field <string>("ID"); fnameLabel.Text = config.dt.Rows[0].Field <string>("Name"); fnameLabel2.Text = config.dt.Rows[0].Field <string>("Name"); sctposLabel.Text = config.dt.Rows[0].Field <string>("Position"); sctdepLabel.Text = config.dt.Rows[0].Field <string>("Department"); dobLabel.Text = config.dt.Rows[0].Field <DateTime>("DoB").ToString("dd/MM/yyyy"); genderLabel.Text = config.dt.Rows[0].Field <string>("Gender"); nationalityLabel.Text = config.dt.Rows[0].Field <string>("Nationality"); cardLabel.Text = config.dt.Rows[0].Field <long>("CreditCard").ToString(); addressLabel.Text = config.dt.Rows[0].Field <string>("Address"); phoneLabel.Text = config.dt.Rows[0].Field <string>("Phone"); emailLabel.Text = config.dt.Rows[0].Field <string>("Email"); // Login information config.GetSingleResult("exec sp_ShowLoginInfo '" + id + "' "); usnLabel.Text = config.dt.Rows[0].Field <string>("Username"); passLabel.Text = config.dt.Rows[0].Field <string>("Password"); roleLabel.Text = config.dt.Rows[0].Field <string>("Role"); }
private void apparatusGridview_Click(object sender, EventArgs e) { selected_id = apparatusGridview.CurrentRow.Cells["ID"].Value.ToString(); config.GetSingleResult("select * from Equipment where ID = '" + selected_id + "' "); if (config.dt.Rows.Count > 0) { config.GetImage("select Image from Equipment where ID = '" + selected_id + "' ", selected_id, apparatuspicBox, "Image"); apparatusidLabel.Text = config.dt.Rows[0].Field <int>("ID").ToString(); apparatusnameLabel.Text = config.dt.Rows[0].Field <string>("Name"); apparatusdescriptTextbox.Text = config.dt.Rows[0].Field <string>("Description"); apparatusQuantity.Text = config.dt.Rows[0].Field <int>("Quantity").ToString(); } }
private void load_current_selected_participant() { config.GetSingleResult("exec sp_ShowScientificInfo '" + cur + "'"); if (config.dt.Rows.Count > 0) { config.GetImage("select ProfilePic from Scientist where ID = '" + cur + "' ", cur, profilepicBox, "ProfilePic"); sctidLabel.Text = config.dt.Rows[0].Field <string>("ID"); fnameLabel.Text = config.dt.Rows[0].Field <string>("Name"); sctposLabel.Text = config.dt.Rows[0].Field <string>("Position"); sctdepLabel.Text = config.dt.Rows[0].Field <string>("Department"); genderLabel.Text = config.dt.Rows[0].Field <string>("Gender"); nationalityLabel.Text = config.dt.Rows[0].Field <string>("Nationality"); phoneLabel.Text = config.dt.Rows[0].Field <string>("Phone"); emailLabel.Text = config.dt.Rows[0].Field <string>("Email"); } }
private void scientistGridview_Click(object sender, EventArgs e) { selected_id = scientistGridview.CurrentRow.Cells["ID"].Value.ToString(); query = "select a.* from openquery([" + config.SERVERNAME + "], 'exec Laboratory.dbo.sp_ListOfScientist') as a where a.ID = '" + selected_id + "' "; config.GetSingleResult(query); if (config.dt.Rows.Count > 0) { config.GetImage("select ProfilePic from Scientist where ID = '" + selected_id + "' ", selected_id, profilepicBox, "ProfilePic"); sctidLabel.Text = config.dt.Rows[0].Field <string>("ID"); fnameLabel.Text = config.dt.Rows[0].Field <string>("Name"); sctposLabel.Text = config.dt.Rows[0].Field <string>("Position"); sctdepLabel.Text = config.dt.Rows[0].Field <string>("Department"); genderLabel.Text = config.dt.Rows[0].Field <string>("Gender"); nationalityLabel.Text = config.dt.Rows[0].Field <string>("Nationality"); phoneLabel.Text = config.dt.Rows[0].Field <string>("Phone"); emailLabel.Text = config.dt.Rows[0].Field <string>("Email"); } }