Esempio n. 1
0
 public static DocsPaVO.documento.AnelloDocumentale buildCatena(string idGruppo, string idPeople, string idNodo, System.Data.DataTable alberoTable)
 {
     DocsPaVO.documento.AnelloDocumentale nodo = new DocsPaVO.documento.AnelloDocumentale();
     DocsPaDB.Query_DocsPAWS.Documenti    doc  = new DocsPaDB.Query_DocsPAWS.Documenti();
     nodo.infoDoc = doc.GetInfoDocumento(idGruppo, idPeople, idNodo, true);
     System.Data.DataRow[] childRows = alberoTable.Select("ID_DOC_COLLEGATO=" + idNodo);
     for (int i = 0; i < childRows.Length; i++)
     {
         DocsPaVO.documento.AnelloDocumentale child = buildCatena(idGruppo, idPeople, childRows[i]["ID_DOCUMENTO"].ToString(), alberoTable);
         nodo.children.Add(child);
     }
     return(nodo);
 }
Esempio n. 2
0
        public static DocsPaVO.documento.AnelloDocumentale getCatenaDoc(string idGruppo, string idPeople, string idProfile)
        {
            logger.Debug("getCatenaDoc");
            DocsPaVO.documento.AnelloDocumentale result = new DocsPaVO.documento.AnelloDocumentale();
            //DocsPaWS.Utils.Database db= DocsPaWS.Utils.dbControl.getDatabase();
            DocsPaDB.Query_DocsPAWS.Documenti doc = new DocsPaDB.Query_DocsPAWS.Documenti();
            System.Data.DataSet dataSet;
            //bool dbOpen=false;
            try
            {
                //db.openConnection();
                //dbOpen=true;

                //si trova la root del documento
                string idRoot = getIdRoot(idProfile);

                //si carica in una tabella l'albero relativo a tale root

                /*string alberoString="SELECT ID_DOCUMENTO,ID_DOC_COLLEGATO FROM DPA_DOC_COLLEGAMENTI WHERE ID_ROOT="+idRoot;
                 *          db.fillTable(alberoString,dataSet,"ALBERO");*/

                doc.GetCatenaDoc(out dataSet, idRoot);

                // TODO: sostituire con l'implementazione
                //       della gestione documentale
                result = buildCatena(idGruppo, idPeople, idRoot, dataSet.Tables["ALBERO"]);
            }
            catch (Exception e)
            {
                logger.Debug(e.Message);

                /*if(dbOpen)
                 * {
                 * db.closeConnection();
                 * }*/
                logger.Debug("Errore nella gestione della catena documento (getCatenaDoc)", e);
                throw new Exception("F_System");
            }
            return(result);
        }