Esempio n. 1
0
        public ActionResult TaxRateUpdate(FixedTaxRateModel model, GridCommand command)
        {
            int     taxCategoryId = model.TaxCategoryId;
            decimal rate          = model.Rate;

            _settingService.SetSetting(string.Format("Tax.TaxProvider.FixedRate.TaxCategoryId{0}", taxCategoryId), rate);

            var tmp = new List <FixedTaxRateModel>();

            foreach (var taxCategory in _taxCategoryService.GetAllTaxCategories())
            {
                tmp.Add(new FixedTaxRateModel()
                {
                    TaxCategoryId   = taxCategory.Id,
                    TaxCategoryName = taxCategory.Name,
                    Rate            = GetTaxRate(taxCategory.Id)
                });
            }

            var tmp2      = tmp.ForCommand(command);
            var gridModel = new GridModel <FixedTaxRateModel>
            {
                Data  = tmp2,
                Total = tmp2.Count()
            };

            return(new JsonResult
            {
                Data = gridModel
            });
        }
        public async Task <IActionResult> TaxRateUpdate(FixedTaxRateModel model)
        {
            string  taxCategoryId = model.TaxCategoryId;
            decimal rate          = model.Rate;

            await _settingService.SetSetting(string.Format("Tax.TaxProvider.FixedRate.TaxCategoryId{0}", taxCategoryId), rate);

            return(new NullJsonResult());
        }
        public IActionResult FixedRateUpdate(FixedTaxRateModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
            {
                return(Content("Access denied"));
            }

            _settingService.SetSetting(string.Format(FixedOrByCountryStateZipDefaults.FixedRateSettingsKey, model.TaxCategoryId), model.Rate);

            return(new NullJsonResult());
        }
Esempio n. 4
0
        public async Task <IActionResult> TaxRateUpdate(FixedTaxRateModel model)
        {
            string taxCategoryId = model.TaxCategoryId;
            double rate          = model.Rate;

            await _settingService.SetSetting(string.Format("Tax.TaxProvider.FixedRate.TaxCategoryId{0}", taxCategoryId), new FixedTaxRate()
            {
                Rate = rate
            });

            return(new JsonResult(""));
        }
Esempio n. 5
0
        public ActionResult TaxRateUpdate(FixedTaxRateModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
            {
                return(Content("Access denied"));
            }

            int     taxCategoryId = model.TaxCategoryId;
            decimal rate          = model.Rate;

            _settingService.SetSetting(string.Format("Tax.TaxProvider.FixedRate.TaxCategoryId{0}", taxCategoryId), rate);

            return(new NullJsonResult());
        }