예제 #1
0
        static void Main(string[] args)
        {
            string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            Console.WriteLine("BV Migrate | " + version);
            Console.WriteLine();

            if (args.Length < 2)
            {
                ShowHelp();
                return;
            }

            Console.WriteLine("Parsing Arguments");

            MigrationSettings data = new MigrationSettings();

            foreach (string arg in args)
            {
                ParseArg(data, arg);
            }

            data.PrepArgs();

            MigrationService migrator = new MigrationService(data);
            migrator.ProgressReport += new MigrationService.ProgressReportDelegate(builder_ProgressReport);
            migrator.StartMigration();            
        }
예제 #2
0
        private void LoadSettingsFromSaved(MigrationSettings s)
        {
            s.ApiKey = Properties.Settings.Default.ApiKey;
            s.ClearAffiliates = Properties.Settings.Default.ClearAffiliates;
            s.ClearCategories = Properties.Settings.Default.ClearCategories;
            s.ClearOrders = Properties.Settings.Default.ClearOrders;
            s.ClearProducts = Properties.Settings.Default.ClearProducts;
            s.ClearUsers = Properties.Settings.Default.ClearUsers;
            s.DestinationServiceRootUrl = Properties.Settings.Default.DestinationRootUrl;
            s.ImportAffiliates = Properties.Settings.Default.ImportAffiliates;
            s.ImportCategories = Properties.Settings.Default.ImportCategories;
            s.ImportOrders = Properties.Settings.Default.ImportOrders;
            s.ImportOtherSettings = Properties.Settings.Default.ImportOther;
            s.ImportProducts = Properties.Settings.Default.ImportProducts;
            s.ImportUsers = Properties.Settings.Default.ImportUsers;
            if (Properties.Settings.Default.SingleOrderOn)
            {
                s.SingleOrderImport = Properties.Settings.Default.SingleOrderImport;
            }
            if (Properties.Settings.Default.SingleSkuOn)
            {
                s.SingleSkuImport = Properties.Settings.Default.SingleSkuImport;
            }
            s.SourceType = Properties.Settings.Default.SourceType;
            s.SQLDatabase = Properties.Settings.Default.SQLDatabase;
            s.SQLServer = Properties.Settings.Default.SQLServer;
            s.SQLUsername = Properties.Settings.Default.SQLUsername;
            s.SQLPassword = Properties.Settings.Default.SQLPassword;
            s.UseMetricUnits = Properties.Settings.Default.UseMetricUnits;

            s.ImagesRootFolder = Properties.Settings.Default.ImagesRootFolder;

            int userStartpage = 1;
            if (int.TryParse(Properties.Settings.Default.UserStartPage, out userStartpage))
            {
                s.UserStartPage = userStartpage;
            }
            int productStartPage = 1;
            
            if (int.TryParse(Properties.Settings.Default.ProductStartPage, out productStartPage))
            {
                s.ProductStartPage = productStartPage;
            }
            s.DisableMultiThreading = Properties.Settings.Default.DisableMultiThreading;
            s.ImportProductImagesOnly = Properties.Settings.Default.ProductImagesOnly;

            s.SkipProductPrerequisites = Properties.Settings.Default.SkipProductPrerequisites;

            s.SourceServiceRootUrl = Properties.Settings.Default.SourceRootUrl;
            s.SourceApiKey = Properties.Settings.Default.SourceApiKey;

            s.SkipInactiveProducts = Properties.Settings.Default.SkipInactiveProducts;
            
            s.PrepArgs();
        }