Exemplo n.º 1
0
 private void metroButton3_Click(object sender, EventArgs e)
 {
     if (mgAlumno.CurrentRow.Cells[0].Value == null)
     {
         MetroMessageBox.Show(this, "Seleccione un maestro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         if (VerificarCamposMaestros())
         {
             Maestro persona = new Maestro();
             persona.nombre          = txtNombre.Text;
             persona.apellido        = txtApellido.Text;
             persona.direccion       = txtDireccion.Text;
             persona.DNI             = txtDNI.Text;
             persona.fechaNacimiento = txtFechaNacimiento.Value;
             persona.Id          = int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString());
             persona.tipoPersona = "Maestro";
             MaestroComponent personaComponent = new MaestroComponent();
             personaComponent.Update(persona);
             llenarGrillaMaestro();
         }
     }
 }