Beispiel #1
0
        public static string ExecutePrintPerformanceCommand(string[] commandParams, IPerformanceDatabase database)
        {
            string theatre      = commandParams[0];
            var    performances = database.ListOfPerformances(theatre)
                                  .Select(p => string.Format(
                                              "({0}, {1})",
                                              p.PerformanceTitle,
                                              p.StartDateTime.ToString("dd.MM.yyyy HH:mm")))
                                  .ToList();

            if (performances.Any())
            {
                var result = string.Join(", ", performances);
                return(result);
            }

            return("No performances");
        }
Beispiel #2
0
        public static string ExecutePrintPerformanceCommand(string[] commandParams, IPerformanceDatabase database)
        {
            string theatre = commandParams[0];
            var performances = database.ListOfPerformances(theatre)
                .Select(p => string.Format(
                    "({0}, {1})",
                    p.PerformanceTitle,
                    p.StartDateTime.ToString("dd.MM.yyyy HH:mm")))
                .ToList();

            if (performances.Any())
            {
                var result = string.Join(", ", performances);
                return result;
            }

            return "No performances";
        }