Exemplo n.º 1
0
        public List<ModuloRoles> GetRoles(string Modulo, string UserName)
        {
            var userStore = new UserStore<IdentityUser>();
            var userMgr = new UserManager<IdentityUser>(userStore);
            var user = userMgr.FindByName(UserName);

            ctx = new ieEntities();

            List<ModuloRoles> lm = ctx.fc_menu.Where(t => t.fc_modulo == Modulo && t.fc_menuid != t.fc_padreid && t.fc_roles != null).OrderBy(t => t.fc_posicion)
                .Select(t => new ModuloRoles
                {
                    Modulo = t.fc_modulo,
                    Roles = t.fc_roles,
                    Titulo = t.fc_titulo
                }).Distinct().ToList();
            foreach (ModuloRoles item in lm)
            {
                if (item.Roles != null)
                {
                    item.hasRol = (userMgr.IsInRole(user.Id, item.Roles));
                }

            }
            return lm;
        }
Exemplo n.º 2
0
 public notas_creditoDto GetNotaCredito(int idNota)
 {
     using (ctx = new ieEntities())
     {
         return ctx.notas_credito.Where(t => t.id == idNota).Select(MapNotasCredito.Map()).FirstOrDefault();
     }
 }
Exemplo n.º 3
0
 public List<cDeudaEstudiantesCursoGrado> GetDeudaEstudiantesCursoGrado(int id_curso, int vigencia)
 {
     using (ctx = new ieEntities())
     {
         List<cDeudaEstudiantesCursoGrado> lDeuda = new List<cDeudaEstudiantesCursoGrado>();
         cursos curso = ctx.cursos.Where(t => t.id == id_curso).FirstOrDefault();
         if (curso != null)
         {
             List<matriculas> lMatriculas = curso.matriculas.Where(t => t.estado == "AC" && t.id_curso == id_curso && t.vigencia == vigencia).ToList();
             foreach (matriculas item2 in lMatriculas)
             {
                 cDeudaEstudiantesCursoGrado oDeuda = new cDeudaEstudiantesCursoGrado();
                 oDeuda.id_curso = curso.id;
                 oDeuda.nombre_curso = curso.nombre;
                 oDeuda.id_grado = curso.grados.id;
                 oDeuda.nombre_grado = curso.grados.nombre;
                 oDeuda.id_est = item2.id_est;
                 oDeuda.id_estudiante = item2.id_estudiante;
                 oDeuda.nombre_estudiante = item2.estudiantes.terceros.nombre + " " + item2.estudiantes.terceros.apellido;
                 oDeuda.valor_deuda += GetDeudaTotalEstudiante(ctx, item2.estudiantes.identificacion);
                 lDeuda.Add(oDeuda);
             }
         }
         return lDeuda.OrderByDescending(t => t.valor_deuda).ToList();
     }
 }
Exemplo n.º 4
0
 public List<ByARpt> InsertOrUpdate(List<vigenciasDto> lReg)
 {
     using (ctx = new ieEntities())
     {
         List<ByARpt> lResp = new List<ByARpt>();
         foreach (vigenciasDto item in lReg)
         {
             ByARpt res = new ByARpt();
             vigencias obj = ctx.vigencias.Where(t => t.vigencia == item.vigencia).FirstOrDefault();
             if (obj == null)
             {
                 cmdInicializarVigencia o = new cmdInicializarVigencia();
                 o.oDto = item;
                 res = o.Enviar();
             }
             else
             {
                 cmdUpdate o = new cmdUpdate();
                 o.oDto = item;
                 res = o.Enviar();
             }
             lResp.Add(res);
         }
         return lResp;
     }
 }
Exemplo n.º 5
0
        public List<cDeudaCursosGrado> GetDeudaCursosGrado(int id_grado, int vigencia)
        {
            using (ctx = new ieEntities())
            {
                List<cDeudaCursosGrado> lDeuda = new List<cDeudaCursosGrado>();
                grados grado = ctx.grados.Where(t => t.id == id_grado).FirstOrDefault();
                if (grado != null)
                {
                    List<cursos> cursos = grado.cursos.ToList();
                    foreach (cursos item in cursos)
                    {
                        cDeudaCursosGrado oDeuda = new cDeudaCursosGrado();
                        oDeuda.id_curso = item.id;
                        oDeuda.nombre_curso = item.nombre;
                        oDeuda.id_grado = item.id_grado;
                        oDeuda.nombre_grado = item.grados.nombre;
                        oDeuda.valor_deuda = 0;

                        List<matriculas> lMatriculas = item.matriculas.Where(t => t.estado == "AC" && t.vigencia == vigencia && t.id_curso == item.id).ToList();

                        foreach (matriculas item2 in lMatriculas)
                        {
                            oDeuda.valor_deuda += GetDeudaTotalEstudiante(ctx, item2.estudiantes.identificacion);
                        }
                        lDeuda.Add(oDeuda);
                    }
                }
                return lDeuda.OrderByDescending(t => t.valor_deuda).ToList();
            }
        }
Exemplo n.º 6
0
 public byte[] getImagen()
 {
     using (ieEntities db = new ieEntities())
     {
         entidad ic = db.entidad.Single();
         return ic.logo;
     }
 }
Exemplo n.º 7
0
 public void actualizarImagen(byte[] imagen)
 {
     using (ieEntities db = new ieEntities())
     {
         entidad ic = db.entidad.Single();
         ic.logo = imagen;
         db.SaveChanges();
     }
 }
Exemplo n.º 8
0
 public List<movimientosDto> GetsMovimientosEstudiante(bTransaccionesEstudiante Reg)
 {
     using (ctx = new ieEntities())
     {
         List<movimientosDto> lrMovimientos = new List<movimientosDto>();
         List<movimientos> lMovimientos = ctx.movimientos.Where(t => t.id_estudiante == Reg.id_estudiante && t.fecha_movimiento >= Reg.fecha_inicio && t.fecha_movimiento <= Reg.fecha_final).ToList();
         Mapper.Map(lMovimientos, lrMovimientos);
         return lrMovimientos;
     }
 }
Exemplo n.º 9
0
 public List<grupos_pagosDto> Gets()
 {
     using (ctx = new ieEntities())
     {
         List<grupos_pagosDto> lr = new List<grupos_pagosDto>();
         List<grupos_pagos> l = ctx.grupos_pagos.OrderBy(t=> t.prioridad).ToList();
         Mapper.Map(l,lr);
         return lr;
     }
 }
Exemplo n.º 10
0
 public List<cursosDto> GetCursos()
 {
     using (ctx = new ieEntities())
     {
         List<cursosDto> lr = new List<cursosDto>();
         List<cursos> l = ctx.cursos.ToList();
         Mapper.Map(l, lr);
         return lr;
     }
 }
Exemplo n.º 11
0
 public cursosDto Get(int id_curso)
 {
     using (ctx = new ieEntities())
     {
         cursosDto lr = new cursosDto();
         cursos l = ctx.cursos.Where(t => t.id == id_curso).OrderBy(t => t.id).FirstOrDefault();
         Mapper.Map(l, lr);
         return lr;
     }
 }
Exemplo n.º 12
0
 public List<vigenciasDto> GetsActivas()
 {
     using (ctx = new ieEntities())
     {
         List<vigenciasDto> lr = new List<vigenciasDto>();
         List<vigencias> l = ctx.vigencias.Where(t=> t.estado == "AC").OrderByDescending(t => t.vigencia).ToList();
         Mapper.Map(l, lr);
         return lr;
     }
 }
Exemplo n.º 13
0
 public List<mensajesDto> GetMensajes(int id_acudiente)
 {
     using(ctx = new ieEntities())
     {
         List<mensajesDto> ListMsjeDto = new List<mensajesDto>();
         List<mensajes> ListMsje = ctx.mensajes.Where(t => t.id_destinatario == id_acudiente && t.estado != "IN").OrderByDescending(t=> t.fecha).ToList();
         Mapper.Map(ListMsje, ListMsjeDto);
         return ListMsjeDto;
     }
 }
Exemplo n.º 14
0
 public List<tarifasDto> Gets(int vigencia)
 {
     using (ctx = new ieEntities())
     {
         List<tarifasDto> r = new List<tarifasDto>();
         List<tarifas> o = ctx.tarifas.Where(t => t.vigencia == vigencia).ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 15
0
 public tarifasDto Get(int id)
 {
     using (ctx = new ieEntities())
     {
         tarifasDto r = new tarifasDto();
         tarifas o = ctx.tarifas.Where(t => t.id == id).FirstOrDefault();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 16
0
 public List<tarifasDto> Gets()
 {
     using (ctx = new ieEntities())
     {
         List<tarifasDto> r = new List<tarifasDto>();
         List<tarifas> o = ctx.tarifas.ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 17
0
 public List<configGruposPagosDto> Gets()
 {
     using (ctx = new ieEntities())
     {
         List<configGruposPagosDto> r = new List<configGruposPagosDto>();
         List<config_grupos_pagos> o = ctx.config_grupos_pagos.ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 18
0
 public List<configGruposPagosDto> Gets(int vigencia)
 {
     using (ctx = new ieEntities())
     {
         List<configGruposPagosDto> r = new List<configGruposPagosDto>();
         List<config_grupos_pagos> o = ctx.config_grupos_pagos.Where(t=>t.vigencia==vigencia).ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 19
0
 public List<conceptosDto> Gets()
 {
     using (ctx = new ieEntities())
     {
         List<conceptosDto> r = new List<conceptosDto>();
         List<conceptos> o = ctx.conceptos.ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 20
0
 public configGruposPagosDto Get(int id)
 {
     using(ctx = new ieEntities())
     {
         configGruposPagosDto r = new configGruposPagosDto();
         config_grupos_pagos o = ctx.config_grupos_pagos.Where(t => t.id == id).FirstOrDefault();
         Mapper.Map(o,r);
         return r;
     }
 }
Exemplo n.º 21
0
 public conceptosDto Get(int id_concepto)
 {
     using(ctx = new ieEntities())
     {
         conceptosDto r = new conceptosDto();
         conceptos o = ctx.conceptos.Where(t => t.id == id_concepto).FirstOrDefault();
         Mapper.Map(o,r);
         return r;
     }
 }
Exemplo n.º 22
0
 public vigenciasDto Get(int vigencia)
 {
     using (ctx = new ieEntities())
     {
         vigenciasDto lr = new vigenciasDto();
         vigencias l = ctx.vigencias.Where(t => t.vigencia == vigencia).OrderByDescending(t => t.vigencia).FirstOrDefault();
         Mapper.Map(l, lr);
         return lr;
     }
 }
Exemplo n.º 23
0
 public pagosDto GetLiquidacion(int id_liquidacion)
 {
     using (ctx = new ieEntities())
     {
         pagosDto r = new pagosDto();
         pagos o = ctx.pagos.Where(t => t.id == id_liquidacion).FirstOrDefault();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 24
0
        public static DateTime FechaCausacion()
        {
            ieEntities ctx = new ieEntities();

            parametros strFechaCausacion = ctx.parametros.Where(t => t.nombre == "FECCAUSA").FirstOrDefault();
            int year = int.Parse(strFechaCausacion.valor.Substring(0, 4));
            int month = int.Parse(strFechaCausacion.valor.Substring(4, 2));
            int day = int.Parse(strFechaCausacion.valor.Substring(6, 2));
            DateTime FechaCausacion = new DateTime(year, month, day);
            return FechaCausacion;
        }
Exemplo n.º 25
0
 public entidadDto Get()
 {
     using(ctx = new ieEntities())
     {
         entidadDto r = new entidadDto();
         entidad o = ctx.entidad.FirstOrDefault();
         o.logo = null;
         Mapper.Map(o,r);
         return r;
     }
 }
Exemplo n.º 26
0
 public List<tarifasDto> GetTarifas(int vigencia,int grado)
 {
     using (ctx = new ieEntities())
     {
         List<tarifas> o = new List<tarifas>();
         List<tarifasDto> r = new List<tarifasDto>();
         o = ctx.tarifas.Where(t => t.vigencia == vigencia && t.id_grado == grado).ToList();
         Mapper.Map(o, r);
         return r;
     }
 }
Exemplo n.º 27
0
 public List<carterapDto> GetCarteraEstudiante(string id_estudiante, int vigencia)
 {
     using (ctx = new ieEntities())
     {
         MaperCarterap();
         List<carterapDto> lrCartera = new List<carterapDto>();
         List<carterap> lCartera = ctx.carterap.Where(t => t.id_estudiante == id_estudiante && t.estado != "AN" && t.vigencia == vigencia).OrderBy(t=> t.periodo).ToList();
         Mapper.Map(lCartera, lrCartera);
         return lrCartera;
     }
 }
Exemplo n.º 28
0
 public matriculasDto Get(string id_estudiante, int vigencia)
 {
     using (ctx = new ieEntities())
     {
         matriculasDto r = new matriculasDto();
         matriculas o = ctx.matriculas.Where(t => t.id_estudiante == id_estudiante && t.vigencia == vigencia && t.estado == "AC").FirstOrDefault();
         if (o != null) Mapper.Map(o, r);
         else r = null;
         return r;
     }
 }
Exemplo n.º 29
0
        public List<matriculasDto> Gets(ConsultaMatriculasDto objCon)
        {
            using (ctx = new ieEntities())
            {
                List<matriculasDto> lr = new List<matriculasDto>();
                List<matriculas> l;
                if(objCon.Curso == null) l = ctx.matriculas.Where(t => t.vigencia == objCon.Vigencia && t.estado != "AN" && (t.id_matricula.ToUpper().Contains(objCon.Filtro.ToUpper()) || t.estudiantes.terceros.nombre.ToUpper().Contains(objCon.Filtro) || t.estudiantes.terceros.apellido.ToUpper().Contains(objCon.Filtro))).ToList();
                else l = ctx.matriculas.Where(t => t.vigencia == objCon.Vigencia && t.estado != "AN" && (t.id_matricula.ToUpper().Contains(objCon.Filtro.ToUpper()) || t.estudiantes.terceros.nombre.ToUpper().Contains(objCon.Filtro) || t.estudiantes.terceros.apellido.ToUpper().Contains(objCon.Filtro)) && t.id_curso == objCon.Curso).ToList();

                Mapper.Map(l,lr);

                return lr;
            }
        }
 public int GetNumeroDiasPagoIntereses(float Capital, float ValorDisponible)
 {
     using (ctx = new ieEntities())
     {
         try
         {
             decimal TasaVigente = GetTasaVigenteNominalDiario();
             int NumeroDias = (int)((decimal)ValorDisponible / ((decimal)Capital * TasaVigente));
             return NumeroDias;
         }
         catch
         {
             return 0;
         }
     }
 }