Beispiel #1
0
        public async Task <ActionResult <TaxesItem> > GetTaxesItem(int id)
        {
            var taxesItem = await _businessService.ReadAsync(id);;

            if (taxesItem == null)
            {
                return(NotFound());
            }

            return(taxesItem);
        }
        public async Task <double> GetRatio(DateTime dt, string municipality)
        {
            //control on 4 schedule, smaller to larger control happening since if smaller one in range we don't need to find the ratio of larger one.
            var taxesMunicipality = await _taxesService.ReadAsync(municipality);

            var list = taxesMunicipality.ToList();

            var dailyControl = DailyControl(list, dt);

            if (dailyControl != 0)
            {
                return(dailyControl);
            }

            var weeklyControl = WeeklyControl(list, dt);

            if (weeklyControl != 0)
            {
                return(weeklyControl);
            }

            var monthlyControl = MonthlyControl(list, dt);

            if (monthlyControl != 0)
            {
                return(monthlyControl);
            }

            var yearlyControl = YearlyControl(list, dt);

            if (yearlyControl != 0)
            {
                return(yearlyControl);
            }

            return(0);
        }