public DataTable PesquisaDocumentos(int idoper, string query)
        {
            DataTable dt     = new DataTable();
            var       ret    = _docrepository.BuscarDocumentos(idoper, query);
            var       atribs = _catatributos.Buscar(x => x.id_oper == idoper).ToList();

            dt.Columns.Add(new DataColumn("imagem"));
            dt.Columns.Add(new DataColumn("id_documento"));
            foreach (var atrib in atribs)
            {
                dt.Columns.Add(atrib.nomeatributo);
            }

            foreach (DataRow item in ret.Rows)
            {
                var docatribs = _docrepository.BuscarAtributos(Convert.ToInt32(item["id_documento"]));
                var r         = dt.NewRow();
                r["imagem"]       = item["imagem"];
                r["id_documento"] = item["id_documento"];
                foreach (var at in atribs)
                {
                    r[at.nomeatributo] = docatribs.Where(x => x.nomeatributo == at.nomeatributo).FirstOrDefault().valor;
                }
                dt.Rows.Add(r);
            }
            return(dt);
        }
 public List <user_cat_atributos> RetornaAtributos(int id_Oper)
 {
     return(_atribrepository.Buscar(x => x.id_oper == id_Oper).ToList());
 }