Example #1
0
        public IActionResult TaxRateEditor(int taxId, int taxRateId)
        {
            if (taxId <= 0 || _taxService.Count(x => x.Id == taxId) == 0)
            {
                return(NotFound());
            }

            var taxRate = taxRateId > 0 ? _taxRateService.Get(taxRateId) : new TaxRate()
            {
                TaxId = taxId
            };

            if (taxRate == null)
            {
                return(NotFound());
            }
            var taxRateModel = _modelMapper.Map <TaxRateModel>(taxRate);

            return(R.Success.With("taxRate", taxRateModel).WithAvailableCountries().Result);
        }