public void Run()
        {
            _logger.Info(nameof(Application) + " started.");

            //_reconciler.RunApp();

            _logger.Info(nameof(Application) + " finished.");
        }
        public async Task InstallOrUpgradeAsync(IApp app)
        {
            consoleLogger.Info($"Installing '{app.AppId}'");
            var preInstallDesktopSystemEntries = desktopRepository.LoadSystemEntries();

            var preInstallVerificationResult = await VerifyAppAsync(app);

            var actionScript = GetActionScript(app, preInstallVerificationResult);

            if (!string.IsNullOrWhiteSpace(actionScript))
            {
                await powerShell.ExecuteAsync(actionScript);
                await VerifyAppAsync(app);
            }

            var postInstallDesktopSystemEntries = desktopRepository.LoadSystemEntries();
            var desktopSystemEntriesToDelete    = postInstallDesktopSystemEntries.Except(preInstallDesktopSystemEntries).ToList();

            if (desktopSystemEntriesToDelete.Any())
            {
                desktopRepository.DeletePaths(desktopSystemEntriesToDelete);
            }

            consoleLogger.Result($"Installed '{app.AppId}'");
        }
        public void CreateOutput(ParsedResult bookingContent)
        {
            var bookingRecords = bookingContent.BookedRecords.Select(d => d as IBookedRecords)
                                 .ToList();

            var dateBookings = bookingRecords.GroupBy(d => d.Date.Date).Select(p => new { Date = p.Key, Bookings = p.Where(k => k.Date.Date == p.Key) });

            foreach (var date in dateBookings)
            {
                _consoleLogger.Info(date.Date.ToString("yyyy-MM-dd"));

                foreach (var records in date.Bookings)
                {
                    if (records is Employee)
                    {
                        var employeeBooking = (Employee)records;
                        _consoleLogger.Info($"{employeeBooking.Date.ToString("HH:mm:ss")}", false);
                        _consoleLogger.Info(" ", false);
                        _consoleLogger.Info($"{employeeBooking.Name}");
                    }
                    else
                    {
                        var meetingBooking = (Meeting)records;
                        _consoleLogger.Info($"{meetingBooking.Date.ToString("HH:mm")}", false);
                        _consoleLogger.Info(" ", false);
                        _consoleLogger.Info($"{meetingBooking.End.ToString("HH:mm")}");
                    }
                }
            }
        }
        public string[] GetEvenLength(string[] input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            if (input.Length == 0)
            {
                _logger.Info("Empty array provided");
                return(new string[] { });
            }

            var evenElements = input.Where((element) => element.Length % 2 == 0).ToArray <string>();

            _logger.Info($"Total even elements: {evenElements.Length}");


            return(evenElements);
        }
        public async Task InstallAsync(IDownloadApp app)
        {
            consoleLogger.Info($"Installing '{app.AppId}'");

            IDownloader downloader = downloaderFactory.GetDownloader(app.Downloader);

            var downloadedFilePath = await downloader.DownloadAsync(app.DownloaderArgs.ToString() !);

            var installScript = $"{app.InstallScript} {downloadedFilePath}";

            if (app.VerificationScript == null)
            {
                await powerShell.ExecuteAsync(installScript);
            }
            else
            {
                await powerShell.ExecuteAsync(installScript, app.VerificationScript);
            }

            consoleLogger.Result($"Installed '{app.AppId}'");
        }
Esempio n. 6
0
        private void ListJobs()
        {
            Console.WriteLine("Please select the job you would like to run:");

            Console.WriteLine("1 - Purchase Orders: Reconcile JobPO Missing Records");
            Console.WriteLine("2 - Job Cost Activities: Reconcile JobCstActs (EGM) Records");
            Console.WriteLine("3 - VPOs: Reconcile JobVPO Record Dates");

            if (int.TryParse(Console.ReadLine(), out int result))
            {
                switch (result)
                {
                case 1:
                    ReconcileMissingJobPORecords();
                    break;

                case 2:
                    ReconcileMissingJobCostActivityRecords();
                    break;

                case 3:
                    ReconcileJobVPORecords();
                    break;

                default:
                    _consoleLogger.Info("Please select a valid option.");
                    ListJobs();
                    break;
                }
            }
            else
            {
                _consoleLogger.Info("Please select a valid option.");
                ListJobs();
            }
        }