private void ViewPrepod_Load(object sender, EventArgs e) { Prepods p = new Prepods(); p.OpenConnection(connectionString); comboBox1.Items.AddRange(p.GetAllPrepods()); p.CloseConnection(); }
private void AddPredmet_Load(object sender, EventArgs e) { Prepods p = new Prepods(); p.OpenConnection(connectionString); this.comboBox_Prepods.Items.AddRange(p.GetAllPrepods()); p.CloseConnection(); }
public DeletePeople(string mode) { InitializeComponent(); this.mode = mode; connectionString = ConfigurationManager.AppSettings["connectionString"]; if (mode == "prepod") { Prepods p = new Prepods(); p.OpenConnection(connectionString); comboBox1.Items.AddRange(p.GetAllPrepods()); p.CloseConnection(); } else if (mode == "student") { Students s = new Students(); s.OpenConnection(connectionString); comboBox1.Items.AddRange(s.GetAllStudents().Split('\n')); s.CloseConnection(); } }