private void ModoBusquedaOn() { this.EstaBuscando = true; this.tipoArea_Seleccion = null; this.textBoxCodigo.Enabled = true; this.textBoxDescripcion.Enabled = true; this.buttonActualizar.Enabled = false; this.buttonEliminar.Enabled = false; this.buttonInsertar.Enabled = false; this.buttonSeleccionar.Text = "Buscar"; }
private void comboBoxTipoArea_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxTipoArea.SelectedIndex != -1) { this.tipoArea_Seleccion = tipoArea_Registros[comboBoxTipoArea.SelectedIndex]; } }
private void LimpiarVista() { // Variables. this.area_Registros = this.area_Negocio.ListarTodos(); this.tipoArea_Registros = this.tipoArea_Negocio.ListarTodos(); this.area_Seleccion = null; this.tipoArea_Seleccion = null; this.EstaBuscando = false; this.EstaEditando = false; // Componentes. this.buttonInsertar.Enabled = true; this.buttonActualizar.Enabled = false; this.buttonEliminar.Enabled = false; this.buttonActualizar.Text = "Editar"; this.buttonSeleccionar.Text = "Búsqueda"; this.comboBoxTipoArea.Enabled = true; this.textBoxCodigo.Enabled = false; this.textBoxDescripcion.Enabled = true; this.textBoxCodigo.Text = null; this.textBoxDescripcion.Text = null; // Operaciones. this.CargarCodigo(); this.TipoArea_CargarRegistros(this.tipoArea_Registros); this.Area_CargarRegistros(this.area_Registros); }
private void dataGridViewRegistros_CellClick(object sender, DataGridViewCellEventArgs e) { this.ModoEdicionOff(); // Referenciar seleccion. int indiceSeleccion = dataGridViewRegistros.CurrentRow.Index; this.seleccion = registros[indiceSeleccion]; // Cargar datos de la seleccion. this.textBoxCodigo.Text = Convert.ToString(this.seleccion.Codigo); this.textBoxDescripcion.Text = this.seleccion.Descripcion.Trim(); }