Пример #1
0
        public ViewRoomWindow(HotelServerClient server)
        {
            InitializeComponent();
            this.server = server;
            foreach (Window w in Application.Current.Windows)
            {
                if (w is MainWindow)
                {
                    mainWindow = (MainWindow)w;
                }
            }

            selectedRoom    = (room)mainWindow.roomsList.SelectedItem;
            roomNumber.Text = selectedRoom.roomNumber.ToString();
            bedsAmount.Text = selectedRoom.bedsAmount.ToString();
            price.Text      = selectedRoom.price.ToString();
            notes.Text      = selectedRoom.notes.ToString();
            reservationsList.ItemsSource = server.getRoomReservations(selectedRoom.roomId);
        }
        public ViewReservationWindow(HotelServerClient server)
        {
            InitializeComponent();
            this.server = server;

            foreach (Window w in Application.Current.Windows)
            {
                if (w is MainWindow)
                {
                    mainWindow = (MainWindow)w;
                }
            }

            selectedReservation = (reservation)mainWindow.reservationsList.SelectedItem;

            roomNumber.Text = server.getRoom(selectedReservation.roomId).roomNumber.ToString();
            dateFrom.Text   = selectedReservation.dateFrom.ToString("dd-MM-yyyy");
            dateTo.Text     = selectedReservation.dateTo.ToString("dd-MM-yyyy");
            duration.Text   = selectedReservation.daysAmount.ToString();
            price.Text      = selectedReservation.price.ToString();
        }
 public CreateReservationWindow(HotelServerClient server)
 {
     InitializeComponent();
     this.server             = server;
     roomsNumber.ItemsSource = server.getRooms().Select(x => x.roomNumber).ToList();
 }
 public CreateRoomWindow(HotelServerClient server)
 {
     InitializeComponent();
     this.server = server;
 }