public ActionResult Update(string Placa) { List <SelectListItem> lst = new List <SelectListItem>(); lst.Add(new SelectListItem() { Text = "Automóvil", Value = "Automóvil" }); lst.Add(new SelectListItem() { Text = "Camioneta", Value = "Camioneta" }); lst.Add(new SelectListItem() { Text = "Van", Value = "Van" }); lst.Add(new SelectListItem() { Text = "Cuatrimoto", Value = "Cuatrimoto" }); lst.Add(new SelectListItem() { Text = "Moto", Value = "Moto" }); ViewBag.Opciones = lst; NegVehiculo obj = new NegVehiculo(); VehiculoBO dto = obj.Listar().FirstOrDefault(a => a.PLACA == Placa); return(View("update", dto)); }
public ActionResult Update(VehiculoBO dto) { NegVehiculo obj = new NegVehiculo(); obj.Actualizar(dto); return(RedirectToAction("Listar")); }
public ActionResult InsertVehiculo(VehiculoBO dto) { NegVehiculo obj = new NegVehiculo(); obj.Insert(dto); return(RedirectToAction("Listar")); }
private void EliminarVehiculo() { var vehiculo = new Vehiculo { Marca = txtMarca.Text, Modelo = txtModelo.Text, Tipo = txtTipo.Text, Precio = txtPrecio.Text, Cantidad = txtPrecio.Text, }; var vehiculoBo = new VehiculoBO(); try { if (!txtMarca.Text.Equals("")) { vehiculoBo.EliminarVehiculo(txtMarca.Text.Trim()); MonstrarMensaje("Vehiculo eliminado satisfactoriamente"); } } catch (Exception e) { MonstrarError(e.Message); } }
private void InsertarVehiculo() { var vehiculo = new Vehiculo { Marca = txtMarca.Text, Modelo = txtModelo.Text, Tipo = txtTipo.Text, Precio = txtPrecio.Text, Cantidad = txtPrecio.Text, }; var vehiculoBo = new VehiculoBO(); try { vehiculoBo.RegistrarVehiculo(vehiculo); MonstrarMensaje("Vehiculo creado satisfactoriamente"); } catch (Exception e) { MonstrarError(e.Message); } }
public string Insert(VehiculoBO dto) { daoVehiculo dao = new daoVehiculo(); return(dao.Insertar(dto)); }
public string Actualizar(VehiculoBO dto) { daoVehiculo dao = new daoVehiculo(); return(dao.Actualizar(dto)); }