// private readonly UserManager<ProfilUrediVM> _userManager;

        public IActionResult Index()
        {
            Korisnik k     = HttpContext.GetLogiraniKorisnik();
            Kupac    kupac = ctx.Kupac.Where(x => x.KorisnikId == k.Id).FirstOrDefault();

            ProfilIndexVM model = new ProfilIndexVM {
                Ime           = kupac.Ime,
                Prezime       = kupac.Prezime,
                KorisnickoIme = k.KorisnickoIme,
                Email         = kupac.Email,
                Adresa        = kupac.Adresa,
                Opstina       = ctx.Opstina.Where(o => o.Id == k.OpstinaId).FirstOrDefault().Naziv
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Index(int id)
        {
            var k = db.KorisnikDbSet.Find(id);

            ProfilIndexVM model = new ProfilIndexVM();

            model.Id         = id;
            model.ImePrezime = k.Ime + " " + k.Prezime;
            model.JBMG       = k.JMBG;
            model.Adresa     = k.Adresa;
            model.Email      = k.Email;
            model.Naselje    = k.Naselje;
            model.Opcina     = k.Opcina.NazivOpcine;
            model.Telefon    = k.Telefon;

            model.ListaAktivnihUsluga = db.AktivneUslugeDbSet.Where(c => c.KorisnikId == k.Id && c.AktivnaUsluga == true).ToList();


            return(View(model));
        }