private void btnModify_Click(object sender, EventArgs e) { int rowNum = examineeDataGridView.CurrentCell.RowIndex; string examinID = examineeDataGridView[0, rowNum].Value.ToString(); Examinee currentExaminee; using (ExamineeDataContext dbContext = new ExamineeDataContext()) { currentExaminee = (from exe in dbContext.Examinees where Convert.ToString(exe.ExamineeID) == examinID select exe).SingleOrDefault(); } frmAddModifyexaminee secondForm = new frmAddModifyexaminee(); secondForm.isAdd = false; secondForm.currentExaminee = currentExaminee; DialogResult result = secondForm.ShowDialog(); if (result == DialogResult.OK || result == DialogResult.Retry) { RefreshGridView(); } }
//Button Clicks private void btnAdd_Click(object sender, EventArgs e) { frmAddModifyexaminee secondForm = new frmAddModifyexaminee(); secondForm.isAdd = true; secondForm.currentExaminee = null; DialogResult result = secondForm.ShowDialog(); if (result == DialogResult.OK) { RefreshGridView(); } }