public ActionResult Edit(Registro registro) { if (ModelState.IsValid) { db.Entry(registro).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.VeiculoId = new SelectList(db.Veiculos, "Id", "Placa", registro.VeiculoId); return(View(registro)); }
public async Task <IActionResult> PutEstacionamento([FromRoute] int id, [FromBody] Estacionamento estacionamento) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != estacionamento.EstacionamentoID) { return(BadRequest()); } _context.Entry(estacionamento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EstacionamentoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,Descricao,Valor")] ValorRotativo valorrotativo) { if (ModelState.IsValid) { db.Entry(valorrotativo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(valorrotativo)); }
public ActionResult Edit([Bind(Include = "Id,Nome,HoraInicio,HoraFim")] Turno turno) { if (ModelState.IsValid) { db.Entry(turno).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(turno)); }
public ActionResult Edit([Bind(Include = "Id,Razaosocial,Cnpj,Nomefantasia,Endereco,Telefone,Email")] Pjuridica pjuridica) { if (ModelState.IsValid) { db.Entry(pjuridica).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pjuridica)); }
public ActionResult Edit([Bind(Include = "Id,Nome,Cpf,Sexo,Nascimento,Rg,Endereco,Telefone,Email")] Pfisica pfisica) { if (ModelState.IsValid) { db.Entry(pfisica).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pfisica)); }
public ActionResult Edit([Bind(Include = "Id,Nome,Telefone")] Cliente cliente) { if (ModelState.IsValid) { db.Entry(cliente).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cliente)); }
public ActionResult Edit([Bind(Include = "Id,Placa,cor,ClienteId")] Veiculo veiculo) { if (ModelState.IsValid) { db.Entry(veiculo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClienteId = new SelectList(db.Clientes, "Id", "Nome", veiculo.ClienteId); return(View(veiculo)); }
public ActionResult Edit([Bind(Include = "Id,DataInicio,Datafim,Valor,TurnoId,ClienteId")] Contrato contrato) { if (ModelState.IsValid) { db.Entry(contrato).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClienteId = new SelectList(db.Clientes, "Id", "Telefone", contrato.ClienteId); // ViewBag.TurnoId = new SelectList(db.Turnos, "Id", "Nome", contrato.TurnoId); return(View(contrato)); }