Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ProdutoID,Descricao,Preco,Qtde")] Produto produto)
        {
            if (id != produto.ProdutoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(produto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProdutoExists(produto.ProdutoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(produto));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Cpf,Nome")] Cotista cotista)
        {
            if (id != cotista.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cotista);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CotistaExists(cotista.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cotista));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ClienteId,Nome,Data,Documento,Telefone,TelTipo,Endereco,EndeTipo,TipoCliente")] Cliente cliente)
        {
            if (id != cliente.ClienteId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.ClienteId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }