private void ListElevi() { ElevBL elevBL = new ElevBL(); comboBoxEleviAsoc.DisplayMember = "nume_elev"; comboBoxEleviAsoc.ValueMember = "id_elev"; comboBoxEleviAsoc.DataSource = elevBL.GetEleviFaraClasa(); }
private void ListElevi() { ElevBL elevBL = new ElevBL(); comboBoxDeleteElev.DisplayMember = "nume_elev"; comboBoxDeleteElev.ValueMember = "id_elev"; comboBoxDeleteElev.DataSource = elevBL.GetElevi(); }
private void buttonAsociereClasaElev_Click(object sender, EventArgs e) { int clasaID = int.Parse(comboBoxClaseAsoc.SelectedValue.ToString()); int elevID = int.Parse(comboBoxEleviAsoc.SelectedValue.ToString()); ElevBL elevBl = new ElevBL(); elevBl.AsocElevClasa(elevID, clasaID); ListElevi(); }
private void PopulateUpdateControls() { int elevID = int.Parse(comboBoxElevUpdate.SelectedValue.ToString()); ElevBL elevBL = new ElevBL(); DataTable ds = elevBL.GetEleviById(elevID); textBoxNumeElev.Text = ds.Rows[0]["nume_elev"].ToString(); textBoxPrenumeElev.Text = ds.Rows[0]["prenume_elev"].ToString(); textBoxUserElev.Text = ds.Rows[0]["user_elev"].ToString(); textBoxParolaElev.Text = ds.Rows[0]["parola_elev"].ToString(); }
private void buttonDeleteProf_Click(object sender, EventArgs e) { int elevID = int.Parse(comboBoxDeleteElev.SelectedValue.ToString()); if (MessageBox.Show("Sigur vreti sa stergeti elevul?", "Intrebare", MessageBoxButtons.YesNo) == DialogResult.Yes) { ElevBL elevBL = new ElevBL(); elevBL.DeleteElev(elevID); labelDeleteElev.Text = "Stergerea a fost realizata cu succes! "; } ListElevi(); }
private void ListElevi() { try { int clasaID = int.Parse(comboBoxNotaClasa.SelectedValue.ToString()); ElevBL elevBL = new ElevBL(); comboBoxNotaElev.DisplayMember = "nume_elev"; comboBoxNotaElev.ValueMember = "id_elev"; comboBoxNotaElev.DataSource = elevBL.GetEleviByClasaId(clasaID).Rows; } catch (Exception e) { labelEroareNotaForm.Text = "Profesorul nu are elevi asociati clasei la care preda!"; } }
private void ButtonUpdateProf_Click(object sender, EventArgs e) { string nume = textBoxNumeElev.Text; string prenume = textBoxPrenumeElev.Text; string user = textBoxUserElev.Text; string parola = textBoxParolaElev.Text; ElevBL elevBL = new ElevBL(); if (!string.IsNullOrWhiteSpace(nume) && !string.IsNullOrWhiteSpace(prenume) && !string.IsNullOrWhiteSpace(user) && !string.IsNullOrWhiteSpace(parola)) { int elevID = int.Parse(comboBoxElevUpdate.SelectedValue.ToString()); elevBL.UpdateElev(elevID, nume, prenume, user, parola); labelMsgUpdateElev.Text = "Actualizarea a fost realizata cu succes! "; } else { labelMsgUpdateElev.Text = "Date incomplete ! "; } ListElevi(); }
private void buttonAddElev_Click(object sender, EventArgs e) { string nume = textBoxNumeElev.Text; string prenume = textBoxPrenumeElev.Text; string user = textBoxUserElev.Text; string parola = textBoxParolaElev.Text; ElevBL elevBL = new ElevBL(); if (!string.IsNullOrWhiteSpace(nume) && !string.IsNullOrWhiteSpace(prenume) && !string.IsNullOrWhiteSpace(user) && !string.IsNullOrWhiteSpace(parola)) { elevBL.AddElev(nume, prenume, user, parola); labelMsgElev.Text = "Adaugare cu succes! "; textBoxNumeElev.Text = ""; textBoxPrenumeElev.Text = ""; textBoxUserElev.Text = ""; textBoxParolaElev.Text = ""; } else { labelMsgElev.Text = "Date incomplete ! "; } }