Ejemplo n.º 1
0
        public IActionResult Dodajtermin(int TerminRasporedaPolaganjaId, int RasporedId, string TerminOd, string TerminDo, int KandidatId)
        {
            TerminRasporedPolaganja terminRaspored;

            if (TerminRasporedaPolaganjaId == 0)
            {
                terminRaspored = new TerminRasporedPolaganja();

                terminRaspored.TerminOd            = TerminOd;
                terminRaspored.TerminDo            = TerminDo;
                terminRaspored.KandidatId          = KandidatId;
                terminRaspored.RasporedPolaganjaId = RasporedId;
                reposTermin.Add(terminRaspored);
            }
            else
            {
                terminRaspored            = reposTermin.GetById(TerminRasporedaPolaganjaId);
                terminRaspored.TerminOd   = TerminOd;
                terminRaspored.TerminDo   = TerminDo;
                terminRaspored.KandidatId = KandidatId;
                reposTermin.Save();
            }

            return(RedirectToAction("DetaljiRasporedaPolaganja", "RasporedPolaganja", new { RasporedId = @RasporedId }));
        }
Ejemplo n.º 2
0
        public IActionResult UrediTermin(int TerminId)
        {
            TerminRasporedPolaganja terminRaspored   = reposTermin.GetById(TerminId);
            List <Kandidat>         kandidati        = reposKandidat.GetAll();
            RasporedPolaganjaVM     terminRasporedVM = new RasporedPolaganjaVM()
            {
                Termin    = terminRaspored,
                Kandidati = kandidati
            };

            return(View(terminRasporedVM));
        }
Ejemplo n.º 3
0
 public void Add(TerminRasporedPolaganja terminRaspored)
 {
     context.TerminRasporedPolaganja.Add(terminRaspored);
     context.SaveChanges();
 }