private void BtnFacultyAdd_Click(object sender, EventArgs e) { if (Program.CurrentUser.IsStudent || Program.CurrentUser.IsLecture) { MessageBox.Show("Нямате права за добавяне на факултети!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } FormAddFaculty fac = new FormAddFaculty(); fac.ShowDialog(); }
private void DgFaculties_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } var xt = (dgFaculties.Rows[e.RowIndex].DataBoundItem as TFaculty); FormAddFaculty fc = new FormAddFaculty(); fc.faculty = xt; fc.ShowDialog(); }