private void DataGridViewLectures_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } var xt = (dgvLectures.Rows[e.RowIndex].DataBoundItem as TLecture); if (xt == null) { return; } if (Program.CurrentUser.IsStudent) { MessageBox.Show("Нямате права за редактиране на преподаватели!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else if ((Program.CurrentUser.IsLecture && xt.FirstName.ToLower() == Program.CurrentUser.FirstName.ToLower() && xt.LastName.ToLower() == Program.CurrentUser.LastName.ToLower()) || Program.CurrentUser.IsAdmin) { FormAddRegistrationLecture lc = new FormAddRegistrationLecture(); lc.lecture = xt; lc.ShowDialog(); } }
private void BtnLecturesAdd_Click(object sender, EventArgs e) { if (Program.CurrentUser.IsStudent) { MessageBox.Show("Нямате права за добавяне на преподаватели!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } FormAddRegistrationLecture lc = new FormAddRegistrationLecture(); lc.ShowDialog(); }