Exemplo n.º 1
0
        public IActionResult IspitDetaljiSave(IspitDetaljiAddVM model)
        {
            IspitDetalji noviDetalji = new IspitDetalji
            {
                IspitID   = model.IspitID,
                StudentID = model.StudentID,
                Ocjena    = model.Ocjena,
                Pristupio = true
            };

            db.IspitDetalji.Add(noviDetalji);
            db.SaveChanges();
            return(Redirect("/Ispit/Detalji?IspitID=" + model.IspitID));
        }
Exemplo n.º 2
0
        public IActionResult IspitDetaljiAdd(int IspitID)
        {
            Ispit ispit = db.Ispit.Where(x => x.Id == IspitID)
                          .Include(x => x.Angazovan)
                          .Include(x => x.Angazovan.Nastavnik)
                          .Include(x => x.Angazovan.Predmet)
                          .Include(x => x.Angazovan.AkademskaGodina)
                          .FirstOrDefault();
            IspitDetaljiAddVM model = new IspitDetaljiAddVM()
            {
                IspitID  = IspitID,
                Studenti = db.Student.Select(x => new Microsoft.AspNetCore.Mvc.Rendering.SelectListItem()
                {
                    Value = x.Id.ToString(),
                    Text  = $"{x.Ime},{x.Prezime}"
                }).ToList()
            };

            return(View(model));
        }