public List <VMRol> ObtenerRoles(int idSistema) { try { IDAORol iDaoRol = new DAORol(); RespuestaBD resp = iDaoRol.ObtenerRoles(idSistema, true); if (resp.EXISTE_ERROR) { throw new Exception(resp.MENSAJE); } else { List <VMRol> lista = new List <VMRol>(); if (resp.dataSet.Tables.Count > 0) { DataTable datos = resp.dataSet.Tables[0]; lista = (from x in datos.AsEnumerable() select new VMRol() { Pais = x.Field <string>("fc_pais"), Descripcion = x.Field <string>("fc_descripcion"), IdPais = x.Field <int>("fi_id_pais"), IdRol = x.Field <int>("fi_id_Rol"), Nombre = x.Field <string>("fc_nombre"), Activo = x.Field <bool>("fl_activo") }).ToList(); } return(lista); } } catch (Exception ex) { throw new Exception(new Util().ObtenerMsjExcepcion(ex)); } }