Ejemplo n.º 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());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Genera los scripts de los archivos mencionados en el documento
 /// </summary>
 /// <param name="library">Lista que contiene los datos de archivos mencionados en el documento</param>
 /// <param name="place">Ubicación en donde se creará los archivos</param>
 internal void generateScripts(FileLibrary library, String place)
 {
     while (library != null)
     {
         Wrapper        file = this.serverExplorer(library.dbName, library.type, library.fileName);
         ScriptLocation sl   = new ScriptLocation(library.dbName, library.type, library.fileName, file.script(library.newStatus, alter));
         PkgCreator.createFile(sl, place);
         library = library.getNextInLine();
     }
 }