private void TesterComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (TesterComboBox.SelectedIndex != -1) { IdErrors.Text = ""; if (Save.Content == "Check") { openAll(); } string id = (string)TesterComboBox.SelectedItem; TesterForPL = bl.GetListOfTesters().FirstOrDefault(a => a.TesterId == id); this.TesterGrid.DataContext = TesterForPL; testerGenderComboBox.SelectedItem = TesterForPL.TesterGender; if (TesterForPL.TesterGender == Gender.Male) { testerGenderComboBox.SelectedIndex = 0; } else if (TesterForPL.TesterGender == Gender.Female) { testerGenderComboBox.SelectedIndex = 1; } else { testerGenderComboBox.SelectedIndex = 2; } testercarComboBox.SelectedItem = TesterForPL.Testercar; City.Text = TesterForPL.TesterAdress.City; Street.Text = TesterForPL.TesterAdress.Street; BuidingNumber.Text = TesterForPL.TesterAdress.BuildingNumber; //schedual TesterForPL.getSchedual(SundayArr, MondayArr, TuesdayArr, WednesdayArr, ThursdayArr); showDailyHours(SundayArr);//working hours in sunday //this.TesterGrid.DataContext = TesterForPL; } }
private void TesterComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { IdErrors.Text = ""; if (Save.Content == "Check") { openAll(); } string id = (string)TesterComboBox.SelectedItem; TesterForPL = bl.GetListOfTesters().FirstOrDefault(a => a.TesterId == id); { //schedual hoursFromSchedualArr = TesterForPL.getSchedual(); for (int i = 0; i < 6; i++) //put selections hour for sunday { if (hoursFromSchedualArr[i, 0]) { schedualListBox.SelectedIndex = i; } } } this.TesterGrid.DataContext = TesterForPL; }