Exemplo n.º 1
0
        protected override void tsbNuevo_Click(object sender, EventArgs e)
        {
            AlumnoDesktop formPersona = new AlumnoDesktop(ApplicationForm.ModoForm.Alta);

            formPersona.ShowDialog();
            this.Listar();
        }
Exemplo n.º 2
0
        private void tsbNuevo_Click(object sender, EventArgs e)
        {
            AlumnoDesktop formAlumno = new AlumnoDesktop(ApplicationForm.ModoForm.Alta);

            formAlumno.ShowDialog();
            Listar();
        }
Exemplo n.º 3
0
 public void AltaPersona()
 {
     AlumnoDesktop formAlumno = new AlumnoDesktop(ApplicationForm.ModoForm.Alta);
     formAlumno.btnAceptar.Text = "Guardar";
     formAlumno.txtID.Enabled = false;
     formAlumno.ShowDialog();
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 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();
     }
 }
Exemplo n.º 6
0
 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);
     }
 }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
 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();
         }
     }
 }
Exemplo n.º 10
0
 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);
         }
     }
 }
Exemplo n.º 11
0
 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();
 }