/// <summary> /// Deletes a tax rate /// </summary> /// <param name="taxRate">Tax rate</param> public virtual void DeleteTaxRate(TaxRate taxRate) { if (taxRate == null) throw new ArgumentNullException("taxRate"); _taxRateRepository.Delete(taxRate); _cacheManager.RemoveByPattern(TAXRATE_PATTERN_KEY); }
public ActionResult AddTaxRate(TaxRateListModel model) { var taxRate = new TaxRate() { TaxCategoryId = model.AddTaxCategoryId, CountryId = model.AddCountryId, StateProvinceId = model.AddStateProvinceId, Zip = model.AddZip, Percentage = model.AddPercentage }; _taxRateService.InsertTaxRate(taxRate); return Json(new { Result = true }); }
public ActionResult AddTaxRate(TaxRateListModel model) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings)) return Content("Access denied"); var taxRate = new TaxRate() { TaxCategoryId = model.AddTaxCategoryId, CountryId = model.AddCountryId, StateProvinceId = model.AddStateProvinceId, Zip = model.AddZip, Percentage = model.AddPercentage }; _taxRateService.InsertTaxRate(taxRate); return Json(new { Result = true }); }
public ActionResult AddTaxRate(TaxRateListModel model) { if (!ModelState.IsValid) { return Configure(); } var taxRate = new TaxRate() { TaxCategoryId = model.AddTaxCategoryId, CountryId = model.AddCountryId, StateProvinceId = model.AddStateProvinceId, Zip = model.AddZip, Percentage = model.AddPercentage }; _taxRateService.InsertTaxRate(taxRate); return Configure(); }
/// <summary> /// Inserts a tax rate /// </summary> /// <param name="taxRate">Tax rate</param> public virtual void InsertTaxRate(TaxRate taxRate) { if (taxRate == null) throw new ArgumentNullException("taxRate"); _taxRateRepository.Insert(taxRate); _cacheManager.RemoveByPattern(TAXRATE_PATTERN_KEY); //event notification _eventPublisher.EntityInserted(taxRate); }