Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("idDivisao,NumDivisao")] Divisoes divisoes)
        {
            if (id != divisoes.idDivisao)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(divisoes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DivisoesExists(divisoes.idDivisao))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                //return RedirectToAction(nameof(Index));
                return(View("Sucesso"));
            }
            return(View(divisoes));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("idDivisao,NumDivisao")] Divisoes divisoes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(divisoes);
                await _context.SaveChangesAsync();

                //return RedirectToAction(nameof(Index));
                return(View("Sucesso"));
            }
            return(View(divisoes));
        }