public void LoadData() { coursesTable.DataSource = CoacherController.GetCourses(member.AthleticId, CoacherCourseType.All); workedPlacesGridView.DataSource = CoacherController.GetWorkedPlaces(member.AthleticId); internationalStudentDataGridView.DataSource = CoacherController.GetForignStudents(member.AthleticId, StudentSelectType.Under_Coacher); nationalStudentGridView.DataSource = CoacherController.GetLocalStudents(member.AthleticId, StudentSelectType.Under_Coacher); }
private void deleteNationalStudentBtn_Click(object sender, EventArgs e) { int selectedrowindex = nationalStudentGridView.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = nationalStudentGridView.Rows[selectedrowindex]; try { CoacherController.DeleteLocalStudent(Convert.ToString(selectedRow.Cells[0].Value), member.AthleticId); nationalStudentGridView.DataSource = CoacherController.GetLocalStudents(member.AthleticId, StudentSelectType.Under_Coacher); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void addNationalStudentBtn_Click(object sender, EventArgs e) { if (student != null) { try { CoacherController.AddLocalStudent(student.AthleticId, member.AthleticId); MessageBox.Show("Student added success!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } try { nationalStudentGridView.DataSource = CoacherController.GetLocalStudents(member.AthleticId, StudentSelectType.Under_Coacher); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }