private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dgData.SelectedRows.Count == 1)
     {
         UDTCourseTimetableDef data = dgData.SelectedCells[0].OwningRow.Tag as UDTCourseTimetableDef;
         Form.SubAddEditCourseTimetableForm saect = new SubAddEditCourseTimetableForm(SubAddEditCourseTimetableForm.EditMode.Edit, data);
         if (saect.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
             LoadData();
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     Form.SubAddEditCourseTimetableForm saect = new SubAddEditCourseTimetableForm(SubAddEditCourseTimetableForm.EditMode.Add, null);
     if (saect.ShowDialog() == System.Windows.Forms.DialogResult.Yes)
         LoadData();
 }