private async Task LoadPredefinedDataCounts()
 {
     _apiService = new APIService(Routes.DrzaveRoute);
     DrzavaCount = (await _apiService.Count())?.Data.First() ?? 0;
     _apiService.ChangeRoute(Routes.GradoviRoute);
     GradoviCount = (await _apiService.Count())?.Data.First() ?? 0;
     _apiService.ChangeRoute(Routes.ZdravstvenaStanjaRoute);
     ZdravstvenaStanjaCount = (await _apiService.Count())?.Data.First() ?? 0;
     _apiService.ChangeRoute(Routes.NaucneOblastiRoute);
     NaucneOblastiCount = (await _apiService.Count())?.Data.First() ?? 0;
     _apiService.ChangeRoute(Routes.RolesRoute);
     RolesCount = (await _apiService.Count())?.Data.First() ?? 0;
 }
        private async Task LoadCounts()
        {
            _apiService.ChangeRoute(Routes.PreglediRoute);
            var result = await _apiService.Count();

            if (!result.Succeeded && result.StatusCode == HttpStatusCode.Forbidden)
            {
                Close();
                Dispose();
                return;
            }
            PreglediCounter = result.Data.First();
            _apiService.ChangeRoute(Routes.ZahteviZaPregledRoute);
            ZakazivanjaPregledaCounter = (await _apiService.Count())?.Data.First() ?? 0;
            _apiService.ChangeRoute(Routes.ZahtevZaPosetuRoute);
            PoseteCounter = (await _apiService.Count())?.Data.First() ?? 0;
        }
        protected async Task ChangeChartType()
        {
            if (ChartType == ChartType.Pie)
            {
                ChartType = ChartType.Line;
                btnChartTypeChange.IconChar = IconChar.ChartPie;
                btnChartTypeChange.Text     = Resources.PieChart;
            }
            else
            {
                ChartType = ChartType.Pie;
                btnChartTypeChange.IconChar = IconChar.ChartLine;
                btnChartTypeChange.Text     = Resources.LineChart;
            }

            UpdateChart((await _apiService.Count(MonthsCount))?.Data ?? new List <int> {
                0, 0, 0
            });
        }
        public async Task LoadPredefinedDataCount(string route)
        {
            switch (route)
            {
            case Routes.DrzaveRoute:
                _apiService           = new APIService(Routes.DrzaveRoute);
                DrzavaCount           = (await _apiService.Count())?.Data.First() ?? 0;
                lblDrzaveCounter.Text = DrzavaCount.ToString();
                break;

            case Routes.GradoviRoute:
                _apiService.ChangeRoute(Routes.GradoviRoute);
                GradoviCount           = (await _apiService.Count())?.Data.First() ?? 0;
                lblGradoviCounter.Text = GradoviCount.ToString();
                break;

            case Routes.ZdravstvenaStanjaRoute:
                _apiService.ChangeRoute(Routes.ZdravstvenaStanjaRoute);
                ZdravstvenaStanjaCount           = (await _apiService.Count())?.Data.First() ?? 0;
                lblZdravstvenaStanjaCounter.Text = ZdravstvenaStanjaCount.ToString();
                break;

            case Routes.NaucneOblastiRoute:
                _apiService.ChangeRoute(Routes.NaucneOblastiRoute);
                NaucneOblastiCount           = (await _apiService.Count())?.Data.First() ?? 0;
                lblNaucneOblastiCounter.Text = NaucneOblastiCount.ToString();

                break;

            case Routes.RolesRoute:
                _apiService.ChangeRoute(Routes.RolesRoute);
                RolesCount           = (await _apiService.Count())?.Data.First() ?? 0;
                lblRolesCounter.Text = RolesCount.ToString();
                break;

            default:
                return;
            }
        }