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 deleteCourseBtn_Click(object sender, EventArgs e) { int selectedrowindex = coursesTable.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = coursesTable.Rows[selectedrowindex]; try { CoacherController.DeleteCourses(Convert.ToString(selectedRow.Cells[0].Value), Convert.ToString(selectedRow.Cells[1].Value), Convert.ToString(selectedRow.Cells[3].Value), member.AthleticId); coursesTable.DataSource = CoacherController.GetCourses(member.AthleticId, CoacherCourseType.All); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }