protected override void tsbNuevo_Click(object sender, EventArgs e) { AlumnoDesktop formPersona = new AlumnoDesktop(ApplicationForm.ModoForm.Alta); formPersona.ShowDialog(); this.Listar(); }
private void tsbNuevo_Click(object sender, EventArgs e) { AlumnoDesktop formAlumno = new AlumnoDesktop(ApplicationForm.ModoForm.Alta); formAlumno.ShowDialog(); Listar(); }
public void AltaPersona() { AlumnoDesktop formAlumno = new AlumnoDesktop(ApplicationForm.ModoForm.Alta); formAlumno.btnAceptar.Text = "Guardar"; formAlumno.txtID.Enabled = false; formAlumno.ShowDialog(); }
private void tsEliminar_Click(object sender, EventArgs e) { int ID = ((Business.Entities.Persona) this.dgvAlumnos.SelectedRows[0].DataBoundItem).ID; AlumnoDesktop formAlumno = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Modificacion); formAlumno.GuardarCambios(); this.Listar(); }
private void tsbEliminar_Click(object sender, EventArgs e) { if (this.dgvAlumnos.SelectedRows != null && this.dgvAlumnos.SelectedRows.Count > 0) { int ID = ((Business.Entities.Alumno) this.dgvAlumnos.SelectedRows[0].DataBoundItem).ID; var nuevoAlumno = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Baja); nuevoAlumno.ShowDialog(); Listar(); } }
protected override void tsbEliminar_Click(object sender, EventArgs e) { if (this.dgvPersonas.SelectedRows.Count > 0) { int ID = Int32.Parse(((DataRowView)this.dgvPersonas.SelectedRows[0].DataBoundItem)["id_persona"].ToString()); AlumnoDesktop formAlumno = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Baja); formAlumno.ShowDialog(); this.Listar(); } else { MessageBox.Show("Seleccione un Alumno", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void tsbEliminar_Click(object sender, EventArgs e) { if (dgvAlumnos.SelectedRows.Count > 0) { int ID = ((Business.Entities.Personas) this.dgvAlumnos.SelectedRows[0].DataBoundItem).ID; AlumnoDesktop formAlumno = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Baja); formAlumno.ShowDialog(); this.Listar(); } else { MessageBox.Show("No hay elementos seleccionados", "Error", MessageBoxButtons.OK); } }
private void tsbEliminar_Click(object sender, EventArgs e) { int ID; if (this.dgvAlumnos.SelectedRows != null && this.dgvAlumnos.SelectedRows.Count == 1) { ID = ((Persona)this.dgvAlumnos.SelectedRows[0].DataBoundItem).ID; AlumnoDesktop formAlumno = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Baja); formAlumno.ShowDialog(); this.Listar(); } else { MessageBox.Show("Seleccione una fila para eliminar!", "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 tsbEditar_Click(object sender, EventArgs e) { if (base.ValidarDGV(dgvAlumnos)) { try { int ID = ((Business.Entities.Alumno) this.dgvAlumnos.SelectedRows[0].DataBoundItem).Id; AlumnoDesktop ad = new AlumnoDesktop(ID, ApplicationForm.ModoForm.Modificacion); ad.ShowDialog(); } catch (NotFoundException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CustomException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void tsbNuevo_Click(object sender, EventArgs e) { AlumnoDesktop formAlumno = new AlumnoDesktop(ApplicationForm.ModoForm.Alta); formAlumno.btnAceptar.Text = "Guardar"; formAlumno.txtID.Visible = false; formAlumno.ShowDialog(); this.Listar(); }