Beispiel #1
0
        public static void Report(DateTime startDate)
        {
            Console.WriteLine($"Since: {startDate}");
            foreach (var reportRows in GetReportData(startDate).GroupBy(x => x.FirstName))
            {
                var firstName = reportRows.Key;
                Console.WriteLine($"\n{firstName}\n");
                var table = new List <List <string> >()
                {
                    new List <string>()
                    {
                        "Job Name",
                        "Error Count",
                        "Last Finished",
                        "Last Failed",
                        "Last Error"
                    }
                };

                foreach (var row in reportRows)
                {
                    table.Add(new List <string>()
                    {
                        row.SurName,
                        row.ErrorCount.ToString(),
                        (row.LastSuccess.ToString() == "1/1/01 12:00:00 AM" ? "---" : row.LastSuccess.ToString()),
                        (row.LastFailure.ToString() == "1/1/01 12:00:00 AM" ? "---" : row.LastFailure.ToString()),
                        row.LastException.Split("\n").First() ?? ""
                    });
                }
                ConsoleReport.WriteTable(table);
            }
        }
        public static void Report()
        {
            var reports = new List <Report>()
            {
                CheckForOrphanApplicationVideos()
            };

            foreach (var r in reports)
            {
                Console.WriteLine(r.Title);
                Console.WriteLine($"Status: {r.Status}");
                if (r.Status == ReportStatus.FAILED)
                {
                    Console.Write($"Description: {r.Description}");
                    Console.WriteLine();
                    ConsoleReport.WriteTable(r.Data);
                }
            }
        }