public async Task <IActionResult> Edit(int id, [Bind("NoviceId,datum,avtor,besedilo,UporabnikiId")] Novice novice) { if (id != novice.NoviceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(novice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NoviceExists(novice.NoviceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UporabnikiId"] = new SelectList(_context.Uporabnik, "UporabnikiId", "UporabnikiId", novice.UporabnikiId); return(View(novice)); }
public async Task <IActionResult> Create([Bind("NoviceId,datum,avtor,besedilo,UporabnikiId")] Novice novice) { if (ModelState.IsValid) { _context.Add(novice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UporabnikiId"] = new SelectList(_context.Uporabnik, "UporabnikiId", "UporabnikiId", novice.UporabnikiId); return(View(novice)); }
public static void Gamestart() { Unit player = new Novice(); player.chanDef(); player.chanPower(); Unit enemy = new Unit(); Login(player); //Open(player); //Epi_1(player); Field(player, enemy, "1"); }