示例#1
0
        public string NadjiPruzaoca(string userName, out int count, out string slika)
        {
            var Pruzalac = PruzaociUsluga
                           .Include(x => x.MojiZahtevi).ThenInclude(x => x.Oglas)
                           .FirstOrDefault(x => x.UserName == userName);

            count = 0;
            foreach (var zahtev in Pruzalac.MojiZahtevi)
            {
                if (zahtev.Oglas.ProveriDaLiVazi())
                {
                    Update(zahtev.Oglas);
                    SaveChanges();
                }
                if (zahtev.Oglas.Stanje != Stanje.Aktivan)
                {
                    if (!zahtev.Pregledan)
                    {
                        zahtev.Pregledan = true;
                        Update(zahtev);
                        SaveChanges();
                    }
                }
                if (zahtev.Naslov != Pruzalac.UserName && !zahtev.Pregledan)
                {
                    count++;
                }
            }
            slika = Pruzalac.PutanjaDoSlike;
            return(Pruzalac.Id);
        }
示例#2
0
        public async Task <PruzalacUsluge> VratiPruzaocaSaId(string idPruzaoca)
        {
            var Pruzalac = await PruzaociUsluga
                           .Include(x => x.Evidencije).ThenInclude(x => x.Oglas).ThenInclude(x => x.KorisnikUsluge)
                           .Include(x => x.PreuzetOglas)
                           .Include(x => x.MojiZahtevi).ThenInclude(x => x.Oglas)
                           .FirstOrDefaultAsync(x => x.Id == idPruzaoca);

            return(Pruzalac);
        }
示例#3
0
        public async Task <PruzalacUsluge> VratiPruzaoca(string userName)
        {
            var Pruzalac = await PruzaociUsluga
                           .Include(x => x.Evidencije).ThenInclude(x => x.Oglas).ThenInclude(x => x.KorisnikUsluge)
                           .Include(x => x.PreuzetOglas).ThenInclude(x => x.KorisnikUsluge)
                           .Include(x => x.PreuzetOglas).ThenInclude(x => x.OdabranPruzalac)
                           .Include(x => x.MojiZahtevi).ThenInclude(x => x.Oglas).ThenInclude(x => x.KorisnikUsluge)
                           .Include(x => x.MojiZahtevi).ThenInclude(x => x.Ucesnik)
                           .FirstOrDefaultAsync(x => x.UserName == userName);

            return(Pruzalac);
        }