Example #1
0
        public IActionResult Index(int OdrzaniCasId)
        {
            UIndexVM uIndexVM = new UIndexVM();

            uIndexVM.OdrzaniCasId = OdrzaniCasId;
            uIndexVM.Ucenici      = new List <UIndexVM.Row>();
            List <OdrzaniCasDetalj> ocdList = _myContext.OdrzaniCasDetalj.Include(x => x.UpisUOdjeljenje).Include(x => x.UpisUOdjeljenje.Ucenik).Where(x => x.OdrzaniCasId == OdrzaniCasId).ToList();

            foreach (var item in ocdList)
            {
                UIndexVM.Row row = new UIndexVM.Row();
                row.OdrzaniCasDetaljiId = item.Id;
                row.Ucenik = item.UpisUOdjeljenje.Ucenik.Ime;
                row.Ocjena = item.Ocjena ?? 0;
                if (item.Odsutan == true)
                {
                    row.Prisutan = "Ne";
                }
                else
                {
                    row.Prisutan = "Da";
                }
                if (item.OpravdanoOdsutan == true)
                {
                    row.OpravdanoOdsutan = "Da";
                }
                else
                {
                    row.OpravdanoOdsutan = "Ne";
                }
                uIndexVM.Ucenici.Add(row);
            }
            return(View(uIndexVM));
        }
        public IActionResult Index(int MaturskiIspitId)
        {
            UIndexVM uIndexVM = new UIndexVM();

            uIndexVM.MaturskiIspitId = MaturskiIspitId;
            uIndexVM.Ucenici         = new List <UIndexVM.Row>();
            List <MaturskiIspitStavka> mis = _myContext.MaturskiIspitiStavke.Include(x => x.UpisUOdjeljenje).Include(x => x.UpisUOdjeljenje.Ucenik).Where(x => x.MaturskiIspitId == MaturskiIspitId).ToList();

            foreach (var item in mis)
            {
                UIndexVM.Row row = new UIndexVM.Row();
                row.MaturskiIspitStavkaId = item.Id;
                row.Ucenik     = item.UpisUOdjeljenje.Ucenik.ImePrezime;
                row.OpciUspjeh = item.UpisUOdjeljenje.OpciUspjeh;
                if (item.Bodovi == null)
                {
                    row.Bodovi = "(oslobodjen)";
                }
                else
                {
                    row.Bodovi = item.Bodovi.ToString();
                }
                if (item.Oslobodjen == true)
                {
                    row.Oslobodjen = "Da";
                }
                else
                {
                    row.Oslobodjen = "Ne";
                }
                uIndexVM.Ucenici.Add(row);
            }
            return(PartialView("Index", uIndexVM));
        }
Example #3
0
        public IActionResult Index(int OdrzaniCasId)
        {
            UIndexVM uIndexVM = new UIndexVM();

            uIndexVM.OdrzaniCasId = OdrzaniCasId;
            uIndexVM.Ucenici      = new List <UIndexVM.Row>();
            List <OdrzaniCasDetalji> ocdList = _myContext.OdrzaniCasDetalji.Include(x => x.SlusaPredmet).Include(x => x.SlusaPredmet.UpisGodine).Include(x => x.SlusaPredmet.UpisGodine.Student).Where(x => x.OdrzaniCasId == OdrzaniCasId).ToList();

            foreach (var item in ocdList)
            {
                UIndexVM.Row row = new UIndexVM.Row();
                row.OdrzaniCasDetaljiId = item.Id;
                row.Ucenik = item.SlusaPredmet.UpisGodine.Student.Ime + " " + item.SlusaPredmet.UpisGodine.Student.Prezime;
                row.Bodovi = item.BodoviNaCasu;
                if (item.Prisutan)
                {
                    row.Prisutan = "Prisutan";
                }
                else
                {
                    row.Prisutan = "Odsutan";
                }
                uIndexVM.Ucenici.Add(row);
            }
            return(PartialView("Index", uIndexVM));
        }
        public IActionResult Index(int OdjeljenjeId)
        {
            UIndexVM uIndexVM = new UIndexVM();

            uIndexVM.OdjeljenjeId = OdjeljenjeId;
            uIndexVM.Ucenici      = new List <UIndexVM.Row>();
            List <OdjeljenjeStavka> ucenici = _myContext.OdjeljenjeStavka.Include(x => x.Ucenik).Where(x => x.OdjeljenjeId == OdjeljenjeId).ToList();

            foreach (var item in ucenici)
            {
                UIndexVM.Row row = new UIndexVM.Row();
                row.OdjeljenjeStavkaId    = item.Id;
                row.BrojUDnevniku         = item.BrojUDnevniku;
                row.Ucenik                = item.Ucenik.ImePrezime;
                row.BrojZakljucenihOcjena = _myContext.DodjeljenPredmet.Where(x => x.OdjeljenjeStavka.UcenikId == item.UcenikId).Count(x => x.ZakljucnoKrajGodine != 0);
                uIndexVM.Ucenici.Add(row);
            }
            return(View("Index", uIndexVM));
        }
        public IActionResult Index()
        {
            UIndexVM uIndexVM = new UIndexVM();

            uIndexVM.Uputnice = new List <UIndexVM.Row>();
            List <Uputnica> u = _myContext.Uputnica.Include(x => x.UputioLjekar).Include(x => x.Pacijent).Include(x => x.VrstaPretrage).ToList();

            foreach (var item in u)
            {
                UIndexVM.Row row = new UIndexVM.Row();
                row.UputnicaId     = item.Id;
                row.Datum          = item.DatumUputnice;
                row.UputioLjekar   = item.UputioLjekar.Ime;
                row.Pacijent       = item.Pacijent.Ime;
                row.VrstaPretrage  = item.VrstaPretrage.Naziv;
                row.DatumRezultata = item.DatumRezultata;
                uIndexVM.Uputnice.Add(row);
            }
            return(View(uIndexVM));
        }