private void btnApprove_Click(object sender, EventArgs e) { try { DialogResult theResult = new System.Windows.Forms.DialogResult(); theResult = MessageBox.Show(this, "Do you want to Approve this Costing File?", "Confirmation", MessageBoxButtons.YesNo); if (theResult == System.Windows.Forms.DialogResult.Yes) { PRPDBatch objPRPDBatch = new PRPDBatch(); if (dgvPRPDbatchByState.CurrentRow.Cells["PRPDBatchID"].Value != null) { objPRPDBatch = objPRPDBatch_DL.Get(dgvPRPDbatchByState.CurrentRow.Cells["PRPDBatchID"].Value.ToString()); objPRPDBatch_DL.Update_BatchCost(objPRPDBatch.PRPDBatchID, CurrentUser.EmployeeID, (int)objPRPDBatch.Type); objPRPDBatch.Status = PRPDBatch.PRPDBatchStatus.Cost; objPRPDBatch_DL.UpdateStatus(objPRPDBatch); Load_Batch_List(); } } } catch (Exception) { MessageBox.Show(this, "Error occurred while loading PRPD Batch details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }