public void InitializeFields(ref TablesList tables, ref Booking booking, ref CustomersList customers) { comboTables.ItemsSource = tables.Tables; comboTables.DisplayMemberPath = "TableInfo"; for (int i = 0; i < tables.Count; i++) { if (tables[i].TableNumber == booking.TableNumber) { comboTables.SelectedIndex = i; break; } } txtCurrentTime.Text = booking.Timing.Duration; DisplayTiming(); for (int i = 0; i < customers.Count; i++) { if (customers[i].Id == booking.CustomerId) { txtName.Text = customers[i].Name; txtEmail.Text = customers[i].Email; txtPhone.Text = customers[i].Phone; break; } } }
public Window1(ref Booking booking, ref TablesList tables, ref CustomersList customers, ref BookingsList bookings) { this.booking = booking; this.tables = tables; this.bookings = bookings; this.customers = customers; InitializeComponent(); DefineRestaurantTimings(); InitializeFields(ref tables, ref booking, ref customers); }