protected override void tsbNuevo_Click(object sender, EventArgs e) { DocenteDesktop formPersona = new DocenteDesktop(ApplicationForm.ModoForm.Alta); formPersona.ShowDialog(); this.Listar(); }
public void AltaPersona() { DocenteDesktop formDocente = new DocenteDesktop(ApplicationForm.ModoForm.Alta); formDocente.btnAceptar.Text = "Guardar"; formDocente.txtID.Enabled = false; formDocente.ShowDialog(); }
protected override void tsbEliminar_Click(object sender, EventArgs e) { if (this.dgvPersonas.SelectedRows.Count > 0) { int ID = ((Business.Entities.Persona) this.dgvPersonas.SelectedRows[0].DataBoundItem).ID; DocenteDesktop formPersona = new DocenteDesktop(ID, ApplicationForm.ModoForm.Baja); formPersona.ShowDialog(); this.Listar(); } else { MessageBox.Show("Seleccione un docente", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tsbEditar_Click(object sender, EventArgs e) { int ID; if (this.dgvDocentes.SelectedRows != null && this.dgvDocentes.SelectedRows.Count == 1) { ID = ((Persona)this.dgvDocentes.SelectedRows[0].DataBoundItem).ID; DocenteDesktop formDocente = new DocenteDesktop(ID, ApplicationForm.ModoForm.Modificacion); formDocente.ShowDialog(); this.Listar(); } else { MessageBox.Show("Seleccione una fila para editar!", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnAceptar_Click(object sender, EventArgs e) { if (Validar()) { if (comboTipoPersona.SelectedIndex == (int)Persona.TiposPersonas.Alumno) { AlumnoDesktop alu = new AlumnoDesktop(ApplicationForm.ModoForm.Alta); alu.btnAceptar.Text = "Guardar"; alu.ShowDialog(); this.Close(); } else if (comboTipoPersona.SelectedIndex == (int)Persona.TiposPersonas.Docente) { DocenteDesktop doc = new DocenteDesktop(ApplicationForm.ModoForm.Alta); doc.btnAceptar.Text = "Guardar"; doc.ShowDialog(); this.Close(); } } }
private void tsbNuevo_Click(object sender, EventArgs e) { DocenteDesktop formDocente = new DocenteDesktop(ApplicationForm.ModoForm.Alta); formDocente.btnAceptar.Text = "Guardar"; formDocente.txtID.Enabled = false; formDocente.ShowDialog(); this.Listar(); }