public async Task <IActionResult> Edit(int id, [Bind("TipPolaganjaId,Tip,TipEng")] TipPolaganja tipPolaganja)
        {
            if (id != tipPolaganja.TipPolaganjaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tipPolaganja);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TipPolaganjaExists(tipPolaganja.TipPolaganjaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipPolaganja));
        }
Exemple #2
0
        public async Task <IActionResult> PocetakTesta([Bind("TipPolaganjaId,Tip")] TipPolaganja tipPolaganja)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tipPolaganja);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Uvod)));
            }
            return(View(tipPolaganja));
        }
        public async Task <IActionResult> Create([Bind("TipPolaganjaId,Tip,TipEng")] TipPolaganja tipPolaganja)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tipPolaganja);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipPolaganja));
        }