Ejemplo n.º 1
0
        public ActionResult Edit(BudgetPlanEditModel budgetPlanEditModel)
        {
            var result = false;
            IList <JsonError> errorMessages = null;

            if (ModelState.IsValid)
            {
                _budgetPlanService.EditBudgetPlan(budgetPlanEditModel, GetCurrentAccount());
                result = true;
            }
            else
            {
                errorMessages = ModelStateJsonConvertor.Convert(ModelState);
            }

            var model = new
            {
                Result           = result,
                RedirectLocation = "/BudgetPlan/Index",
                ErrorMessages    = errorMessages
            };

            return(Json(model, JsonRequestBehavior.AllowGet));
        }
 public void Edit(int accountId, [FromBody] BudgetPlanDetails budgetPlanDetails)
 {
     _BudgetPlanService.EditBudgetPlan(budgetPlanDetails, accountId);
 }