public IActionResult Index() { MojDBInitializer.Izvrsi(_context); KorisnickiNalog korisnik = Autentifikacija.GetLogiraniKorisnik(HttpContext); if (korisnik == null) { return(Redirect("/login")); } if (korisnik.UlogaID == 1) { return(Redirect("/AdministratorModul/AdministratorHome")); } if (korisnik.UlogaID == 2) { return(Redirect("/ReferentZaKlijenteModul/ReferentZaKlijenteHome")); } if (korisnik.UlogaID == 3) { return(Redirect("/ServiserModul/ServiserHome")); } return(View()); }
public IActionResult TestDB() { if (!_context.Ucenik.Any()) { MojDBInitializer.Izvrsi(_context); } return(View(_context)); }
public IActionResult TestDB() { if (!_db.Nastavnik.Any()) { MojDBInitializer.Izvrsi(_db); } return(View(_db)); }
public IActionResult TestDB() { if (!db.Ucenik.Any()) { MojDBInitializer.Seed(db); } return(View(db)); }
public IActionResult Index() { if (!_context.Dogadjaj.Any()) { MojDBInitializer.Izvrsi(_context); } return(View(new LoginVM() { usersList = _context.KorisnickiNalog.Select(x => new SelectListItem { Text = x.KorisnickoIme, Value = x.KorisnickoIme }).ToList() })); }
public ActionResult Provjera(string username, string password) { MojDBInitializer.Izvrsi(_db); var Nastavnik = _db.Nastavnik.Where(x => x.Username == username).Select(s => new NastavnikLoginVM { Username = s.Username, ImePrezime = s.Ime + " " + s.Prezime, NastavnikId = s.Id, SkolaID = s.SkolaID, SkolaNaziv = s.Skola.Naziv }).FirstOrDefault(); HttpContext.SetLogiraniKorisnik(Nastavnik); if (Nastavnik == null) { return(RedirectToAction("Index", "Login")); } else { return(RedirectToAction("Index", "Home")); } }
public void Inc() { MojDBInitializer.Izvrsi(_myContext); }
public IActionResult TestDB() { MojDBInitializer.Izvrsi(_context); return(View(_context)); }
public IActionResult TestDB() { MojDBInitializer.Podaci(_db); return(View(_db)); }
public ActionResult Logout() { MojDBInitializer.Izvrsi(_db); HttpContext.SetLogiraniKorisnik(null); return(RedirectToAction("Index")); }
public IActionResult TestDB() { MojDBInitializer.Podaci(); return(View(new MojContext())); }
public void Inc() { MojDBInitializer.Seed(_myContext); }