private static void OutputBooking(string title, Booking booking, ConsoleColor bg) { var oldBg = Console.BackgroundColor; Console.BackgroundColor = bg; Console.Out.WriteLine(title); Console.Out.WriteLine("BookingId = \t\t\t{0}", booking.Id); Console.Out.WriteLine("CustomerId = \t\t\t{0}", booking.CustomerId); Console.Out.WriteLine("RoomId = \t\t\t{0}", booking.RoomId); Console.Out.WriteLine("CheckIn = \t\t\t{0}", booking.CheckIn); Console.Out.WriteLine("CheckOut = \t\t\t{0}", booking.CheckOut); Console.Out.WriteLine("LateArival = \t\t\t{0}", booking.LateArival); Console.Out.WriteLine("CustomerNo = \t\t\t{0}", booking.Customer.CustomerNo); Console.Out.WriteLine("Phone1 = \t\t\t{0}", booking.Customer.Phone1); Console.Out.WriteLine("Phone2 = \t\t\t{0}", booking.Customer.Phone2); Console.Out.WriteLine("InvoiceAddress.Street = \t{0}", booking.Customer.InvoiceAddress.Street); Console.Out.WriteLine("InvoiceAddress.Zip = \t\t{0}", booking.Customer.InvoiceAddress.Zip); Console.Out.WriteLine("InvoiceAddress.City = \t\t{0}", booking.Customer.InvoiceAddress.City); Console.Out.WriteLine("InvoiceAddress.Country = \t{0}", booking.Customer.InvoiceAddress.Country); Console.Out.WriteLine("RoomNo = \t\t\t{0}", booking.Room.RoomNo); Console.Out.WriteLine("Type = \t\t\t\t{0}", booking.Room.Type); Console.Out.WriteLine("BasePrice = \t\t\t{0}", booking.Room.BasePrice.ToString("c")); Console.Out.WriteLine(string.Empty); Console.BackgroundColor = oldBg; }
private Booking CreateNewBooking() { var newBooking = new Booking { Customer = CreateNewCustomer(), Room = CreateNewRoom(), CheckIn = DateTime.Now.AddDays(2), CheckOut = DateTime.Now.AddDays(4), LateArival = true }; Db.UseOnceTo().Insert(newBooking); return newBooking; }