static void Main(string[] args)
        {
            PrintHeader();
            JobSettings      = new JobSettings();
            CrmRecordCounter = new CrmRecordCounter(JobSettings);

            if (args.Length != 0)
            {
                var rawExpectedCount = args[0];
                expectedCount = int.Parse(rawExpectedCount);
            }

            System.Console.WriteLine(ExitMessage);
            var bg = InitializeBackgroundWorker();

            expectedCount = (int)MessagesCountInSB();
            currentCount  = expectedCount;
            ConsoleHelper.Log($"Messages dans le service bus : {expectedCount}");
            ConsoleHelper.DrawTextProgressBar(ProgressMessage, 0, expectedCount);

            bg.RunWorkerAsync();
            System.Console.ReadKey(true);
            System.Console.WriteLine();
            bg.CancelAsync();

            ConsoleHelper.Log(CoreCountStoppedMessage, ConsoleHelper.LogStatus.Warning);
            System.Console.ReadKey();
        }
Esempio n. 2
0
        /// <summary>
        /// Form Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainForm_Load(object sender, EventArgs e)
        {
            JobSettings      = new JobSettings();
            CrmRecordCounter = new CrmRecordCounter(JobSettings);

            bgWorkerCrmCounter.RunWorkerAsync();
            bgWorkerServiceBus.RunWorkerAsync();
        }
        static void Main(string[] args)
        {
            PrintHeader();
            JobSettings      = new JobSettings();
            CrmRecordCounter = new CrmRecordCounter(JobSettings);

            // Pre-check -> Contacts in my CRM
            ConsoleHelper.Log("Nombre de contact dans mon CRM", withoutReturn: true);
            var previousCount = CrmRecordCounter.Execute("contact");

            System.Console.Write(previousCount);
            ConsoleHelper.Log("");

            var countContacts = AskForHowManyContacts();
            var contactLoader = new ContactLoader(countContacts, JobSettings.ServiceBusQueueKey);

            contactLoader.Run();
            ConsoleHelper.Log("Contacts chargés. Appuyez sur une touche pour quitter.", ConsoleHelper.LogStatus.Success);
            System.Console.ReadKey();
        }