protected override void ExecuteInsertVenueCommand(string[] commandWords) { IVenue venue; switch (commandWords[2]) { case "opera": venue = new OperaHall(commandWords[3], commandWords[4], int.Parse(commandWords[5])); this.Venues.Add(venue); break; case "sports_hall": venue = new SportsHall(commandWords[3], commandWords[4], int.Parse(commandWords[5])); this.Venues.Add(venue); break; case "concert_hall": venue = new ConcertHall(commandWords[3], commandWords[4], int.Parse(commandWords[5])); this.Venues.Add(venue); break; default: base.ExecuteInsertVenueCommand(commandWords); break; } }
protected override void ExecuteInsertVenueCommand(string[] commandWords) { string name = commandWords[3]; string location = commandWords[4]; int numberOfSeats = int.Parse(commandWords[5]); switch (commandWords[2]) { case "opera": var opera = new Opera(name, location, numberOfSeats); this.Venues.Add(opera); break; case "sports_hall": var sportsHall = new SportsHall(name, location, numberOfSeats); this.Venues.Add(sportsHall); break; case "concert_hall": var concertHall = new ConcertHall(name, location, numberOfSeats); this.Venues.Add(concertHall); break; default: base.ExecuteInsertVenueCommand(commandWords); break; } }
protected override void ExecuteInsertVenueCommand(string[] commandWords) { switch (commandWords[2]) { case "cinema": var cinema = new Cinema(commandWords[3], commandWords[4], int.Parse(commandWords[5])); this.Venues.Add(cinema); break; case "opera": var opera = new OperaHall(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: break; } }