//.========================================
        public List<reportesDTO.reporteDTOConsolidado> c_reporteConsolidado(string idGrupo)
        {
            directores_g direT = bd.directores_g.Where(t => t.id_grupo == idGrupo).FirstOrDefault();
            List<reportesDTO.reporteDTOConsolidado> Lista = new List<reportesDTO.reporteDTOConsolidado>();
            List<notas> Notas = bd.notas.Where(t => t.id_grupo == idGrupo).OrderByDescending(t => t.personas.apellidos).ToList();
            foreach (notas item in Notas) //  CHEQUEO LOS ESTUDIANTE PARA ARMAR SU BOLETIN....
            {
                reportesDTO.reporteDTOConsolidado Obj = new reportesDTO.reporteDTOConsolidado();
                if (direT != null)
                {
                    Obj.idProfe = direT.personas.id.ToString();
                    Obj.apellidosProfe = direT.personas.apellidos.ToString();
                    Obj.nombresProfe = direT.personas.nombres.ToString();
                }
                else
                {
                    Obj.idProfe = "";
                    Obj.apellidosProfe = "NO ASIGNADO";
                    Obj.nombresProfe = "";
                }
                // VALIDAMOS LA NOTA PARA CABIARLA AL FORMATO QUE ACEPTA EL INFORME PARA LOS COLORES
                Obj.nota = item.nota.ToString();
                if (Obj.nota == null)
                {
                    Obj.nota = "0";
                }

                else if (Obj.nota == "100")
                {
                    Obj.nota = "100";
                }

                 string superar = item.nota_s.ToString();
                 if (superar == "0")//Quiere decir que NO hay superacion y configuramos con la nota principal
                 {
                     Obj.nota = Obj.nota;
                 }
                 else //Quiere decir que SI hay superacion y configuramos con la nota superada
                 {
                     Obj.nota = superar;
                 }

                Obj.idEst = item.personas.id.ToString();
                Obj.nombresEst = item.personas.nombres.ToString();
                Obj.apellidosEst = item.personas.apellidos.ToString();
                Obj.asignatura = item.asignatura.nombre.ToString();
                Obj.periodo = item.id_periodo.ToString();

                Obj.ano = item.grupos.año.ToString();
                Obj.idGrupo = item.grupos.id_grupo.ToString();
                Obj.idGrado = item.grupos.grados.nom_grado.ToString();

                Lista.Add(Obj);
            }
            return Lista;
        }
Example #2
0
        public List<reportesDTO.reporteDTOConsolidado> c_reporteConsolidado(string idGrupo)
        {
            directores_g direT = bd.directores_g.Where(t => t.id_grupo == idGrupo).FirstOrDefault();
            List<reportesDTO.reporteDTOConsolidado> Lista = new List<reportesDTO.reporteDTOConsolidado>();
            List<notas> Notas = bd.notas.Where(t => t.id_grupo == idGrupo).OrderByDescending(t => t.personas.apellidos).ToList();
            foreach (notas item in Notas) 
            {
                reportesDTO.reporteDTOConsolidado Obj = new reportesDTO.reporteDTOConsolidado();
                if (direT != null)
                {
                    Obj.idProfe = direT.personas.id.ToString();
                    Obj.apellidosProfe = direT.personas.apellidos.ToString();
                    Obj.nombresProfe = direT.personas.nombres.ToString();
                }
                else
                {
                    Obj.idProfe = "";
                    Obj.apellidosProfe = "NO ASIGNADO";
                    Obj.nombresProfe = "";
                }
                Obj.nota = item.nota.ToString();
                if (Obj.nota == null)
                
                    Obj.nota = "0";

                else if (Obj.nota == "100")
                    Obj.nota = "100";

                string superar = item.nota_s.ToString();
                if (superar == "0")
                    Obj.nota = Obj.nota;
                else 
                    Obj.nota = superar;
                Obj.idEst = item.personas.id.ToString();
                Obj.nombresEst = item.personas.nombres.ToString();
                Obj.apellidosEst = item.personas.apellidos.ToString();
                Obj.asignatura = item.asignatura.nombre.ToString();
                Obj.periodo = item.id_periodo.ToString();

                Obj.ano = item.grupos.año.ToString();
                Obj.idGrupo = item.grupos.id_grupo.ToString();
                Obj.idGrado = item.grupos.grados.nom_grado.ToString();
                Lista.Add(Obj);
            }
            return Lista;
        }