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; } }
protected virtual 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.InsertPerformance(movie); break; default: break; } }