public JsonResult DeleteBinderAllotment(string ReqisitionId) { string ErrorMessage = ""; try { DataTable dtBinderAllotment = objDbTrx.GetBinderAllotmentQtyByID(Convert.ToInt32(ReqisitionId)); if (dtBinderAllotment.Rows.Count > 0) { ErrorMessage = "The Binder Allotment Code " + dtBinderAllotment.Rows[0]["BINDER_ALLOT_CODE"].ToString() + " and Allotment date " + Convert.ToDateTime(dtBinderAllotment.Rows[0]["ALLOTMENT_DATE"].ToString()).ToString("dd-MMM-yyyy").ToUpper() + " deleted successfully"; } dtBinderAllotment.Dispose(); dtBinderAllotment.Clear(); objDbTrx.DeleteBinderAllotment(ReqisitionId); } catch (Exception ex) { ErrorMessage = "Some error occured while deleting requisition. please contact system administrator for further assitence."; objDbTrx.SaveSystemErrorLog(ex, Request.UserHostAddress); } return(Json(ErrorMessage)); }