예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Naziv")] Partija partija)
        {
            if (ModelState.IsValid)
            {
                _context.Add(partija);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(partija));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,ZvanjaMi,BodoviMi,BodoviVi,ZvanjaVi,PartijaId")] Bela bela)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bela);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PartijaId"] = new SelectList(_context.Partija, "Id", "Naziv", bela.PartijaId);
            return(View(bela));
        }