private void btnApprove_Click(object sender, EventArgs e) { try { DialogResult dr = MessageBox.Show(this, "Are you sure you want Approve the selected Cost File?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { int res1 = objPRPDBatch_DL.Finish(PRPDBatchID, PRPDBatch.PRPDBatchStatus.Finished); if (res1 > 0) { this.Close(); } } } catch (Exception ex) { MessageBox.Show(this, "Error Occured while approving the Cost File", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }