Ejemplo n.º 1
0
        public async Task Init()
        {
            if (GradoviList.Count == 0)
            {
                var gradovilist = await _gradovi.Get <List <Gradovi> >(null);

                Gradovi sviGradovi = new Gradovi();
                sviGradovi.Naziv  = "Svi gradovi";
                sviGradovi.GradId = 0;
                GradoviList.Add(sviGradovi);



                foreach (var grad in gradovilist)
                {
                    GradoviList.Add(grad);
                }
            }

            if (SelectedGrad != null)
            {
                if (SelectedGrad.GradId == 0)
                {
                    var list = await _teretane.Get <IEnumerable <Teretana> >(null);

                    TeretaneList.Clear();
                    foreach (var trt in list)
                    {
                        TeretaneList.Add(trt);
                    }
                }
                else
                {
                    TeretanaSearchRequest search = new TeretanaSearchRequest();
                    search.GradId = SelectedGrad.GradId;
                    if (NazivTeretane != null)
                    {
                        search.Naziv = NazivTeretane;
                    }

                    var list = await _teretane.Get <IEnumerable <Teretana> >(search);

                    TeretaneList.Clear();
                    foreach (var teretana in list)
                    {
                        TeretaneList.Add(teretana);
                    }
                }
            }
            else
            {
                var list = await _teretane.Get <IEnumerable <Teretana> >(null);

                TeretaneList.Clear();
                foreach (var teretana in list)
                {
                    TeretaneList.Add(teretana);
                }
            }
        }
Ejemplo n.º 2
0
        public async Task PretragaPoNazivu()
        {
            TeretanaSearchRequest search = new TeretanaSearchRequest();

            search.Naziv = NazivTeretane;
            var list = await _teretane.Get <IEnumerable <Teretana> >(search);

            TeretaneList.Clear();
            foreach (var teretana in list)
            {
                TeretaneList.Add(teretana);
            }
        }
        public async Task Init()
        {
            ClanTeretanaSearchRequest search = new ClanTeretanaSearchRequest();

            search.ClanId = Global.LogiraniClanId;

            var list = await _clanTeretane.Get <IEnumerable <ClanTeretana> >(search);

            TeretaneList.Clear();
            foreach (var teretana in list)
            {
                Teretana t = await _teretane.GetById <Teretana>(teretana.TeretanaId);

                TeretaneList.Add(t);
            }
        }
Ejemplo n.º 4
0
        public async Task Init()
        {
            TeretanaSearchRequest  search = new TeretanaSearchRequest();
            IEnumerable <Teretane> list;
            var clan = await _clanService.GetById <Clanovi>(APIServices.ClanId);

            search.GradId = clan.GradId;
            if (Search != String.Empty)
            {
                search.Naziv = Search;
                list         = await _teretanaServices.Get <IEnumerable <Teretane> >(search);
            }
            else
            {
                list = await _teretanaServices.Get <IEnumerable <Teretane> >(search);
            }
            TeretaneList.Clear();
            foreach (var teretane in list)
            {
                TeretaneList.Add(teretane);
            }
        }