Ejemplo n.º 1
0
        public JsonResult Create(ConsumptionModel model)
        {
            if (!this.permissionService.Authorize(StandardPermissionProvider.CreateConsumptionRecord))
            {
                return(AccessDeniedJson());
            }

            var consumption = Mapper.Map <ConsumptionModel, Consumption>(model);

            if (consumption != null)
            {
                consumption.StoreId = workContext.CurrentUser.StoreId;
                consumptionService.AddConsumptionCategory(consumption);
            }

            return(Json(model));
        }