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

            if (ModelState.IsValid)
            {
                _budgetPlanService.CreateBudgetPlan(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 Create(int accountId, [FromBody] BudgetPlanDetails budgetPlanDetails)
 {
     _BudgetPlanService.CreateBudgetPlan(budgetPlanDetails, accountId);
 }