예제 #1
0
        public ActionResult RateUpdate(TaxRateModel model, GridCommand command)
        {
            var taxRate = _taxRateService.GetTaxRateById(model.Id);

            taxRate.Zip        = model.Zip == "*" ? null : model.Zip;
            taxRate.Percentage = model.Percentage;
            _taxRateService.UpdateTaxRate(taxRate);

            return(RatesList(command));
        }
        public async Task <IActionResult> RateUpdate(TaxRateModel model)
        {
            var taxRate = await _taxRateService.GetTaxRateById(model.Id);

            taxRate.Zip        = model.Zip == "*" ? null : model.Zip;
            taxRate.Percentage = model.Percentage;
            await _taxRateService.UpdateTaxRate(taxRate);

            return(new NullJsonResult());
        }
예제 #3
0
        public ActionResult RateUpdate(TaxRateModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
            {
                return(Content("Access denied"));
            }

            var taxRate = _taxRateService.GetTaxRateById(model.Id);

            taxRate.Zip        = model.Zip == "*" ? null : model.Zip;
            taxRate.Percentage = model.Percentage;
            _taxRateService.UpdateTaxRate(taxRate);

            return(new NullJsonResult());
        }
        public ActionResult RateUpdate(TaxRateModel model, GridCommand command)
        {
            if (!ModelState.IsValid)
            {
                return(new JsonResult {
                    Data = "error"
                });
            }

            var taxRate = _taxRateService.GetTaxRateById(model.Id);

            taxRate.Zip        = model.Zip;
            taxRate.Percentage = model.Percentage;
            _taxRateService.UpdateTaxRate(taxRate);

            return(RatesList(command));
        }