public async Task Init()
        {
            SearchMobileServiceRequest req = new SearchMobileServiceRequest();

            req.KorisnikId = APIService.KorisnikId;
            if (SelectedVrstaStatusa != null)
            {
                req.VrstaStatusaId = SelectedVrstaStatusa.StatusServisaId;
            }
            var list = await _servisiService.GetParam <IEnumerable <ServisModel> >("GetServisiByUser", req);

            if (VrsteStatusaList.Count < 1)
            {
                var listaStatusa = await _servisiService.Get <IEnumerable <StatusServisaModel> >("GetVrsteStatusa");

                VrsteStatusaList.Clear();
                VrsteStatusaList.Add(new StatusServisaModel {
                    StatusServisaId = 0, Naziv = "(SVE)"
                });
                foreach (var item in listaStatusa)
                {
                    VrsteStatusaList.Add(item);
                }
            }
            ServisiList.Clear();
            foreach (var item in list)
            {
                ServisiList.Add(item);
            }
        }
Пример #2
0
        public async Task Init(int id)
        {
            ServisId = id;
            if (VrsteStatusaList.Count < 1)
            {
                var vrstaServisa = await _servisiService.Get <IEnumerable <StatusServisaModel> >("GetVrsteStatusa");

                VrsteStatusaList.Clear();
                foreach (var item in vrstaServisa)
                {
                    VrsteStatusaList.Add(item);
                }
            }
        }