private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { Prepods p = new Prepods(); p.OpenConnection(connectionString); People pe = p.GetPrepodByFIO(comboBox1.SelectedItem.ToString()); int idprep = p.GetIdByFIO(pe.name, pe.surname, pe.patronumic); p.CloseConnection(); this.label_Fio.Text = pe.surname + " " + pe.name[0] + '.' + pe.patronumic[0]; this.label_birthday.Text = pe.ConvertDate(); this.richTextBox_Info.Text = pe.information; Predmets pr = new Predmets(); pr.OpenConnection(connectionString); this.richTextBox1.Text = ""; this.richTextBox1.Text = String.Join("\n", pr.GetPredmetsByPrepodId(idprep)); pr.CloseConnection(); this.Text = comboBox1.Text; pictureBox1.Visible = true; label_Fio.Visible = true; label_birthday.Visible = true; label1.Visible = true; richTextBox_Info.Visible = true; richTextBox1.Visible = true; }
public EnterMarks(int id) { InitializeComponent(); this.id = id; connectionString = ConfigurationManager.AppSettings["connectionString"]; Predmets pr = new Predmets(); pr.OpenConnection(connectionString); comboBox_Predmet.Items.AddRange(pr.GetPredmetsByPrepodId(id)); pr.CloseConnection(); Grups g = new Grups(); g.OpenConnection(connectionString); comboBox_Group.Items.AddRange(g.GetAllGrups()); g.CloseConnection(); }