/// <summary> /// Asigna los valores del grid que no están asociados a propiedades /// </summary> protected override void SetUnlinkedGridValues(string gridName) { switch (gridName) { case "Alumnos_Grid": { foreach (DataGridViewRow row in Alumnos_Grid.Rows) { if (row.IsNewRow) { continue; } Alumno_Parte info = (Alumno_Parte)row.DataBoundItem; if (info != null) { AlumnoInfo alumno = _alumnos.GetItem(info.OidAlumno); if (alumno != null) { row.Cells["Alumno"].Value = alumno.Apellidos + ", " + alumno.Nombre; row.Cells["Numero"].Value = alumno.NExpediente.ToString(); } } } } break; } }
protected override void SetUnlinkedGridValues(string gridName) { switch (gridName) { case "Examenes_Grid": { ExamenList examenes = ExamenList.GetList(false); foreach (DataGridViewRow row in Examenes_Grid.Rows) { if (row.IsNewRow) { continue; } Alumno_Examen info = (Alumno_Examen)row.DataBoundItem; if (info != null) { ExamenInfo examen = examenes.GetItem(info.OidExamen); if (examen != null) { row.Cells["Examen"].Value = examen.Titulo; if (info.Presentado) { if (examen.Desarrollo) { string calif = string.Empty; foreach (Respuesta_Alumno_Examen item in info.Respuestas) { if (calif != string.Empty) { calif += " - "; } calif += item.Calificacion.ToString() + "%"; } row.Cells["Calificacion"].Value = calif; } else { row.Cells["Calificacion"].Value = info.Calificacion.ToString(); } } else { row.Cells["Calificacion"].Value = "NP"; } } } } } break; case "Practicas_Grid": { //ClasePracticaList practicas = ClasePracticaList.GetList(); foreach (DataGridViewRow row in Practicas_Grid.Rows) { if (row.IsNewRow) { continue; } Alumno_Practica info = (Alumno_Practica)row.DataBoundItem; if (info != null) { if (info.Calificacion == Resources.Labels.NO_APTO_LABEL) { if (info.Falta) { info.Calificacion = Resources.Labels.FALTA_ASISTENCIA_LABEL; row.DefaultCellStyle = FaltaStyle; } else { row.DefaultCellStyle = NoAptaStyle; } } else { if (info.Calificacion == Resources.Labels.FALTA_ASISTENCIA_LABEL) { row.DefaultCellStyle = FaltaStyle; } else { if (info.Calificacion == Resources.Labels.APTO_LABEL) { row.DefaultCellStyle = AptaStyle; } } } } if (info.Recuperada) { row.DefaultCellStyle = AptaStyle; } } } break; case "Faltas_Grid": { ParteAsistenciaList partes = ParteAsistenciaList.GetList(false); foreach (DataGridViewRow row in Faltas_Grid.Rows) { if (row.IsNewRow) { continue; } Alumno_Parte info = (Alumno_Parte)row.DataBoundItem; if (info != null) { ParteAsistenciaInfo item = partes.GetItem(info.OidParte); if (item != null) { row.Cells["Clase"].Value = item.Texto; row.Cells["Fecha"].Value = item.Fecha; row.Cells["Hora"].Value = item.HoraInicio; } } } } break; } }