public JsonResult ApproveProductPrice(FormCollection collection) { SuccessErrorModel aModel = new SuccessErrorModel(); try { int productDetailsId = Convert.ToInt32(collection["ProductDetailsIdToApprove"]); int productId = Convert.ToInt32(collection["ProductId"]); var anUser = (ViewUser)Session["user"]; bool result = _iAccountsManager.ApproveProductPrice(anUser, productDetailsId, productId); aModel.Message = result ? "<p class='text-green'>Unit price approved Successfully!!</p>" : "<p class='text-danger'>Failed to Approve!!</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)); }