예제 #1
0
        /// <summary>
        /// Extrae el nombre, la base de datos asociada y el tipo de todos los archivos referenciados en el excel
        /// </summary>
        /// <returns>Una estructura que contiene los datos del documento en strings</returns>
        public FileLibrary createExcelLibrary()
        {
            Workbook document = new Workbook();

            document.LoadFromFile(documentPath);
            Worksheet hoja = document.Worksheets[0];

            FileLibrary fl = new FileLibrary(null, null, null, null);

            foreach (CellRange l in hoja.Rows)
            {
                String db = l.Cells[0].DisplayedText;

                if (db.Length == 0)
                {
                    break;
                }

                String type  = l.Cells[1].DisplayedText;
                String file  = l.Cells[2].DisplayedText;
                String nuevo = l.Cells[3].DisplayedText;

                FileLibrary rowLibrary = new FileLibrary(db, type, file, nuevo);
                fl.addLibrary(rowLibrary);
            }

            document.Dispose();

            return(fl.getNextInLine());
        }
예제 #2
0
 /// <summary>
 /// Une una lista al final de la que llame esta función
 /// </summary>
 /// <param name="rowLibrary"></param>
 internal void addLibrary(FileLibrary rowLibrary)
 {
     if (next == null)
     {
         next = rowLibrary;
         return;
     }
     next.addLibrary(rowLibrary);
 }