private void buttonUpdateMateriiPofesori_Click(object sender, EventArgs e) { ProfesorBL profBL = new ProfesorBL(); MaterieBL matBL = new MaterieBL(); int materieID = int.Parse(comboBoxMateriiAsocUp.SelectedValue.ToString()); int profesorID = int.Parse(comboBoxProfiAsocUp.SelectedValue.ToString()); int profIDNew = int.Parse(comboBoxUpdateAsocProf.SelectedValue.ToString()); DataTable id = profBL.GetIdForProfMaterie(materieID, profesorID); int prof_materieID = 0; bool ok = false; for (int i = 0; i < id.Rows.Count; i++) { if (id.Rows[i] != null) { prof_materieID = int.Parse(id.Rows[i][id.Columns[0]].ToString()); ok = true; } } if (ok) { profBL.UpdateAsocProfesorMaterie(prof_materieID, profIDNew); labelMasUpdateAscoProfMaterie.Text = "Actualizarea a fost realizata cu succes!"; } else { labelMasUpdateAscoProfMaterie.Text = "Actualizare esuata. Asocierea initiala nu exista!"; } }
private void ListMaterii() { MaterieBL materiiBL = new MaterieBL(); comboBoxMateriiAsocUp.DisplayMember = "nume_materie"; comboBoxMateriiAsocUp.ValueMember = "id_materie"; comboBoxMateriiAsocUp.DataSource = materiiBL.GetMaterii(); }
private void PopulateUpdateControls() { int materieID = int.Parse(comboBoxMaterieUpdate.SelectedValue.ToString()); MaterieBL materieBL = new MaterieBL(); DataTable ds = materieBL.GetMaterieById(materieID); textBoxNumeMaterie.Text = ds.Rows[0]["nume_materie"].ToString(); }
private void buttonDeleteMaterie_Click(object sender, EventArgs e) { int materieID = int.Parse(comboBoxDeleteMaterii.SelectedValue.ToString()); if (MessageBox.Show("Sigur vreti sa stergeti clasa?", "Intrebare", MessageBoxButtons.YesNo) == DialogResult.Yes) { MaterieBL materieBL = new MaterieBL(); materieBL.DeleteMaterie(materieID); labelDeleteMaterii.Text = "Stergerea a fost realizata cu succes! "; } ListMaterii(); }
private void ListMaterii() { MaterieBL materiiBL = new MaterieBL(); try { comboBoxNotaMaterie.DisplayMember = "nume_materie"; comboBoxNotaMaterie.ValueMember = "id_materie"; comboBoxNotaMaterie.DataSource = materiiBL.GetMaterieByProfId(id_prof_logat).Rows; } catch (Exception e) { labelEroareNotaForm.Text = "Profesorul nu are asociate materii!"; } }
private void buttonAddMaterie_Click(object sender, EventArgs e) { string nume = textBoxMaterieNume.Text; MaterieBL materieBL = new MaterieBL(); if (!string.IsNullOrWhiteSpace(nume)) { materieBL.AddMaterie(nume); labelMsgAddMaterie.Text = "Adaugare cu succes! "; textBoxMaterieNume.Text = ""; } else { labelMsgAddMaterie.Text = "Date incomplete ! "; } }
private void ButtonUpdateMaterie_Click(object sender, EventArgs e) { string nume = textBoxNumeMaterie.Text; MaterieBL materieBL = new MaterieBL(); if (!string.IsNullOrWhiteSpace(nume)) { int materieID = int.Parse(comboBoxMaterieUpdate.SelectedValue.ToString()); materieBL.UpdateMaterie(materieID, nume); labelMsgUpdateMaterie.Text = "Actualizarea a fost realizata cu succes! "; } else { labelMsgUpdateMaterie.Text = "Date incomplete ! "; } ListMaterii(); }