public CustomerInfoWindow(Customer customer) { selectedCustomer = customer; InitializeComponent(); InitFields(); }
public EditCustomerWindow(Customer c) { InitializeComponent(); customer = c; nameBox.Text = customer.name; cardNumberBox.Text = customer.cardNr.ToString(); datePicker.SelectedDate = DateTime.Parse(customer.birthDate); }
private void okBtn_Click(object sender, RoutedEventArgs e) { resv_Customer = (Customer)customerGrid.SelectedItem; if(resv_Customer != null) { createdReservation.rsvr_ID = 0; //ignored by REST createdReservation.cstmr_ID = resv_Customer.cstmr_ID; createdReservation.rsvr_rID = roomToReserve.room_ID; createdReservation.startDate = fromDate.SelectedDate.Value.ToString("yyyy-MM-dd"); createdReservation.endDate = toDate.SelectedDate.Value.ToString("yyyy-MM-dd"); createdReservation.status = ""; //ignored by REST sendReservationData(); } }
private void populateSelectionData(Room room) { selRoom = room; if (selRoom != null) { currentCustomer = null; currentResv = null; clearServices(); clearMaintenance(); foreach (var item in reservationObjects) { if (item.rsvr_rID == selRoom.room_ID) { currentResv = item; } } if (currentResv != null) { foreach (var item in customerObjects) { if (item.cstmr_ID == currentResv.cstmr_ID) { currentCustomer = item; } } reservedLbl.Content = "True"; reservedLbl.Foreground = new SolidColorBrush(Colors.Green); isReserved.Header = "True"; isReserved.Foreground = new SolidColorBrush(Colors.Green); resvDetailName.Content = "Name"; resvDetailFrom.Content = currentResv.startDate.Substring(0, 10); resvDetailTo.Content = currentResv.endDate.Substring(0, 10); resvStatus.Header = currentResv.status; resvStatus.Foreground = new SolidColorBrush(Colors.Black); resvDetailName.Content = currentCustomer.name; populateServices(selRoom); populateMaintenance(selRoom); } else { reservedLbl.Content = "False"; reservedLbl.Foreground = new SolidColorBrush(Colors.Red); isReserved.Header = "False"; isReserved.Foreground = new SolidColorBrush(Colors.Red); resvDetailName.Content = ""; resvDetailFrom.Content = ""; resvDetailTo.Content = ""; resvStatus.Header = ""; populateMaintenance(selRoom); } } }