コード例 #1
0
ファイル: MyCinemaEngine.cs プロジェクト: didimitrov/Algo
 protected override void ExecuteInsertPerformanceCommand(string[] commandWords)
 {
     switch (commandWords[2])
     {
         case "movie":
             var venue = this.GetVenue(commandWords[5]);
             var movie = new Movie(commandWords[3], decimal.Parse(commandWords[4]), venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.Performances.Add(movie);
             break;
         case "theater":
             venue = this.GetVenue(commandWords[5]);
             var theater = new Theatre(commandWords[3], decimal.Parse(commandWords[4]), venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             Performances.Add(theater);
             break;
         case "concert":
             venue = this.GetVenue(commandWords[5]);
             var concert = new Concert(commandWords[3], decimal.Parse(commandWords[4]), venue,
                 DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             break;
         default:
             base.ExecuteInsertPerformanceCommand(commandWords);
             break;
     }
 }
コード例 #2
0
 protected override void ExecuteInsertPerformanceCommand(string[] commandWords)
 {
     IVenue venue;
     switch (commandWords[2])
     {
         case "concert":
             venue = this.GetVenue(commandWords[5]);
             var concert = new Concert(commandWords[3], decimal.Parse(commandWords[4]), venue, DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.InsertPerformance(concert);
             break;
         case "theatre":
             venue = this.GetVenue(commandWords[5]);
             var theatre = new Theatre(commandWords[3], decimal.Parse(commandWords[4]), venue, DateTime.Parse(commandWords[6] + " " + commandWords[7]));
             this.InsertPerformance(theatre);
             break;
         default:
             base.ExecuteInsertPerformanceCommand(commandWords);
             break;
     }
 }
コード例 #3
0
        protected override void ExecuteInsertPerformanceCommand(string[] commandWords)
        {
            base.ExecuteInsertPerformanceCommand(commandWords);

            switch (commandWords[2])
            {
                case "theatre":
                    var theatre = new Theatre(
                        commandWords[3],
                        decimal.Parse(commandWords[4]),
                        base.GetVenue(commandWords[5]),
                        ParseInputToDateTime(string.Format("{0} {1}", commandWords[6], commandWords[7])));

                    this.Performances.Add(theatre);

                    break;

                case "concert":

                    var concert = new Concert(
                        commandWords[3],
                        decimal.Parse(commandWords[4]),
                        base.GetVenue(commandWords[5]),
                        ParseInputToDateTime(string.Format("{0} {1}", commandWords[6], commandWords[7])));

                    this.Performances.Add(concert);

                    break;
            }
        }