예제 #1
0
        public void UpdatcarStatus(string car, Vehiculos.Status status, int Step)
        {
            switch (Step)
            {
            case 1:
                var carro = Conection.Vehiculos.Where(x => x.NoChasis == car).FirstOrDefault();
                carro.Estado = status;
                Conection.Entry(carro).State = System.Data.Entity.EntityState.Modified;

                break;

            case 2:
                var pedido = Conection.Pedido.Where(x => x.MatriculaVehiculo == car).FirstOrDefault();
                pedido.Estado = PedidoRenta.RentaEstado.Liberado;
                Conection.Entry(pedido).State = System.Data.Entity.EntityState.Modified;

                carro        = Conection.Vehiculos.Where(x => x.NoChasis == car).FirstOrDefault();
                carro.Estado = status;
                Conection.Entry(carro).State = System.Data.Entity.EntityState.Modified;

                break;

            default:
                break;
            }


            Conection.SaveChanges();
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "PersonaId,Nombre,Cedula,Telefono,NoTarjetaCr,LímiteCredito,TipoPersona,Email")] Clientes clientes)
 {
     if (ModelState.IsValid)
     {
         Conection.Entry(clientes).State = EntityState.Modified;
         Conection.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(clientes));
 }
예제 #3
0
        public ActionResult EditVehiculoAction(Vehiculos vh)
        {
            if (ModelState.IsValid)
            {
                Conection.Entry(vh).State = System.Data.Entity.EntityState.Modified;
                Conection.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }