public void AddTheather(Action <Theather> builder) { var theather = new Theather(); builder(theather); this.theathers.Add(theather); }
private static void SetupPricingScheme(Theather theather) { theather.ConfigureWeekdayPricingScheme(table => { var night = TimeSpan.FromHours(nightTime); table.AddPricingRule( DayOfWeek.Monday, theather.OpeningTime, night, 33 ); table.AddPricingRule( DayOfWeek.Monday, night, theather.ClosingTime, 35 ); table.AddPricingRule( DayOfWeek.Tuesday, theather.OpeningTime, night, 33 ); table.AddPricingRule( DayOfWeek.Tuesday, night, theather.ClosingTime, 35 ); table.AddPricingRule( DayOfWeek.Wednesday, theather.OpeningTime, night, 32 ); table.AddPricingRule( DayOfWeek.Wednesday, night, theather.ClosingTime, 33 ); table.AddPricingRule( DayOfWeek.Thursday, theather.OpeningTime, night, 38 ); table.AddPricingRule( DayOfWeek.Thursday, night, theather.ClosingTime, 40 ); table.AddPricingRule( DayOfWeek.Friday, theather.OpeningTime, night, 38 ); table.AddPricingRule( DayOfWeek.Friday, night, theather.ClosingTime, 40 ); table.AddPricingRule(DayOfWeek.Saturday, 40); table.AddPricingRule(DayOfWeek.Sunday, 40); }); theather.ConfigureWeekdayPricingScheme(table => { var night = TimeSpan.FromHours(nightTime); table.AddPricingRule( DayOfWeek.Monday, theather.OpeningTime, night, 40 ); table.AddPricingRule( DayOfWeek.Monday, night, theather.ClosingTime, 41 ); table.AddPricingRule( DayOfWeek.Tuesday, theather.OpeningTime, night, 40 ); table.AddPricingRule( DayOfWeek.Tuesday, night, theather.ClosingTime, 41 ); table.AddPricingRule( DayOfWeek.Wednesday, theather.OpeningTime, night, 38 ); table.AddPricingRule( DayOfWeek.Wednesday, night, theather.ClosingTime, 39 ); table.AddPricingRule( DayOfWeek.Thursday, theather.OpeningTime, night, 45 ); table.AddPricingRule( DayOfWeek.Thursday, night, theather.ClosingTime, 46 ); table.AddPricingRule(DayOfWeek.Friday, 46); table.AddPricingRule( DayOfWeek.Saturday, theather.OpeningTime, night, 45 ); table.AddPricingRule( DayOfWeek.Saturday, night, theather.ClosingTime, 46 ); table.AddPricingRule( DayOfWeek.Sunday, theather.OpeningTime, night, 45 ); table.AddPricingRule( DayOfWeek.Sunday, night, theather.ClosingTime, 46 ); }, Option3D.With3D); theather.ConfigureDatePricingScheme(table => { table.AddPricingRule(new DateTime(2019, 11, 15), 40); table.AddPricingRule(new DateTime(2019, 11, 20), 40); table.AddPricingRule(new DateTime(2019, 12, 25), 40); table.AddPricingRule(new DateTime(2020, 1, 1), 40); }); theather.ConfigureDatePricingScheme(table => { var night = TimeSpan.FromHours(nightTime); table.AddPricingRule( new DateTime(2019, 11, 15), theather.OpeningTime, night, 45 ); table.AddPricingRule( new DateTime(2019, 11, 15), night, theather.ClosingTime, 46 ); table.AddPricingRule( new DateTime(2019, 11, 20), theather.OpeningTime, night, 45 ); table.AddPricingRule( new DateTime(2019, 11, 20), night, theather.ClosingTime, 46 ); table.AddPricingRule( new DateTime(2019, 12, 25), theather.OpeningTime, night, 45 ); table.AddPricingRule( new DateTime(2019, 12, 25), night, theather.ClosingTime, 46 ); table.AddPricingRule( new DateTime(2020, 1, 1), theather.OpeningTime, night, 45 ); table.AddPricingRule( new DateTime(2020, 1, 1), night, theather.ClosingTime, 46 ); }, Option3D.With3D); }
private static void SetupRoomScheme(Theather theather) { var room = new Room { Number = 1, ScreenType = ScreenType.IMAX, Supports3D = Option3D.With3D }; theather.AddRoom(room, (builder) => { builder .HasRow('A', (row) => { row.HasSeatRange(1, 14); }) .HasRow('B', (row) => { row.HasSeatRange(1, 11) .WithSeatAt(2, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(3, (seat) => seat.Type = SeatType.Handicap) .WithSeatAt(4, (seat) => seat.Type = SeatType.Handicap) .WithSeatAt(5, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(7, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(8, (seat) => seat.Type = SeatType.Handicap) .WithSeatAt(9, (seat) => seat.Type = SeatType.Handicap) .WithSeatAt(10, (seat) => seat.Type = SeatType.Companion); }) .HasRow('C', (row) => { row.HasSeatRange(1, 14) .WithSeatAt(1, (seat) => seat.Type = SeatType.ReducedMobility) .WithSeatAt(2, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(13, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(14, (seat) => seat.Type = SeatType.ReducedMobility); }) .HasRow('D', (row) => { row.HasSeatRange(1, 14) .WithSeatAt(1, (seat) => seat.Type = SeatType.ReducedMobility) .WithSeatAt(2, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(13, (seat) => seat.Type = SeatType.Companion) .WithSeatAt(14, (seat) => seat.Type = SeatType.ReducedMobility); }) .HasRow('E', (row) => { row.HasSeatRange(1, 14); }) .HasRow('F', (row) => { row.HasSeatRange(1, 17) .WithSeatAt(15, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(16, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(17, (seat) => seat.Type = SeatType.Companion); }) .HasRow('G', (row) => { row.HasSeatRange(1, 17) .WithSeatAt(15, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(16, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(17, (seat) => seat.Type = SeatType.Companion); }) .HasRow('H', (row) => { row.HasSeatRange(1, 17) .WithSeatAt(15, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(16, (seat) => seat.Type = SeatType.Obese) .WithSeatAt(17, (seat) => seat.Type = SeatType.Companion); }) .HasRow('I', (row) => { row.HasSeatRange(1, 17); }) .HasRow('J', (row) => { row.HasSeatRange(1, 17); }) .HasRow('K', (row) => { row.HasSeatRange(1, 17); }) .HasRow('L', (row) => { row.HasSeatRange(1, 17); }); }); theather.CloneRoom(room, 2); theather.CloneRoom(room, 3); }