private void ModeloVehiculo_Load(object sender, EventArgs e) { dgvModelo.DataSource = _modeloService.GetModelo(); cbModeloMarca.DataSource = _marcaService.GetAll(); cbModeloMarca.DisplayMember = "Descripcion"; cbModeloMarca.ValueMember = "Id"; cbModeloMarca.SelectedIndex = 0; }
private void VehiculoCrear_Load(object sender, EventArgs e) { cbVehiculoTipo.DataSource = _tipoVehiculoService.GetAll(); cbVehiculoTipo.DisplayMember = "Descripcion"; cbVehiculoTipo.ValueMember = "Id"; cbVehiculoTipo.SelectedIndex = 0; cbVehiculoMarca.DataSource = _marcaService.GetAll(); cbVehiculoMarca.DisplayMember = "Descripcion"; cbVehiculoMarca.ValueMember = "Id"; cbVehiculoMarca.SelectedIndex = 0; cbVehiculoModelo.DataSource = _modeloService.Join(); cbVehiculoModelo.DisplayMember = "Value"; cbVehiculoModelo.ValueMember = "Key"; cbVehiculoModelo.SelectedIndex = 0; cbVehiculoCombustible.DataSource = _tipoCombustibleService.GetAll(); cbVehiculoCombustible.DisplayMember = "Descripcion"; cbVehiculoCombustible.ValueMember = "Id"; cbVehiculoCombustible.SelectedIndex = 0; }
// GET: Producto//con un string no habria problemas ya que ello soportan nulos int? filterByCategoria, hay que ponerlo en este caso al entero de manera explicita que soporte nulos //cuando es nullo el parametro filterByCategoria (se ha elegido Todos) //**SIN AJAX public ActionResult Index(string filterByName, int?filterByCategoria, int?filterByMarca) { filterByName = string.IsNullOrWhiteSpace(filterByName) ? "" : filterByName.Trim(); ViewBag.filterByName = filterByName; ViewBag.Categorias = categoriaServices.GetAll(""); ViewBag.Marcas = marcaServices.GetAll(""); var model = productoServices.GetAll(filterByName, filterByCategoria, filterByMarca); return(View(model)); }
private void MarcaVehiculo_Load(object sender, EventArgs e) { dgvMarca.DataSource = _marcaService.GetAll(); }
// GET: Marca public ActionResult Index() { var model = marcaServices.GetAll(""); return(View(model)); }