public async Task <IActionResult> Edit(int id, [Bind("Id,NomeEmp,NomeRep,Cnpj,TelefoneCom1,TelefoneCom2,TelefoneCel1,TelefoneCel2,Endereco,DescricaoEmp")] Fornecedor fornecedor) { if (id != fornecedor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(fornecedor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FornecedorExists(fornecedor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(fornecedor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Descricao,Valor,Data,Custo")] Despesa despesa) { if (id != despesa.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(despesa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DespesaExists(despesa.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(despesa)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ServicoNom,Valor,Custo,Desconto,IdFuncionario")] Preco preco) { if (id != preco.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(preco); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrecoExists(preco.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdFuncionario"] = new SelectList(_context.Funcionario, "Id", "Id", preco.IdFuncionario); return(View(preco)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Sobrenome,Sexo,Nascimento,TelefoneCel,TelefoneRes,Email,Cargo")] Administrador administrador) { if (id != administrador.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(administrador); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdministradorExists(administrador.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(administrador)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Login,Password,NivelDeAcesso")] Usuario usuario) { if (id != usuario.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuarioExists(usuario.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuario)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Sobrenome,Sexo,Nascimento,Endereco,EnderecoNum,TelefoneCel,TelefoneRes,Email,Cargo")] Funcionario funcionario) { if (id != funcionario.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(funcionario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FuncionarioExists(funcionario.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(funcionario)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Valor,Custo,Desconto,TipoPag")] Servico servico) { if (id != servico.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(servico); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ServicoExists(servico.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(servico)); }