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"; textBoxCodigo.Enabled = false; textBoxApellido1.Enabled = true; textBoxApellido2.Enabled = true; textBoxNombres.Enabled = true; textBoxCi.Enabled = true; textBoxTelefono.Enabled = true; textBoxCodigo.Text = null; textBoxApellido1.Text = null; textBoxApellido2.Text = null; textBoxNombres.Text = null; textBoxCi.Text = null; textBoxTelefono.Text = null; // Operaciones. this.CargarCodigo(); this.CargarRegistros(this.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.Id); textBoxApellido1.Text = seleccion.Apellido1; textBoxApellido2.Text = seleccion.Apellido2; textBoxNombres.Text = seleccion.Nombres; textBoxCi.Text = seleccion.Ci; textBoxTelefono.Text = seleccion.Telefono; }
//Metodos public void Agregar(Entidades.Profesor pProfesor) { Datos.Profesor objProfesor = new Datos.Profesor(); objProfesor.Agregar(pProfesor); }
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"; }
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); }
private void comboBoxProfesor_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBoxProfesor.SelectedIndex != -1) { this.profesorSeleccion = this.profesorRegistros[this.comboBoxProfesor.SelectedIndex]; } else { this.profesorSeleccion = null; } }