Example #1
0
 public static string SELECT(Alumno_ExamenInfo item)
 {
     return(Respuesta_Alumno_Examen.SELECT(new QueryConditions()
     {
         Alumno_Examen = item
     }, false));
 }
Example #2
0
        public void CopyValues(Alumno_ExamenInfo source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);
        }
        public static string SELECT_BY_ALUMNO_EXAMEN(long oid_alumno_examen)
        {
            QueryConditions conditions = new QueryConditions()
            {
                Alumno_Examen = Alumno_ExamenInfo.New()
            };

            conditions.Alumno_Examen.Oid = oid_alumno_examen;

            return(Respuesta_Alumno_Examen.SELECT(conditions, true));
        }
        public RegistroNotasExamenRpt GetDetailReport(ExamenInfo item,
                                                      List <Alumno_ExamenInfo> _alumnos,
                                                      PromocionInfo promocion,
                                                      CompanyInfo empresa)
        {
            if (item == null)
            {
                return(null);
            }
            RegistroNotasExamenRpt doc = new RegistroNotasExamenRpt();
            string     comentarios     = string.Empty;
            AlumnoList lista           = AlumnoList.GetOrdenAlfabeticoList(true, _alumnos);

            List <ExamenPrint>        pList   = new List <ExamenPrint>();
            List <Alumno_ExamenPrint> alumnos = new List <Alumno_ExamenPrint>();

            int i = 1;

            foreach (AlumnoInfo alumno in lista)
            {
                Alumno_ExamenInfo info = null;
                foreach (Alumno_ExamenInfo ae in _alumnos)
                {
                    if (ae.OidAlumno == alumno.Oid)
                    {
                        info = ae;
                        break;
                    }
                }

                if (info != null)
                {
                    Alumno_ExamenPrint obj = info.GetPrintObject(alumno, i++, true);

                    if (item.Desarrollo && info.Presentado)
                    {
                        obj.NotaTest = string.Empty;
                        foreach (Respuesta_Alumno_ExamenInfo resp in info.Respuestas)
                        {
                            if (obj.NotaTest.Length > 0)
                            {
                                obj.NotaTest += " - ";
                            }
                            obj.NotaTest += resp.Calificacion.ToString() + "%";
                        }
                    }

                    alumnos.Add(obj);
                    if (info.Observaciones != string.Empty)
                    {
                        comentarios += alumno.NExpediente + " - " + alumno.Nombre + " " + alumno.Apellidos + " - " + info.Observaciones + Environment.NewLine;
                    }
                }
            }

            //foreach (Alumno_ExamenInfo info in _alumnos)
            //{
            //    AlumnoInfo alumno = lista.GetItem(info.OidAlumno);
            //    Alumno_ExamenPrint obj = info.GetPrintObject(alumno, i++, true);

            //    if (item.Desarrollo && info.Presentado)
            //    {
            //        obj.NotaTest = string.Empty;
            //        foreach (Respuesta_Alumno_ExamenInfo resp in info.Respuestas)
            //        {
            //            if (obj.NotaTest.Length > 0)
            //                obj.NotaTest += " - ";
            //            obj.NotaTest += resp.Calificacion.ToString() + "%";
            //        }
            //    }

            //    alumnos.Add(obj);
            //    if (info.Observaciones != string.Empty)
            //        comentarios += alumno.NExpediente + " - " + alumno.Nombre + " " + alumno.Apellidos  + " - " + info.Observaciones + Environment.NewLine;
            //}

            pList.Add(item.GetPrintObject(empresa, promocion.Nombre, comentarios));

            //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports
            if (alumnos.Count <= 0)
            {
                return(null);
            }

            doc.SetDataSource(pList);
            doc.Subreports["NotasExamenAlumnosListSubRpt"].SetDataSource(alumnos);

            return(doc);
        }
        /// <summary>
        /// Copia los atributos del objeto
        /// </summary>
        /// <param name="source">Objeto origen</param>
        protected void CopyValues(Alumno_ExamenInfo source, AlumnoInfo alumno, int numero, bool nota)
        {
            if (source == null)
            {
                return;
            }

            Oid = source.Oid;
            _base.Record.OidAlumno     = source.OidAlumno;
            _base.Record.OidExamen     = source.OidExamen;
            _base.Record.Observaciones = source.Observaciones;
            _numero = numero.ToString();
            _base.Record.Calificacion = source.Calificacion;
            _base.Record.Presentado   = source.Presentado;

            _base.OidPromocion = source.OidPromocion;
            if (!_base.Record.Presentado)
            {
                _nota_test = "NP";
            }
            else
            {
                _nota_test = source.Calificacion.ToString() + "%";
            }

            //AlumnoInfo alumno = AlumnoInfo.Get(_oid_alumno, true);
            if (alumno != null)
            {
                _nombre = alumno.Apellidos + ", " + alumno.Nombre;
                _dni    = alumno.Id;

                if (nota)
                {
                    //ExamenList examenes = ExamenList.GetList(false);
                    //ExamenInfo examen = examenes.GetItem(_oid_examen);
                    //if (examen.Desarrollo)
                    //{
                    //    _nota_desarrollo = _calificacion.ToString();
                    //    foreach (ExamenInfo info in examenes)
                    //    {
                    //        if (!info.Desarrollo
                    //            && info.OidModulo == examen.OidModulo
                    //            && info.FechaExamen.ToShortDateString().Equals(examen.FechaExamen.ToShortDateString())
                    //            && info.OidPromocion == examen.OidPromocion)
                    //        {
                    //            Alumno_ExamenList notas = alumno.AlumnoExamens;

                    //            foreach (Alumno_ExamenInfo exam in notas)
                    //            {
                    //                if (exam.OidExamen == info.Oid)
                    //                    _nota_test = exam.Calificacion.ToString();
                    //            }
                    //            break;
                    //        }
                    //    }
                    //}
                    //else
                    //{
                    //    _nota_test = _calificacion.ToString();
                    //    foreach (ExamenInfo info in examenes)
                    //    {
                    //        if (info.Desarrollo
                    //            && info.OidModulo == examen.OidModulo
                    //            && info.FechaExamen.ToShortDateString().Equals(examen.FechaExamen.ToShortDateString())
                    //            && info.OidPromocion == examen.OidPromocion)
                    //        {
                    //            Alumno_ExamenList notas = alumno.AlumnoExamens;

                    //            foreach (Alumno_ExamenInfo exam in notas)
                    //            {
                    //                if (exam.OidExamen == info.Oid)
                    //                    _nota_desarrollo = exam.Calificacion.ToString();
                    //            }

                    //            break;
                    //        }
                    //    }
                    //}
                }
            }
        }