private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intAffected = 0; using (clsRecruitmentSource source = new clsRecruitmentSource()) { source.RecruitmentSourceName = txtSource.Text; source.Enabled = (chkEnabled.Checked ? "1" : "0"); intAffected = source.Insert(); } if (intAffected > 0) { switch (_FormCaller) { case FormCallers.RecruitmentSourceList: _frmRecruitmentSourceList.BindRecruitmentSourceList(); break; case FormCallers.EmployeeNew: _frmEmployeeNew.BindRecruitmentSourceList(); break; case FormCallers.EmployeeDetails: _frmEmployeeDetails.BindRecruitmentSource(); break; } if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ClearFields(); } else { this.Close(); } } } }