Ejemplo n.º 1
0
        public async Task Init()
        {
            if (KategorijaList.Count == 0)
            {
                var list1 = await _clanakkategorija.Get <List <ClanakKategorija> >(null);

                KategorijaList.Clear();
                foreach (var novost in list1)
                {
                    KategorijaList.Add(novost);
                }
            }
            if (Kategorija != null)
            {
                var list = await _novostiService.Get <IEnumerable <Clanak> >(new ClanakSearchRequest { KategorijaId = Kategorija.ClanciKategorijaId });

                NovostiList.Clear();
                foreach (var novost in list)
                {
                    NovostiList.Add(novost);
                }
            }
            else
            {
                var list = await _novostiService.Get <IEnumerable <Clanak> >(null);

                NovostiList.Clear();
                foreach (var novost in list)
                {
                    NovostiList.Add(novost);
                }
            }
        }
        public async Task Init()
        {
            try
            {
                var lista = await _novostiService.Get <List <Model.Novosti> >(null);

                var listaNotif = await _putnikNotifikacijeService.Get <List <PutnikNotifikacije> >(null);

                NovostiList.Clear();



                foreach (var item in lista)
                {
                    item.BrojPregleda = 0;
                    foreach (var item2 in listaNotif)
                    {
                        if (item.Id == item2.Notifikacija.NovostId && item2.Pregledana)
                        {
                            item.BrojPregleda += 1;
                        }
                    }
                }
                foreach (var item in lista)
                {
                    NovostiList.Add(item);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        public async Task Init()
        {
            var list = await _service.Get <IEnumerable <Novosti> >(null);

            NovostiList.Clear();
            foreach (var novost in list)
            {
                NovostiList.Add(novost);
            }
        }
Ejemplo n.º 4
0
        public async Task UcitajNovosti()
        {
            var novosti = await _novosti.Get <IEnumerable <Model.Novosti> >(null);

            NovostiList.Clear();
            foreach (var item in novosti)
            {
                NovostiList.Add(item);
            }
            NovostiList.OrderBy(a => a.DatumObjave);
        }