예제 #1
0
        public override void Execute(Guid contentDbId)
        {
            ConnectionStringSettings connectionStringCodigos = System.Configuration.ConfigurationManager.ConnectionStrings["csSql"];
            AppSettingsReader        app = new AppSettingsReader();
            string fecha = string.Concat(DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString("00"), DateTime.Now.Day.ToString("00"), DateTime.Now.Hour.ToString("00"), DateTime.Now.Minute.ToString("00"), DateTime.Now.Second.ToString("00"), (DateTime.Now.Millisecond).ToString("000"), "\\");
            string path  = Path.Combine(@"F:\COP\GeneradosSql\", fecha);

            //string path = Path.Combine(@"\\srv-kurma\COP\GeneradosSQL\", fecha); En el NOC está implementado éste path
            Directory.CreateDirectory(path);
            GeneradorDocumentos generador = new GeneradorDocumentos(
                "csSql",
                connectionStringCodigos.ConnectionString,
                path, true);

            generador.GenerarDocumentosDesdeDB();
            ImportadorFisicoMeta importador = new ImportadorFisicoMeta(path, app.GetValue("SiteUrl", typeof(string)).ToString(), "csSql", connectionStringCodigos.ConnectionString);

            importador.ImportarDocx();
        }
예제 #2
0
        public override void Execute(Guid contentDbId)
        {
            ConnectionStringSettings connectionStringCodigos = System.Configuration.ConfigurationManager.ConnectionStrings["csSql"];
            AppSettingsReader        app = new AppSettingsReader();
            string fecha       = string.Concat(DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString("00"), DateTime.Now.Day.ToString("00"), DateTime.Now.Hour.ToString("00"), DateTime.Now.Minute.ToString("00"), DateTime.Now.Second.ToString("00"), (DateTime.Now.Millisecond).ToString("000"));
            string path        = Path.Combine(app.GetValue("PathDocumentos", typeof(string)).ToString(), fecha + "\\");
            string pathEstilos = app.GetValue("PathEstiloXml", typeof(string)).ToString();

            Directory.CreateDirectory(path);
            GeneradorDocumentos generador = new GeneradorDocumentos(
                "csSql",
                connectionStringCodigos.ConnectionString,
                path, true, pathEstilos);

            generador.GenerarDocumentosDesdeDB();
            ImportadorFisicoMeta importador = new ImportadorFisicoMeta(path, app.GetValue("SiteUrl", typeof(string)).ToString(), "csSql", connectionStringCodigos.ConnectionString, fecha);

            importador.ImportarDocx();
            string[] archivos = Directory.GetFiles(path, "*.docx", SearchOption.AllDirectories);
            foreach (string archivo in archivos)
            {
                File.Delete(archivo);
            }
        }