private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intAffected = 0; using (clsResignationReason reason = new clsResignationReason()) { reason.ResignationReasonName = txtReason.Text; reason.Enabled = (chkEnabled.Checked ? "1" : "0"); intAffected = reason.Insert(); } if (intAffected > 0) { switch (_FormCaller) { case FormCallers.ResignationReasonList: _frmResignationReasonList.BindResignationReasonList(); break; case FormCallers.EmployeeDetails: _frmEmployeeDetails.BindResignationReason(); break; } if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ClearFields(); } else { this.Close(); } } } }