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); }
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); }
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); }