예제 #1
0
        public List <Tax> ListStates()
        {
            List <Tax> allStates = new List <Tax>();

            allStates = _taxRepository.GetList();

            return(allStates);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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());
        }