예제 #1
0
        private void bindRoomsComboBox()
        {
            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];
            List <RoomsComboBoxWraper> rooms = client.FindAllRooms(sessionId).Select(room => new RoomsComboBoxWraper(room)).ToList();

            comboBoxRoom.ItemsSource       = rooms;
            comboBoxRoom.SelectedValuePath = "Id";
            comboBoxRoom.SelectedItem      = rooms.FirstOrDefault();
        }
예제 #2
0
        private void buttonRefresh_Click(object sender, RoutedEventArgs e)
        {
            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];

            ReserverionsDataGrid.ItemsSource = client.FindAll(sessionId);

            int selectedRoom = (int)comboBoxRoom.SelectedValue;

            comboBoxRoom.ItemsSource   = client.FindAllRooms(sessionId).Select(room => new RoomsComboBoxWraper(room)).ToList();
            comboBoxRoom.SelectedValue = selectedRoom;

            int selectedCustomer = (int)comboBoxCustomer.SelectedValue;

            comboBoxCustomer.ItemsSource   = client.FindAllCustomers(sessionId).Select(customer => new CustomerComboBoxWraper(customer)).ToList();
            comboBoxCustomer.SelectedValue = selectedCustomer;
        }