Exemplo n.º 1
0
 private void btnRegistrar_Click(object sender, EventArgs e)
 {
     try
     {
         int          id            = ((Persona)this.dgvDocentes.SelectedRows[0].DataBoundItem).ID;
         PersonaLogic pl            = new PersonaLogic();
         Persona      PersonaActual = pl.GetOne(id);
         CursoLogic   cl            = new CursoLogic();
         DataTable    comisiones    = cl.GetAllForPersona(PersonaActual.ID).Clone();
         foreach (DataRow row in cl.GetAllForPersona(PersonaActual.ID).Rows)
         {
             if ((int)row["cargo"] == 1)
             {
                 comisiones.ImportRow(row);
             }
         }
         if (comisiones.Rows.Count == 0)
         {
             this.Notificar("Advertencia", "No posee materias a su titularidad. No puede agregar notas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             RegistroNota form = new RegistroNota(PersonaActual, comisiones);
             form.ShowDialog();
             this.Listar();
         }
     }
     catch (Exception ex)
     {
         this.Notificar("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }