public List <Tax> ListStates() { List <Tax> allStates = new List <Tax>(); allStates = _taxRepository.GetList(); return(allStates); }
public IList <CountryList> GetCountries() { var countries = _countryRepository.GetList().ToList(); var mappedCountries = countries.Select(Mapper.Map <CountryList>).ToList(); mappedCountries.ForEach(country => { var hasBank = _bankRepository.GetList().Any(x => x.CountryId == country.Id); var hasSalary = _salaryRepository.GetList().Any(x => x.CountryId == country.Id); var hasPension = _pensionRepository.GetList().Any(x => x.CountryId == country.Id); var hasTax = _taxRepository.GetList().Any(x => x.CountryId == country.Id); country.CanBeDeleted = !hasBank && !hasSalary && !hasPension && !hasTax; }); return(mappedCountries); }
public IList <CurrencyList> GetCurrencies() { var currencies = _currencyRepository.GetList().ToList(); var mappedCurrencies = currencies.Select(Mapper.Map <CurrencyList>).ToList(); mappedCurrencies.ForEach(currency => { var hasAccount = _bankAccountRepository.GetList().Any(x => x.CurrencyId == currency.Id); var hasSalary = _salaryRepository.GetList().Any(x => x.CurrencyId == currency.Id); var hasPension = _pensionRepository.GetList().Any(x => x.CurrencyId == currency.Id); var hasTax = _taxRepository.GetList().Any(x => x.CurrencyId == currency.Id); currency.CanBeDeleted = !hasAccount && !hasSalary && !hasPension && !hasTax; }); return(mappedCurrencies); }
public IList <TaxList> GetTaxesByType(string currentUser, int taxTypeId) { var taxes = _taxRepository.GetList().Where(x => x.TaxTypeId == taxTypeId).ToList(); return(taxes.Select(Mapper.Map <TaxList>).ToList()); }