public dynamic Confirm(PaymentRequest model) { try { if (!AuthenticationModel.IsAllowed("Confirm", Core.Constants.Constant.MenuName.PaymentRequest, Core.Constants.Constant.MenuGroupName.Master)) { Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "You are Not Allowed to Delete Record"); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } var data = _paymentRequestService.GetObjectById(model.Id); model = _paymentRequestService.ConfirmObject(data, model.ConfirmationDate.Value, _payableService); } catch (Exception ex) { LOG.Error("Confirm Failed", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Errors })); }