Beispiel #1
0
        public string m_report(reportesDTO.reportess m)
        {
            try
            {
                reportes n = bd.reportes.Where(t =>
                t.id_grupo == m.id_grupo &&
                t.id_estudiante == m.id_estudiante &&
                t.id_periodo == m.id_periodo
                ).FirstOrDefault();
                if (n != null)
                {
                    DateTime dptBitacora;
                    dptBitacora = DateTime.Now;
                    n.observacion = m.observacion;
                    n.fecha = dptBitacora;
                    if (m.acceso == true)
                        n.acceso = "TRUE";
                    else
                        n.acceso = "FALSE";
                    n.notificacion = m.notificacion;
                    n.observacion = m.observacion;

                    bd.SaveChanges();
                    return "¡Se modificó el reporte exitosamente!";
                }
                else { return null; }
            }
            catch (Exception)
            {
                return null; ;
            }
        }
        public List<reportesDTO.reporteDTOFin> cg_boletinXestudianteFinal(reportesDTO.reportess dto, bitacorasDTO dtob)
        {
            try
            {

            List<reportesDTO.reporteDTOFin> m = BLL.cg_boletinXestudianteFinal(dto.id_estudiante, dto.id_periodo, dto.id_grupo, dto.observacion);
            string b = null;
            foreach (reportesDTO.reporteDTOFin item in m)
            {
                b = item.resultado;
            }
            if (b != null)
            {
                if (b != "El reporte que esta solicitando no esta habilitado por el colegio. Contactese con la administración de la institución.")
                {
                    if (b != "c_no")
                    {
                        if (b != "Este reporte que solicita no ha sido generado por la administración.")
                        {
                            BLLB.r_bitacora(dtob);
                            Session["id_estudiante"] = dto.id_estudiante;
                            Session["id_grupo"] = dto.id_grupo;
                            Session["id_periodo"] = dto.id_periodo;
                            Session["observacion"] = dto.observacion;
                        }
                    }
                }
            }
            return m;
             }
            catch (Exception)
            {
                return null;
            }
        }
Beispiel #3
0
 public string r_report(reportesDTO.reportess n)
 {
     try
     {
         string m = verificar_registro(n.id_estudiante, n.id_grupo, n.id_periodo);
         if (m == "0")
         {
             DateTime dptBitacora;
             dptBitacora = DateTime.Now;
             reportes no = new reportes();
             no.id_estudiante = n.id_estudiante.ToString();
             no.id_grupo = n.id_grupo;
             no.id_periodo = n.id_periodo;
             no.observacion = n.observacion;
             no.fecha = dptBitacora;
             if (n.acceso == true)
                 no.acceso = "TRUE";
             else
                 no.acceso = "FALSE";
             no.notificacion = "PENDIENTE";
             bd.reportes.Add(no);
             return "¡Se agregó el reporte exitosamente!";
         }
         else
             return "¡Error de congruencia de datos. Recuerde que usted no puede generar el boletin al mismo estudiante en el mismo periodo y grupo <strong>dos veces</strong>. Revise!";
     }
     catch (Exception e)
     {
         string m = e.Message.ToString();
         if (m.StartsWith("Se produjo un error mientras se actualizaban las entradas.") || m.StartsWith("Error al actualizar las entradas. Vea la excepción interna para obtener detalles."))
         { return "Lo sentimos. Reintene nuevamente. Tuvimos  problemas a intentar agregarle un referencia a este registro."; }
         else
         { return null; }
     }
 }
 //----------------------------------------------------------------------
 public List<reportesDTO.reportesG> cg_reporteGrupo(reportesDTO.reportesDTOG dto)
 {
     reportesDTO.reportess ds = new reportesDTO.reportess();
         ds.id_grupo = dto.id_grupo.ToString();
         ds.id_periodo = dto.id_periodo.ToString();
         List<reportesDTO.reportesG>  var = r.cg_reporteGrupo(ds);
     if (var != null)
     {
         return var;
     }
     else { return null; }
 }
 public string e_report(reportesDTO.reportess m)
 {
     try
     {
         reportes n = bd.reportes.Where(t =>
         t.id_grupo == m.id_grupo &&
         t.id_estudiante == m.id_estudiante &&
         t.id_periodo == m.id_periodo
         ).FirstOrDefault();
         if (n != null)
         {
             bd.reportes.Remove(n);
             bd.SaveChanges();
             return "¡Eliminación exitosa!";
         }
         else { return null; }
     }
     catch (Exception)
     {
         return null; ;
     }
 }
 public string eg_reporteGrupo(reportesDTO.reportesDTOG dto)
 {
     string var = null;
     List<reportesDTO.reportesG> NRows = dto.rows;
     List<reportesDTO.reportess> lst = new List<reportesDTO.reportess>();
     foreach (reportesDTO.reportesG item in dto.rows)
     {
         reportesDTO.reportess ds = new reportesDTO.reportess();
         ds.id_estudiante = item.id_estudiante.ToString();
         ds.id_grupo = dto.id_grupo.ToString();
         ds.id_periodo = dto.id_periodo.ToString();
         ds.observacion = "";
         ds.fecha = "";
         ds.acceso = item.acceso;
         ds.notificacion = item.notificacion;
         lst.Add(ds);
     }
     var = r.eg_reporteGrupo(lst);
     if (var != null)
     {
         return var;
     }
     else { return "Problemas al registar este grupo en el Servidor: Contactese con el Administrador"; }
 }
        public List<reportesDTO.reportesG> cg_reporteGrupo(reportesDTO.reportess m)
        {
            try
            {
                List<reportesDTO.reportesG> v = new List<reportesDTO.reportesG>();
                // Si retorna DIFERENTE DE NULL quiere decir que si hay para este grupo y periodo 
                //  Por tanto devolvemos uno listo para MODIFICAR o ELIMINAR.
                v = verificarGrupo(m);
                if (v != null)
                {
                    return v;// si retorna quiere decir que ya hay reportes asignados.
                }
                else // Si retorna NULL  quiere decir que no hay para este grupo y periodo 
                //  Por tanto devolvemos uno listo para REGISTRAR.
                {
                    List<matricula2> n = null;
                    n = bd.matricula2.Where(t => t.id_grupo == m.id_grupo).ToList();
                    List<reportesDTO.reportesG> d = new List<reportesDTO.reportesG>();
                    foreach (matricula2 item in n)
                    {
                        reportesDTO.reportesG no = new reportesDTO.reportesG();
                        no.id_estudiante = item.id_estudiante.ToString(); // OJO QUE NO SEA QUE DEVUELVA ES EL PROGESOR
                        no.apellidos = item.personas1.apellidos.ToString();
                        no.nombres = item.personas1.nombres.ToString();
                        no.acceso = false;
                        no.notificacion = "PENDIENTE";
                        no.uid = "NUEVO_REGISTRO";
                        d.Add(no);
                    }
                    if (d.Count != 0)
                    {
                        d = d.OrderBy(p => p.apellidos).ToList();
                        return d;
                    }
                    else
                    {
                        return null;
                    }
                }
            }
            catch
            {
                return null;
            }

        }
        //_--------------------------------------------------------------------
        public List<reportesDTO.reportesG> verificarGrupo(reportesDTO.reportess m)
        {
            try
            {
                List<reportes> n = bd.reportes.Where(t =>
                 t.id_grupo == m.id_grupo &&
                 t.id_periodo == m.id_periodo
                 ).ToList();
                if (n.Count != 0)
                {

                    // QUIERE DECIR ENTONCES QUE SI HAY REGISTROS EN REPORTES
                    List<reportesDTO.reportesG> y = new List<reportesDTO.reportesG>();
                    foreach (reportes item in n)
                    {
                        reportesDTO.reportesG no = new reportesDTO.reportesG();
                        no.id_estudiante = item.id_estudiante.ToString(); // OJO QUE NO SEA QUE DEVUELVA ES EL PROGESOR
                        no.apellidos = item.personas.apellidos.ToString();
                        no.nombres = item.personas.nombres.ToString();
                        if (item.acceso.ToString() == "TRUE")
                        {
                            no.acceso = true;
                        }
                        else if (item.acceso.ToString() == "FALSE")
                        {
                            no.acceso = false;
                        }
                        no.notificacion = item.notificacion;
                        no.uid = "LISTO_PARA_MODIFICAR";
                        y.Add(no);
                    }
                    y = y.OrderBy(t => t.apellidos).ToList();
                    return y;
                }
                else
                {
                    // SINO ENTONCES, NO HAY REGISTROS
                    return null;
                }
            }
            catch
            {
                { return null; }
            }
        }
        public string rg_reporteGrupo(reportesDTO.reportesDTOG dto, bitacorasDTO dtob)
        {
            try{
            string m = BLL.rg_reporteGrupo(dto);
            if (m != null)
            {
                if (m != "Lo sentimos. Tuvimos problemas para procesar este grupo. Al parecer no envió los datos correctos. Revise y reintente. ")
                {
                    if (m != "Datos enviados, pero al parecer existe en estudiante en este grupo al cual ya se le ha generado el reporte. Para este grupo y periodo.")
                    {
                        BLLB.r_bitacora(dtob);
                    }
                }
            }
            return m;
             }
            catch (Exception)
            {
                return null;

            }
        }
 private static void llenarObjetoG(List<reportesDTO.reporteDTOFin> Boletin, List<reportesDTO.b_BodyFin> Body, reportesDTO.b_headFin Head)
 {
     foreach (reportesDTO.b_BodyFin item2 in Body)
     {
         reportesDTO.reporteDTOFin Bmmk = new reportesDTO.reporteDTOFin();
         Bmmk.id = Head.id;
         Bmmk.estudiante = Head.estudiante;
         Bmmk.ano = Head.ano;
         Bmmk.grado = Head.grado;
         Bmmk.periodo = Head.periodo;
         Bmmk.rango = Head.rango;
         Bmmk.grupo = Head.grupo;
         Bmmk.notaPromV = Head.notaPromV;
         Bmmk.equiPromV = Head.equiPromV;
         Bmmk.puesto = Head.puesto;
         //b_head
         Bmmk.area = item2.area;
         Bmmk.asig = item2.asig;
         Bmmk.ih = item2.ih;
         Bmmk.logro = item2.logro;
         Bmmk.equiv = item2.equiv;
         Bmmk.I = item2.I;
         Bmmk.II = item2.II;
         Bmmk.III = item2.III;
         Bmmk.IV = item2.IV;
         Bmmk.notaV = item2.notaV;
         Bmmk.resultado = "c_yes";
         Boletin.Add(Bmmk);
     }
 }
        public reportesDTO.reporteDTOConsta cg_constanciaXestud(reportesDTO.reportess dto, bitacorasDTO dtob)
        {
            try{
            reportesDTO.reporteDTOConsta m = BLL.cg_constanciaXestud(dto.id_estudiante, dto.id_grupo);

            if (m != null)
            {
                Session["id_estudiante"] = dto.id_estudiante;
                Session["id_grupo"] = dto.id_grupo;
                BLLB.r_bitacora(dtob);
            }
            return m;
             }
            catch (Exception)
            {
                return null;

            }
        }
 public string cg_boletinXgrupo(reportesDTO.reportesGrupal dto, bitacorasDTO dtob)
 {
     try
     {
         Session["id_grupo"] = dto.id_grupo;
         Session["id_periodo"] = dto.id_periodo;
         Session["observacion"] = "NA";
         BLLB.r_bitacora(dtob);
         return "c_yes";
     }
     catch (Exception)
     {
         return null;
     }
 }
Beispiel #13
0
 public List<reportesDTO.reportesG> cg_reporteGrupo(reportesDTO.reportess m)
 {
     try
     {
         List<reportesDTO.reportesG> v = new List<reportesDTO.reportesG>();
         v = verificarGrupo(m);
         if (v != null)
             return v;
         else 
         {
             List<matricula2> n = null;
             n = bd.matricula2.Where(t => t.id_grupo == m.id_grupo).ToList();
             List<reportesDTO.reportesG> d = new List<reportesDTO.reportesG>();
             foreach (matricula2 item in n)
             {
                 reportesDTO.reportesG no = new reportesDTO.reportesG();
                 no.id_estudiante = item.id_estudiante.ToString(); 
                 no.apellidos = item.personas1.apellidos.ToString();
                 no.nombres = item.personas1.nombres.ToString();
                 no.acceso = false;
                 no.notificacion = "PENDIENTE";
                 no.uid = "NUEVO_REGISTRO";
                 d.Add(no);
             }
             if (d.Count != 0)
             {
                 d = d.OrderBy(p => p.apellidos).ToList();
                 return d;
             }
             else
                 return null;
         }
     }
     catch
     {
         return null;
     }
 }
Beispiel #14
0
 public List<reportesDTO.reportesG> verificarGrupo(reportesDTO.reportess m)
 {
     try
     {
         List<reportes> n = bd.reportes.Where(t =>
          t.id_grupo == m.id_grupo &&
          t.id_periodo == m.id_periodo
          ).ToList();
         if (n.Count != 0)
         {
             List<reportesDTO.reportesG> y = new List<reportesDTO.reportesG>();
             foreach (reportes item in n)
             {
                 reportesDTO.reportesG no = new reportesDTO.reportesG();
                 no.id_estudiante = item.id_estudiante.ToString(); 
                 no.apellidos = item.personas.apellidos.ToString();
                 no.nombres = item.personas.nombres.ToString();
                 if (item.acceso.ToString() == "TRUE")
                     no.acceso = true;
                 else if (item.acceso.ToString() == "FALSE")
                     no.acceso = false;
                 no.notificacion = item.notificacion;
                 no.uid = "LISTO_PARA_MODIFICAR";
                 y.Add(no);
             }
             y = y.OrderBy(t => t.apellidos).ToList();
             return y;
         }
         else
             return null;
     }
     catch
     {
         { return null; }
     }
 }
        //-----------------------------------------------------------------------------------------------------------------
        private int estruturaBoletinI(string idPeriodo, string idGrupo, matricula2 item, List<reportesDTO.b_Body> Body, reportesDTO.b_Head Head, int b, matricula1 item2, string eitem, string aitem2)
        {
            reportesDTO.b_Body BodyObj = new reportesDTO.b_Body();
            notas N = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                    t.id_periodo == idPeriodo && t.id_asignatura == aitem2).FirstOrDefault();
            if (b == 0)
            {
                Head.estudiante = item.personas1.apellidos.ToString() + " " + item.personas1.nombres.ToString();
                Head.ano = item2.grupos.año.ToString();
                Head.grado = item2.grupos.grados.nom_grado.ToString();
                Head.grupo = item2.id_grupo.ToString();
                Head.id = item.id_estudiante.ToString();
                Head.periodo = idPeriodo;
                periodos P = bd.periodos.Where(t => t.id == idPeriodo).FirstOrDefault();
                Head.rango = P.rangoI + "-" + P.rangoF;
                b = 1;
            }
            if (N != null) // registramos como 0  si no hay nada
            {
                BodyObj.area = item2.asignatura.area.ToString();
                BodyObj.asig = item2.asignatura.nombre.ToString();
                BodyObj.ih = item2.asignatura.horas.ToString();
                BodyObj.logro = N.logros.descripcion.ToString();
            }
            else
            {
                BodyObj.area = item2.asignatura.area.ToString();
                BodyObj.asig = item2.asignatura.nombre.ToString();
                BodyObj.ih = item2.asignatura.horas.ToString();
                BodyObj.logro = "Sin asignar.";
            }
            if (N == null) // registramos como 0  si no hay nada
            { BodyObj.nota = 0; }
            else
            {
                BodyObj.nota = AjustarNenEnEnteros(N.nota_s.ToString());
                if (BodyObj.nota == 0)//Quiere decir que NO hay superacion y configuramos con la nota principal
                {
                    BodyObj.nota = AjustarNenEnEnteros(N.nota.ToString());
                }
                else //Quiere decir que SI hay superacion y configuramos con la nota superada
                {
                    BodyObj.nota = AjustarNenEnEnteros(N.nota_s.ToString());
                }
            }

            BodyObj.equival = validarEquivalenciaSimpleEnEnt(Convert.ToString(BodyObj.nota));
            Body.Add(BodyObj);
            return b;
        }
        private static void llenarObjetoI(List<reportesDTO.reporteDTOPeriodo> Boletin, List<reportesDTO.b_Body> Body, reportesDTO.b_Head Head)
        {

            foreach (reportesDTO.b_Body item3 in Body)
            {
                reportesDTO.reporteDTOPeriodo Bmmk = new reportesDTO.reporteDTOPeriodo();
                Bmmk.id = Head.id;
                Bmmk.estudiante = Head.estudiante;
                Bmmk.ano = Head.ano;
                Bmmk.grado = Head.grado;
                Bmmk.periodo = Head.periodo;
                Bmmk.rango = Head.rango;
                Bmmk.grupo = Head.grupo;

                Bmmk.equi_prom = Head.equi_prom;
                Bmmk.nota_prom = Head.nota_prom;
                Bmmk.puesto = Head.puesto;

                Bmmk.area = item3.area;
                Bmmk.asig = item3.asig;

                Bmmk.ih = item3.ih;
                Bmmk.nota = item3.nota;
                Bmmk.equival = item3.equival;
                Bmmk.logro = item3.logro;
                Bmmk.resultado = "c_yes";
                Boletin.Add(Bmmk);
            }
        }
        public reportesDTO.reporteDTOConstaF cg_constanciaXfamily(reportesDTO.reporteConstaFamily dto, bitacorasDTO dtob)
        {
            try{
            reportesDTO.reporteDTOConstaF m = BLL.cg_constanciaXfamily(dto.id_estudiante, dto.id_grupo, dto.mes1, dto.mes2);
            if (m != null)
            {
                Session["id_estudiante"] = dto.id_estudiante;
                Session["id_grupo"] = dto.id_grupo;
                Session["mes1"] = dto.mes1;
                Session["mes2"] = dto.mes2;
                BLLB.r_bitacora(dtob);
            }
            return m;
             }
            catch (Exception)
            {
                return null;

            }
        }
        private void estructuraBoletinG(string idGrupo, List<matricula1> kk, matricula2 item, ref int conta, ref float nota_prom, List<reportesDTO.b_BodyFin> Body, reportesDTO.b_headFin Head, ref int b)
        {
            string[] Ano = idGrupo.Split('-');
            string ano = Ano[0];
            foreach (matricula1 item2 in kk) // CHEQUEO LAS ASIGNATURAS QUE CONTIENE EL GRUPO
            {
                reportesDTO.b_BodyFin BodyObj = new reportesDTO.b_BodyFin();
                // AHOR PROCESAMOS LOS ACOMULADOS DE ACURDO A LAS NOTAS ANTERIORES
                //Y EL CUERPO DEL BOLETIN DE ACUERDO A LAS MATERIAS QUE HAY EN EL GRUPO
                string eitem = item.id_estudiante.ToString();
                string aitem2 = item2.id_asignatura.ToString();
                notas N = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                  t.id_periodo == (ano +"-"+"V") && t.id_asignatura == aitem2).FirstOrDefault();
                if (b == 0)
                {
                    Head.estudiante = item.personas1.apellidos.ToString() + " " + item.personas1.nombres.ToString();
                    Head.ano = item2.grupos.año.ToString();
                    Head.grado = item2.grupos.grados.nom_grado.ToString();
                    Head.grupo = item2.id_grupo.ToString();
                    Head.id = item.id_estudiante.ToString();
                    Head.periodo = "FINAL";
                    //periodos P = bd.periodos.Where(t => t.id == idPeriodo).FirstOrDefault();
                    //Head.rango = P.rangoI + "-" + P.rangoF;
                    Head.rango = "RESUMEN FINAL";
                    b = 1;
                }

                if (N != null) // registramos como 0  si no hay nada
                {
                    BodyObj.area = item2.asignatura.area.ToString();
                    BodyObj.asig = item2.asignatura.nombre.ToString();
                    BodyObj.ih = item2.asignatura.horas.ToString();
                    BodyObj.logro = N.logros.descripcion.ToString();
                }
                else
                {
                    BodyObj.area = item2.asignatura.area.ToString();
                    BodyObj.asig = item2.asignatura.nombre.ToString();
                    BodyObj.ih = item2.asignatura.horas.ToString();
                    BodyObj.logro = "Sin asignar.";
                }

                notas NI = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                          t.id_periodo == (ano +"-"+"I") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NII = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo ==  (ano +"-"+"II") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NIII = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo ==  (ano +"-"+"III") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NIV = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo ==  (ano +"-"+"IV") && t.id_asignatura == aitem2).FirstOrDefault();

                if (NI == null) // registramos como 0  si no hay nada
                { BodyObj.I = 0; }
                else
                {
                    BodyObj.I = AjustarNenEnEnteros(NI.nota_s.ToString());
                    if (BodyObj.I == 0)//Quiere decir que NO hay superacion y configuramos con la nota principal
                    {
                        BodyObj.I = AjustarNenEnEnteros(NI.nota.ToString());
                    }
                    else //Quiere decir que SI hay superacion y configuramos con la nota superada
                    {
                        BodyObj.I = AjustarNenEnEnteros(NI.nota_s.ToString());
                    }
                }

                if (NII == null) // registramos como 0  si no hay nada
                { BodyObj.II = 0; }
                else
                {
                    BodyObj.II = AjustarNenEnEnteros(NII.nota_s.ToString());
                    if (BodyObj.II == 0)//Quiere decir que NO hay superacion y configuramos con la nota principal
                    {
                        BodyObj.II = AjustarNenEnEnteros(NII.nota.ToString());
                    }
                    else //Quiere decir que SI hay superacion y configuramos con la nota superada
                    {
                        BodyObj.II = AjustarNenEnEnteros(NII.nota_s.ToString());
                    }
                }


                if (NIII == null) // registramos como 0  si no hay nada
                { BodyObj.III = 0; }
                else
                {
                    BodyObj.III = AjustarNenEnEnteros(NIII.nota_s.ToString());
                    if (BodyObj.III == 0)//Quiere decir que NO hay superacion y configuramos con la nota principal
                    {
                        BodyObj.III = AjustarNenEnEnteros(NIII.nota.ToString());
                    }
                    else //Quiere decir que SI hay superacion y configuramos con la nota superada
                    {
                        BodyObj.III = AjustarNenEnEnteros(NIII.nota_s.ToString());
                    }
                }

                if (NIV == null) // registramos como 0  si no hay nada
                { BodyObj.IV = 0; }
               else
                {
                    BodyObj.IV = AjustarNenEnEnteros(NIV.nota_s.ToString());
                    if (BodyObj.IV == 0)//Quiere decir que NO hay superacion y configuramos con la nota principal
                    {
                        BodyObj.IV = AjustarNenEnEnteros(NIV.nota.ToString());
                    }
                    else //Quiere decir que SI hay superacion y configuramos con la nota superada
                    {
                        BodyObj.IV = AjustarNenEnEnteros(NIV.nota_s.ToString());
                    }
                }

                int i = BodyObj.I;
                int ii = BodyObj.II;
                int iii = BodyObj.III;
                int iv = BodyObj.IV;

                float v = (i + ii + iii + iv) / 4; // Esta seria la nota promedio de CADA asignatura en el periodo V
                decimal vv = Math.Round((decimal)v, 1);
                BodyObj.notaV = vv;
                //string i = Convert.();

                nota_prom = v + nota_prom; // Esta seria la nota final del estudiante para sus asignaturas en todo el periodp V
                BodyObj.equiv = validarEquivalenciaSimpleEnEnt(Convert.ToString(BodyObj.notaV)); // esta seria la equivalencia para el promedio del V general
                Body.Add(BodyObj);
                conta++;
            }
        }
        public string eg_reporteGrupo(reportesDTO.reportesDTOG dto, bitacorasDTO dtob)
        {
            try{
            string m = BLL.eg_reporteGrupo(dto);
            if (m != null)
            {
                BLLB.r_bitacora(dtob);
            }
            return m;
             }
            catch (Exception)
            {
                return null;

            }
        }
        public string mg_reporteGrupo(reportesDTO.reportesDTOG dto, bitacorasDTO dtob)
        {
            try{
            string m = BLL.mg_reporteGrupo(dto);
            if (m != null)
            {
                if (m != "Lo sentimos. Tuvimos problemas para procesar este grupo. Al parecer no envió los datos correctos. Revise y reintente. ")
                {
                        BLLB.r_bitacora(dtob);
                }
            }
            return m;
             }
            catch (Exception)
            {
                return null;

            }
        }
Beispiel #21
0
        private void estructuraBoletinG(string idGrupo, List<matricula1> kk, matricula2 item, ref int conta, ref float nota_prom, List<reportesDTO.b_BodyFin> Body, reportesDTO.b_headFin Head, ref int b)
        {
            string[] Ano = idGrupo.Split('-');
            string ano = Ano[0];
            foreach (matricula1 item2 in kk) 
            {
                reportesDTO.b_BodyFin BodyObj = new reportesDTO.b_BodyFin();
                string eitem = item.id_estudiante.ToString();
                string aitem2 = item2.id_asignatura.ToString();
                notas N = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                  t.id_periodo == (ano + "-" + "V") && t.id_asignatura == aitem2).FirstOrDefault();
                if (b == 0)
                {
                    Head.estudiante = item.personas1.apellidos.ToString() + " " + item.personas1.nombres.ToString();
                    Head.ano = item2.grupos.año.ToString();
                    Head.grado = item2.grupos.grados.nom_grado.ToString();
                    Head.grupo = item2.id_grupo.ToString();
                    Head.id = item.id_estudiante.ToString();
                    Head.periodo = "FINAL";
                    Head.rango = "RESUMEN FINAL";
                    b = 1;
                }
                if (N != null) 
                {
                    BodyObj.area = item2.asignatura.area.ToString();
                    BodyObj.asig = item2.asignatura.nombre.ToString();
                    BodyObj.ih = item2.asignatura.horas.ToString();
                    BodyObj.logro = N.logros.descripcion.ToString();
                }
                else
                {
                    BodyObj.area = item2.asignatura.area.ToString();
                    BodyObj.asig = item2.asignatura.nombre.ToString();
                    BodyObj.ih = item2.asignatura.horas.ToString();
                    BodyObj.logro = "Sin asignar.";
                }
                notas NI = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                          t.id_periodo == (ano + "-" + "I") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NII = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo == (ano + "-" + "II") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NIII = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo == (ano + "-" + "III") && t.id_asignatura == aitem2).FirstOrDefault();
                notas NIV = bd.notas.Where(t => t.id_grupo == idGrupo && t.id_estudiante == eitem &&
                                         t.id_periodo == (ano + "-" + "IV") && t.id_asignatura == aitem2).FirstOrDefault();
                if (NI == null)
                { BodyObj.I = 0; }
                else
                {
                    BodyObj.I = AjustarNenEnEnteros(NI.nota_s.ToString());
                    if (BodyObj.I == 0)
                        BodyObj.I = AjustarNenEnEnteros(NI.nota.ToString());
                    else 
                        BodyObj.I = AjustarNenEnEnteros(NI.nota_s.ToString());
                }
                if (NII == null) 
                { BodyObj.II = 0; }
                else
                {
                    BodyObj.II = AjustarNenEnEnteros(NII.nota_s.ToString());
                    if (BodyObj.II == 0)
                        BodyObj.II = AjustarNenEnEnteros(NII.nota.ToString());
                    else
                        BodyObj.II = AjustarNenEnEnteros(NII.nota_s.ToString());
                }
                if (NIII == null) 
                { BodyObj.III = 0; }
                else
                {
                    BodyObj.III = AjustarNenEnEnteros(NIII.nota_s.ToString());
                    if (BodyObj.III == 0)
                        BodyObj.III = AjustarNenEnEnteros(NIII.nota.ToString());
                    else 
                        BodyObj.III = AjustarNenEnEnteros(NIII.nota_s.ToString());
                }
                if (NIV == null) 
                { BodyObj.IV = 0; }
                else
                {
                    BodyObj.IV = AjustarNenEnEnteros(NIV.nota_s.ToString());
                    if (BodyObj.IV == 0)
                        BodyObj.IV = AjustarNenEnEnteros(NIV.nota.ToString());
                    else 
                        BodyObj.IV = AjustarNenEnEnteros(NIV.nota_s.ToString());
                }
                int i = BodyObj.I;
                int ii = BodyObj.II;
                int iii = BodyObj.III;
                int iv = BodyObj.IV;

                float v = (i + ii + iii + iv) / 4; 
                decimal vv = Math.Round((decimal)v, 1);
                BodyObj.notaV = vv;
                nota_prom = v + nota_prom; 
                BodyObj.equiv = validarEquivalenciaSimpleEnEnt(Convert.ToString(BodyObj.notaV));
                Body.Add(BodyObj);
                conta++;
            }
        }