private void BtnSubjectAdd_Click(object sender, EventArgs e) { if (Program.CurrentUser.IsStudent || Program.CurrentUser.IsLecture) { MessageBox.Show("Нямате права за добавяне на дисциплини!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } FormAddSubjects sub = new FormAddSubjects(); sub.ShowDialog(); }
private void DgSubjects_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (Program.CurrentUser.IsStudent || Program.CurrentUser.IsLecture) { MessageBox.Show("Нямате права за добавяне на дисциплини!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (e.RowIndex < 0) { return; } var sub = (dgSubjects.Rows[e.RowIndex].DataBoundItem as TSubject); FormAddSubjects fr = new FormAddSubjects(); fr.subjects = sub; fr.ShowDialog(); }