コード例 #1
0
 protected override void ExecuteInsertVenueCommand(string[] commandWords)
 {
     switch (commandWords[2])
     {
         case "opera":
             var opera = new Opera(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
             this.Venues.Add(opera);
             break;
         case "sports_hall":
             var sportsHall = new SportsHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
             this.Venues.Add(sportsHall);
             break;
         case "concert_hall":
             var concertHall = new ConcertHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
             this.Venues.Add(concertHall);
             break;
         default:
             base.ExecuteInsertVenueCommand(commandWords);
             break;
     }
 }
コード例 #2
0
        protected override void ExecuteInsertVenueCommand(string[] commandWords)
        {
            switch (commandWords[2])
            {
            case "opera":
                var opera = new Opera(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(opera);
                break;

            case "sports_hall":
                var sportsHall = new SportsHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(sportsHall);
                break;

            case "concert_hall":
                var concertHall = new ConcertHall(commandWords[3], commandWords[4], int.Parse(commandWords[5]));
                Venues.Add(concertHall);
                break;

            default:
                base.ExecuteInsertVenueCommand(commandWords);
                break;
            }
        }