Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Ime,Prezime,KontaktBroj")] PotDugovi potDugovi)
        {
            if (id != potDugovi.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(potDugovi);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PotDugoviExists(potDugovi.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(potDugovi));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ID,Ime,Prezime,KontaktBroj")] PotDugovi potDugovi)
        {
            if (ModelState.IsValid)
            {
                _context.Add(potDugovi);
                await _context.SaveChangesAsync();

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