Ejemplo n.º 1
0
        private void bindCusstomerComboBox()
        {
            ReserversionsServiceClient client = new ReserversionsServiceClient();
            String sessionId = (String)App.Current.Properties[App.sessionPropertyName];
            List <CustomerComboBoxWraper> customers = client.FindAllCustomers(sessionId).Select(customer => new CustomerComboBoxWraper(customer)).ToList();

            comboBoxCustomer.ItemsSource       = customers;
            comboBoxCustomer.SelectedValuePath = "Id";
            comboBoxCustomer.SelectedItem      = customers.FirstOrDefault();
        }
Ejemplo n.º 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;
        }