public Autentikacija Provjera(string SporazumBroj, string JMBG)
 {
     PoslovniKlubEntities ctx = new PoslovniKlubEntities();
     int i = ctx.korisnici.Where(x => x.SporazumBroj == SporazumBroj && x.JMBG == JMBG).Count();
     if (i == 0 || i > 1)
         return null;
     else
     {
         Autentikacija korisnik = ctx.korisnici.Where(x => x.SporazumBroj == SporazumBroj && x.JMBG == JMBG)
         .Select(x => new Autentikacija
         {
             KorisnikID = x.KorisnikID,
             Prezime = x.Prezime,
             Ime = x.Ime,
             SporazumBroj = x.SporazumBroj,
             JMBG = x.JMBG,
             Clan = (DateTime) x.ClanDo,
             grad = x.opstine.naziv,
             BrAkt = x.oglasi.Where(y => y.VrijediDo >= DateTime.Now).Count(),
             BrIst = x.oglasi.Where(y => y.VrijediDo < DateTime.Now).Count()
         }).SingleOrDefault();
         return korisnik;
     }
 }
Exemplo n.º 2
0
 //CONSTRUCTOR
 public PoslovniKlubBL()
 {
     context = new PoslovniKlubEntities();
 }