public ReservationEditorWindow(Reservation reservation)
        {
            InitializeComponent();

            this.reservation = reservation;

            idLabel.Content = reservation.rsvr_ID;
            idLabel.Foreground = new SolidColorBrush(Colors.DarkRed);
            fromDate.SelectedDate = DateTime.Parse(reservation.startDate);
            toDate.SelectedDate = DateTime.Parse(reservation.endDate);
            statusBox.SelectedValue = reservation.status;

        }
Example #2
0
        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);
                }
            }
        }