Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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");
        }