コード例 #1
0
        public List<hmatricula> c_hmatriculas(string id, string rol)
        {
            try
            {
                List<hmatricula> lhoja = new List<hmatricula>();
                List<matricula1> p = bd.matricula1.Where(t =>
                t.id_profesor == id).ToList();
                if (p.Count != 0)
                {
                    foreach (matricula1 item in p)
                    {
                        hmatricula hoja = new hmatricula();

                        hoja.idAsig = item.id_asignatura;
                        hoja.nAsig = item.asignatura.nombre;
                        hoja.grupo = item.id_grupo.ToString();
                        hoja.grado = item.grupos.grados.nom_grado.ToString();
                        hoja.horas = item.asignatura.horas.ToString();
                        hoja.año = item.grupos.año.ToString();
                        lhoja.Add(hoja);
                    }

                    return lhoja;
                }
                else
                {
                    hmatricula hoja = new hmatricula();

                    hoja.idAsig = "SIN ASIGNAR";
                    hoja.nAsig = "SIN ASIGNAR";
                    hoja.grupo = "SIN ASIGNAR";
                    hoja.grado = "SIN ASIGNAR";
                    hoja.horas = "SIN ASIGNAR";
                    hoja.año = "";
                    lhoja.Add(hoja);
                    return lhoja;
                }
                
            }
            catch (Exception Ex)
            {
                string g = Ex.Message.ToString();
                return null;
            }
        }
コード例 #2
0
ファイル: RepoReport.cs プロジェクト: LuisSilva2014/SIGAME1.3
 public c_constanciaProfeMat c_constanciaProfeMat(string id, string anoL) // Constancia de carga academica de profesores.
 {
     try
     {
         List<matricula1> p = bd.matricula1.Where(t =>
         t.id_profesor == id && t.grupos.año == anoL).ToList();
         c_constanciaProfeMat hoja = new c_constanciaProfeMat();
         List<hmatricula> lhoja = new List<hmatricula>();
         string tipo = null;
         string nombresapell = null;
         if (p.Count != 0)
         {
             foreach (matricula1 item in p)
             {
                 hmatricula ho = new hmatricula();
                 ho.idAsig = item.id_asignatura;
                 ho.nAsig = item.asignatura.nombre;
                 ho.grupo = item.id_grupo.ToString();
                 ho.grado = item.grupos.grados.nom_grado.ToString();
                 ho.horas = item.asignatura.horas.ToString();
                 tipo = item.personas.id_tipo.ToString();
                 nombresapell = item.personas.apellidos.ToString() + " " + item.personas.nombres.ToString();
                 lhoja.Add(ho);
             }
         }
         else
         {
             hoja.cargaA = null;
             hoja.dtoP = null;
         }
         RepoPlantel rpp = new RepoPlantel();
         hoja.plantel = rpp.c_plantel();
         hoja.cargaA = lhoja;
         directores_g d = bd.directores_g.Where(t => t.id_profesor == id).FirstOrDefault();
         dtoProfesor dtoprofe = new dtoProfesor();
         if (d != null)
         {
             dtoprofe.dirG = "SI";
             dtoprofe.dirGrupo = d.id_grupo.ToString();
             dtoprofe.id = id;
             dtoprofe.tipo = tipo;
             dtoprofe.nombresapell = nombresapell;
         }
         else
         {
             dtoprofe.dirG = "NO";
             dtoprofe.dirGrupo = "NINGUNO";
             dtoprofe.id = id;
             dtoprofe.tipo = tipo;
             dtoprofe.nombresapell = nombresapell;
         }
         hoja.dtoP = dtoprofe;
         dtoDirectivos directivo = new dtoDirectivos();
         personas dRector = bd.personas.Where(t => t.rol == "RECTOR").FirstOrDefault();
         personas dCoordinador = bd.personas.Where(t => t.rol == "COORDINADOR").FirstOrDefault();
         directivo.idCoordinador = dCoordinador.id.ToString();
         directivo.nombresCoordinador = dCoordinador.nombres.ToString() + " " + dCoordinador.apellidos.ToString() + " ";
         directivo.lineaFirma1 = "_________________________";
         directivo.lineaFirma2 = "_________________________";
         directivo.idRector = dRector.id.ToString();
         directivo.nombresRector = dRector.nombres.ToString() + " " + dRector.apellidos.ToString();
         hoja.dtoDirect = directivo;
         return hoja;
     }
     catch (Exception Ex)
     {
         string g = Ex.Message.ToString();
         return null;
     }
 }