private void FRMAutomovil_Load(object sender, EventArgs e) { this.CMBestado.Items.Add("Activo"); this.CMBestado.Items.Add("Inactivo"); if (!formularioPrecargado) { this.CMBestado.Text = "Activo"; BTNeliminar.Visible = false; } ; Dictionary <String, String> searchAll = new Dictionary <string, string>(); marcas = Marca.buscar(searchAll); turnos = Turno.buscar(searchAll); choferes = Chofer.buscar(searchAll); //---Atributos que mostramos en los combos--- marcas.ForEach(marca => CMBmarca.Items.Add(marca.Nombre)); turnos.ForEach(turno => CMBturno.Items.Add(turno.Descripcion)); choferes.ForEach(chofer => CMBChofer.Items.Add(chofer.Nombre)); if (formularioPrecargado) { this.TXTpatente.Text = patente; this.CMBmarca.Text = marcas.Find(marca => marca.IdMarca == idmarca).Nombre; this.TXTmodelo.Text = idmodelo.ToString(); this.CMBturno.Text = turnos.Find(turno => turno.IdTurno == idturno).Descripcion; this.CMBestado.Text = estado; this.CMBChofer.Text = choferes.Find(chofer => chofer.Dni == idChofer).Nombre; } }
private void busquedaDeValores() { Dictionary <String, String> parametrosDeBusqueda = new Dictionary <string, string>(); if (TXTnombre.Text != "") { parametrosDeBusqueda.Add("marca_nombre", TXTnombre.Text); } List <Marca> marcas = Marca.buscar(parametrosDeBusqueda); construccionDeGridView(marcas); }
private void FRMbuscarVehiculo_Load(object sender, EventArgs e) { Dictionary <String, String> searchAllMarcas = new Dictionary <string, string>(); marcas = Marca.buscar(searchAllMarcas); // turnos = Turno.buscar(searchAll); Dictionary <String, String> searchAllChoferes = new Dictionary <string, string>(); searchAllChoferes.Add("chofer_estado", "Activo"); choferes = Chofer.buscar(searchAllChoferes); //---Atributos que mostramos en los combos--- marcas.ForEach(marca => CMBmarca.Items.Add(marca.Nombre)); // turnos.ForEach(turno => CMBturno.Items.Add(turno.Descripcion)); choferes.ForEach(chofer => CMBChofer.Items.Add(chofer.Nombre)); //asociacion de datagrid con el evento de clic en boton dataGridView1.CellClick += dataGridView1_CellClick; }