Beispiel #1
0
        //Metoda koja nam pomaze da pronadjemo prosledjenu osobu u bazi
        public Osoba PronadjiOsobu(long?id)
        {
            SkolaContext _context;

            _context = new SkolaContext();
            Osoba o = new Osoba();

            o = _context.Osoba.Where(x => x.IdOsobe == id).FirstOrDefault();
            return(o);
        }
        //Metoda koja trazi prosledjenog korisnika u baze
        public Korisnik PronadjiKorisnika(long?id)
        {
            SkolaContext _context;

            _context = new SkolaContext();
            Korisnik k = new Korisnik();

            k = _context.Korisnik.Where(x => x.IdKorisnika == id).FirstOrDefault();
            return(k);
        }
        public ActionResult Izbrisi(long?id, FormCollection fcNotUsed)
        {
            SkolaContext _context;

            _context = new SkolaContext();
            var korisnik = _context.Korisnik.Where(x => x.IdKorisnika == id).FirstOrDefault();

            _context.Korisnik.Remove(korisnik);
            _context.SaveChanges();
            return(RedirectToAction("Index", "Korisnik"));
        }
Beispiel #4
0
        public ActionResult Izbrisi(long?id, FormCollection fcNotUsed)
        {
            SkolaContext _context;

            _context = new SkolaContext();
            var osoba = _context.Osoba.Where(x => x.IdOsobe == id).FirstOrDefault();

            _context.Osoba.Remove(osoba);
            _context.SaveChanges();
            return(RedirectToAction("Index", "Osoba"));
        }
Beispiel #5
0
        public void IndexTest()
        {
            //Arange
            SkolaContext            _context   = new SkolaContext();
            KorisnikControllerTests controller = new KorisnikControllerTests();
            //Act
            var result = _context.Korisnik;

            //Assert
            Assert.IsNotNull(result);
        }
        public void IndexTest()
        {
            //Arange
            SkolaContext            _context   = new SkolaContext();
            TipMailaControllerTests controller = new TipMailaControllerTests();
            //Act
            var result = _context.TipMaila;

            //Assert
            Assert.IsNotNull(result);
        }
Beispiel #7
0
        public Skola PronadjiSkolu(long?id)
        {
            SkolaContext _context;

            _context = new SkolaContext();

            Skola s = new Skola();

            s = _context.Skola.Where(x => x.IdSkole == id).FirstOrDefault();
            return(s);
        }
        public void IndexTest()
        {
            //Arange
            SkolaContext    _context   = new SkolaContext();
            SkolaController controller = new SkolaController();
            //Act
            var result = _context.Skola;

            //Assert
            Assert.IsNotNull(result);
        }
Beispiel #9
0
 public ActionResult Authorize(SkolaProjektniCentar.ViewModel.KorisnikViewModel korisnik)
 {
     using (SkolaContext _context = new SkolaContext())
     {
         var details = _context.Korisnik.Where(x => x.KorisnickoIme == korisnik.KorisnickoIme && x.Lozinka == korisnik.Lozinka).FirstOrDefault();
         if (details == null || !ModelState.IsValid)
         {
             korisnik.LoginError = "Pogresno korisnicko ime ili lozinka";
             return(View("Index", korisnik));
         }
         else
         {
             Session["PravoPristupa"] = details.PravoPristupa;
             Session["KorisnickoIme"] = details.KorisnickoIme;
             return(RedirectToAction("Index", "Home"));
         }
     }
 }
Beispiel #10
0
 public ActionResult Login(SkolaProjektniCentar.Korisnik korisnik)
 {
     using (SkolaContext _context = new SkolaContext())
     {
         var details = _context.Korisnik.Where(x => x.KorisnickoIme == korisnik.KorisnickoIme && x.Lozinka == korisnik.Lozinka).FirstOrDefault();
         if (details == null)
         {
             //korisnik. = "Pogresna lozinka ili nepostojece korisnicko ime";
             TempData["msg"] = "<script>alert('Pogresna lozinka ili nepostojece korisnicko ime');</script>";
             return(View("Index", korisnik));
         }
         else
         {
             Session["PravoPristupa"] = details.PravoPristupa;
             Session["KorisnickoIme"] = details.KorisnickoIme;
             return(RedirectToAction("Index", "Home"));
         }
     }
 }
Beispiel #11
0
 public SkolaController()
 {
     _context = new SkolaContext();
 }
Beispiel #12
0
 public TipTelefonaController()
 {
     _context = new SkolaContext();
 }
 public KorisnikController()
 {
     _context = new SkolaContext();
 }
Beispiel #14
0
 public MailListeController()
 {
     _context = new SkolaContext();
 }
Beispiel #15
0
 public KontaktTelefonController()
 {
     _context = new SkolaContext();
 }
Beispiel #16
0
 public TipMailaController()
 {
     _context = new SkolaContext();
 }
Beispiel #17
0
 public StudentisController(SkolaContext context)
 {
     _context = context;
 }