public JsonResult CancelUnitPriceAmount(FormCollection collection) { SuccessErrorModel aModel = new SuccessErrorModel(); try { int productDetailsId = Convert.ToInt32(collection["ProductDetailsIdToCancel"]); var anUser = (ViewUser)Session["user"]; bool result = _iAccountsManager.CancelUnitPriceAmount(anUser, productDetailsId); aModel.Message = result ? "<p class='text-green'>Cancelled</p>" : "<p class='text-danger'>Failed to Cancel!!</p>"; } catch (Exception e) { if (e.InnerException != null) { aModel.Message = "<p style='color:red'>" + e.InnerException.Message + "</p>"; } Log.WriteErrorLog(e); } return(Json(aModel, JsonRequestBehavior.AllowGet)); }