Example #1
0
        public static capaDatos.cRol RecuperarRolPorId(int pIdRol)
        {
            capaDatos.cRol resultado   = new capaDatos.cRol();
            DataSet        dsResultado = capaSeguridad.GestiĆ³nRol(pIdRol, null, null, Constantes.cSQL_SELECT);

            if (dsResultado != null)
            {
                foreach (DataRow item in dsResultado.Tables["Rol"].Rows)
                {
                    if (item["rol_codRol"] != DBNull.Value)
                    {
                        resultado.rol_codRol = Convert.ToInt32(item["rol_codRol"]);
                    }
                    if (item["rol_Nombre"] != DBNull.Value)
                    {
                        resultado.rol_Nombre = item["rol_Nombre"].ToString();
                    }
                }
            }
            return(resultado);
        }
Example #2
0
        public static List <capaDatos.cRol> RecuperarTodasRoles(string pFiltro)
        {
            List <capaDatos.cRol> lista = new List <capaDatos.cRol>();
            DataSet dsResultado         = capaSeguridad.GestiĆ³nRol(null, null, pFiltro, Constantes.cSQL_SELECT);

            if (dsResultado != null)
            {
                foreach (DataRow item in dsResultado.Tables["Rol"].Rows)
                {
                    capaDatos.cRol obj = new capaDatos.cRol();
                    if (item["rol_codRol"] != DBNull.Value)
                    {
                        obj.rol_codRol = Convert.ToInt32(item["rol_codRol"]);
                    }
                    if (item["rol_Nombre"] != DBNull.Value)
                    {
                        obj.rol_Nombre = item["rol_Nombre"].ToString();
                    }
                    lista.Add(obj);
                }
            }
            return(lista);
        }