public ActionResult Create([Bind(Include = "Marca,Modelo,EmpresaRef,Activo,Id_Empleado")] Vehiculo vehiculo) { var vehiculos = vehi.GetAllVehiculos(); if (ModelState.IsValid) { vehi.AltaVehiculo(vehiculo); return(RedirectToAction("Index")); } return(View(vehiculos)); }
// GET: Sensores/Create public ActionResult Create() { Options.Add(new SelectListItem() { Text = "GPS", Value = "G" }); Options.Add(new SelectListItem() { Text = "Motor", Value = "M" }); Options.Add(new SelectListItem() { Text = "Seguridad", Value = "S" }); Options.Add(new SelectListItem() { Text = "Combustible", Value = "C" }); ViewBag.Options = Options; ViewBag.VehiculoRef = new SelectList(vehi.GetAllVehiculos(), "Id", "Marca"); return(View()); }