コード例 #1
0
        public static void ProcessDataDirs()
        {
            //Clean output directory so that older files do not get copied to Google Drive again
            DirectoryInfo di = new DirectoryInfo(Configurations.OutputDir);

            foreach (FileInfo file in di.GetFiles())
            {
                file.Delete();
            }

            //Open log file for writing assigned barcode range corresponding to each input data directory
            WriteToCSVFiles.InitiateBarcodesLogging();

            //traverse each directory and process the two CSVs
            var inputDataDirs = Directory.EnumerateDirectories(Configurations.InputCSVDataDir);

            foreach (var dir in inputDataDirs)
            {
                var headerFile = dir + "/" + Configurations.TallyHeaderCsvFileNameWithExtension;
                var itemsFile  = dir + "/" + Configurations.TallyItemsCsvFileNameWithExtension;

                TallyMigrator.Migrate(headerFile, itemsFile, Path.GetFileName(dir));
            }

            WriteToCSVFiles.CloseBarcodesLogging();
        }
コード例 #2
0
        public void WriteToBarcodeCSVFile()
        {
            BarcodeCSVParams b = new BarcodeCSVParams();

            b.FirstBarcodeAssigned = "100";
            b.LastBarcodeAssigned  = "104";
            b.TimeStamp            = DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss");
            b.AssociatedOutputXml  = "Output1";

            BarcodeCSVParams c = new BarcodeCSVParams();

            c.FirstBarcodeAssigned = "105";
            c.LastBarcodeAssigned  = "110";
            c.TimeStamp            = DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss");
            c.AssociatedOutputXml  = "Output2";

            WriteToCSVFiles.InitiateBarcodesLogging();
            WriteToCSVFiles.WriteBarcodesDataToFile(b);
            WriteToCSVFiles.WriteBarcodesDataToFile(c);
            WriteToCSVFiles.CloseBarcodesLogging();
        }