private void BtnStudentsAdd_Click(object sender, EventArgs e) { if (Program.CurrentUser.IsStudent || Program.CurrentUser.IsLecture) { MessageBox.Show("Нямате права за добавяне на студенти!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } FormAddRegistrationStudent st = new FormAddRegistrationStudent(); st.ShowDialog(); }
private void DataGridViewLectures_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } var x = (dataGridViewLectures.Rows[e.RowIndex].DataBoundItem as TStudentSpeciality); if (Program.CurrentUser.IsStudent || Program.CurrentUser.IsLecture == true) { MessageBox.Show("Нямате права за редактиране на студенти!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } else if ((Program.CurrentUser.IsStudent && Program.CurrentUser.FirstName.ToLower() == x.Student.FirstName.ToLower() && Program.CurrentUser.LastName.ToLower() == x.Student.LastName.ToLower()) || Program.CurrentUser.IsAdmin) { FormAddRegistrationStudent st = new FormAddRegistrationStudent(); st.student = x; st.ShowDialog(); } }