Exemplo n.º 1
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,Descricao,IdPessoa,IdParceiroTipo")] Parceiro parceiro)
        {
            if (id != parceiro.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(parceiro);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ParceiroExists(parceiro.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdParceiroTipo"] = new SelectList(_context.ParceiroTipo, "Id", "Descricao", parceiro.IdParceiroTipo);
            ViewData["IdPessoa"]       = new SelectList(_context.Pessoa, "Id", "Id", parceiro.IdPessoa);
            return(View(parceiro));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Descricao")] ProdutoTipo produtoTipo)
        {
            if (id != produtoTipo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(produtoTipo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProdutoTipoExists(produtoTipo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(produtoTipo));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,Descricao,IdProduto,IdTabelaTipo")] Tabela tabela)
        {
            if (id != tabela.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tabela);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TabelaExists(tabela.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdProduto"]    = new SelectList(_context.Produto, "Id", "Id", tabela.IdProduto);
            ViewData["IdTabelaTipo"] = new SelectList(_context.TabelaTipo, "Id", "Descricao", tabela.IdTabelaTipo);
            return(View(tabela));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,IdCliente,IdParceiro,IdCotacao,DataCriacao,CriadoPor,DataEdicao,EditadoPor")] Proposta proposta)
        {
            if (id != proposta.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(proposta);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PropostaExists(proposta.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.Cliente, "Id", "Id", proposta.IdCliente);
            return(View(proposta));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,IdCliente,Uri,Ativo,DataCriacao,CriadoPor")] Cotacao cotacao)
        {
            if (id != cotacao.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cotacao);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CotacaoExists(cotacao.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.Cliente, "Id", "Id", cotacao.IdCliente);
            return(View(cotacao));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,IdPessoa")] Cliente cliente)
        {
            if (id != cliente.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPessoa"] = new SelectList(_context.Pessoa, "Id", "Id", cliente.IdPessoa);
            return(View(cliente));
        }