예제 #1
0
 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));
 }
예제 #4
0
 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));
 }
예제 #5
0
 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));
 }
예제 #7
0
 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));
 }
예제 #8
0
 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));
 }
예제 #9
0
 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));
 }