Ejemplo n.º 1
0
        private void ErrandList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var errand = ErrandList.SelectedItem as Errand;
            var value  = errand.Issue;

            MechanicList.ItemsSource = _errandservice.AvailableMechanics(value);
            if (MechanicList.Items.Count == 0)
            {
                AddMechanic.IsEnabled = false;
                var noMechanic = new string[] { "Det finns inga mekaniker lediga för ärendet ännu" };
                MechanicList.ItemsSource = noMechanic;
            }
            else
            {
                AddMechanic.IsEnabled = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Matchar mekaniker med det valda ärendet
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Issue_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            MechanicsAvailable.ItemsSource = null;

            var box = (ComboBoxItem)(sender as ComboBox).SelectedItem;

            var value = box.Content.ToString();

            MechanicsAvailable.ItemsSource = _errandservice.AvailableMechanics(value);

            if (MechanicsAvailable.Items.Count == 0)
            {
                var noMechanic = new string[] { "Väntar på ledig mekaniker" };

                MechanicsAvailable.ItemsSource = noMechanic;
            }
        }