Esempio n. 1
0
        private void LimpiarVista()
        {
            // Variables.
            this.registros = negocio.ListarTodos();
            this.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.textBoxCodigo.Enabled = false;
            this.textBoxDescripcion.Enabled = true;

            this.textBoxCodigo.Text = null;
            this.textBoxDescripcion.Text = null;

            // Operaciones.
            this.CargarCodigo();
            this.CargarRegistros(this.registros);
        }
Esempio n. 2
0
 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.Id);
     this.textBoxDescripcion.Text = this.seleccion.Descripcion.Trim();
 }
Esempio n. 3
0
        private void LimpiarVista()
        {
            // Variables.
            this.cursoRegistros = this.cursoNegocio.ListarTodos();
            this.deporteRegistros = this.deporteNegocio.ListarTodos();
            this.profesorRegistros = this.profesorNegocio.ListarTodos();
            this.cursoSeleccion = null;
            this.deporteSeleccion = null;
            this.profesorSeleccion = 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.textBoxCodigo.Enabled = false;
            this.textBoxNombre.Enabled = true;
            this.textBoxObservaciones.Enabled = true;
            this.textBoxDuracion.Enabled = true;
            this.dateTimePickerFechaInicio.Enabled = true;
            this.dateTimePickerFechaFin.Enabled = true;
            this.comboBoxDeporte.Enabled = true;
            this.comboBoxProfesor.Enabled = true;

            this.textBoxCodigo.Text = null;
            this.textBoxNombre.Text = null;
            this.textBoxObservaciones.Text = null;
            this.textBoxDuracion.Text = null;
            this.dateTimePickerFechaInicio.Value = DateTime.Now;
            this.dateTimePickerFechaFin.Value = DateTime.Now;

            // Operaciones.
            this.Curso_CargarCodigo();
            this.Curso_CargarRegistros(this.cursoRegistros);
            this.Deporte_CargarRegistros(this.deporteRegistros);
            this.Profesor_CargarRegistros(this.profesorRegistros);
        }
Esempio n. 4
0
        private void ModoBusquedaOn()
        {
            this.EstaBuscando = true;
            this.deporteSeleccion = null;
            this.profesorSeleccion = null;

            this.textBoxCodigo.Text = "-1";
            this.textBoxNombre.Text = null;
            this.textBoxObservaciones.Text = null;
            this.textBoxDuracion.Text = null;
            this.comboBoxDeporte.SelectedIndex = -1;
            this.comboBoxProfesor.SelectedIndex = -1;

            this.textBoxCodigo.Enabled = true;
            this.textBoxNombre.Enabled = true;
            this.textBoxObservaciones.Enabled = true;
            this.textBoxDuracion.Enabled = true;
            this.dateTimePickerFechaInicio.Enabled = false;
            this.dateTimePickerFechaFin.Enabled = false;
            this.comboBoxDeporte.Enabled = true;
            this.comboBoxProfesor.Enabled = true;

            this.buttonActualizar.Enabled = false;
            this.buttonEliminar.Enabled = false;
            this.buttonInsertar.Enabled = false;

            this.buttonSeleccionar.Text = "Buscar";
        }
Esempio n. 5
0
 private void comboBoxDeporte_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.comboBoxDeporte.SelectedIndex != -1)
     {
         this.deporteSeleccion = this.deporteRegistros[this.comboBoxDeporte.SelectedIndex];
     }
     else
     {
         this.deporteSeleccion = null;
     }
 }