Пример #1
0
        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);
        }
Пример #2
0
 private void dataGridViewRegistros_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     this.ModoEdicionOff();
     // Referenciar seleccion.
     int indiceSeleccion = dataGridViewRegistros.CurrentRow.Index;
     this.area_Seleccion = area_Registros[indiceSeleccion];
     // Cargar datos de la seleccion.
     this.textBoxCodigo.Text = Convert.ToString(this.area_Seleccion.Id);
     this.textBoxDescripcion.Text = this.area_Seleccion.Descripcion.Trim();
     int indiceCombo = tipoArea_Registros.FindIndex(a => a.Codigo == this.area_Seleccion.IdTipoArea);
     this.comboBoxTipoArea.SelectedIndex = indiceCombo;
 }