private void btnAdd_Click(object sender, EventArgs e) { int idModel = Convert.ToInt32(cbModel.SelectedValue); Model model = ModelList.getInstance().getItem(idModel); Grade_AddEdit aeG = new Grade_AddEdit(new Grade(model)); if (aeG.ShowDialog() == System.Windows.Forms.DialogResult.OK) { loadGrade(); } }
private void _dgv_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if ((e.ColumnIndex < 0) || (e.RowIndex < 0)) { return; } int idGrade = Convert.ToInt32(_dgv.Rows[e.RowIndex].Cells[0].Value); GradeList grades = GradeList.getInstance(); Grade grade = grades.getItem(idGrade); Grade_AddEdit aeG = new Grade_AddEdit(grade); if (aeG.ShowDialog() == System.Windows.Forms.DialogResult.OK) { loadGrade(); } }