public void Add_Click(object sender, RoutedEventArgs e) { if (!IsWrongValue()) { var OwnerWindowInstance = (PeriodOfStudyWindow)this.Owner; var period = new SchoolPeriod(NameTextBox.Text, DatePicker_1.SelectedDate.Value, DatePicker_2.SelectedDate.Value); OwnerWindowInstance.StudyPeriodDict.dictionaryList.Add(period); OwnerWindowInstance.PeriodsList.Items.Add(period); ElementsModification.ResetControlText <TextBox>(this); } }
public void Add_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var OwnerWindowInstance = this.Owner as GroupsWindow; var group = new SchoolGroup(NameTextBox.Text, int.Parse(StudentsQuantityTextBox.Text)); OwnerWindowInstance.SchoolGroupDict.dictionaryList.Add(group); OwnerWindowInstance.GroupsList.Items.Add(group); ((Owner as GroupsWindow).Owner as EditorWindow).HomePage.GroupsIndicator.Fill = ColorPalette.GetPredefinedColor(PredefinedColors.Green); ElementsModification.ResetControlText <TextBox>(this); } }
public void Add_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var OwnerWindowInstance = this.Owner as AudiencesWindow; var audience = new SchoolAudience(NameTextBox.Text, AudienceTypeTextBox.Text, int.Parse(CapacityTextBox.Text)); OwnerWindowInstance.SchoolAudienceDict.dictionaryList.Add(audience); OwnerWindowInstance.AudiencesList.Items.Add(audience); ((Owner as AudiencesWindow).Owner as EditorWindow).HomePage.AudiencesIndicator.Fill = ColorPalette.GetPredefinedColor(PredefinedColors.Green); ElementsModification.ResetControlText <TextBox>(this); } }
public void Add_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var OwnerWindowInstance = this.Owner as TeachersWindow; var teacher = new SchoolTeacher(NameTextBox.Text, PostTextBox.Text, int.Parse(ExperienceTextBox.Text), AddressTextBox.Text, TelephoneTextBox.Text); OwnerWindowInstance.SchoolTeacherDict.dictionaryList.Add(teacher); OwnerWindowInstance.TeachersList.Items.Add(teacher); ((Owner as TeachersWindow).Owner as EditorWindow).HomePage.TeachersIndicator.Fill = ColorPalette.GetPredefinedColor(PredefinedColors.Green); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var ownerWindowInstance = this.Owner as GroupsWindow; var group = ownerWindowInstance.SchoolGroupDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.GroupsList.SelectedItem.GetHashCode()); group.Name = NameTextBox.Text; group.StudentQuantity = int.Parse(StudentsQuantityTextBox.Text); int index = ownerWindowInstance.GroupsList.Items.IndexOf(ownerWindowInstance.GroupsList.SelectedItem); ownerWindowInstance.GroupsList.Items.Remove(ownerWindowInstance.GroupsList.SelectedItem); ownerWindowInstance.GroupsList.Items.Insert(index, group); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var ownerWindowInstance = this.Owner as SubjectsWindow; var subject = ownerWindowInstance.SchoolSubjectDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.SubjectsList.SelectedItem.GetHashCode()); subject.Name = NameTextBox.Text; subject.Complexity = int.Parse(ComplexityTextBox.Text); int index = ownerWindowInstance.SubjectsList.Items.IndexOf(ownerWindowInstance.SubjectsList.SelectedItem); ownerWindowInstance.SubjectsList.Items.Remove(ownerWindowInstance.SubjectsList.SelectedItem); ownerWindowInstance.SubjectsList.Items.Insert(index, subject); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongValue()) { var ownerWindowInstance = (PeriodOfStudyWindow)Owner; var period = (SchoolPeriod)ownerWindowInstance.StudyPeriodDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.PeriodsList.SelectedItem.GetHashCode()); period.Name = NameTextBox.Text; period.Start = DatePicker_1.SelectedDate.Value; period.End = DatePicker_2.SelectedDate.Value; int index = ownerWindowInstance.PeriodsList.Items.IndexOf(ownerWindowInstance.PeriodsList.SelectedItem); ownerWindowInstance.PeriodsList.Items.Remove(ownerWindowInstance.PeriodsList.SelectedItem); ownerWindowInstance.PeriodsList.Items.Insert(index, period); ElementsModification.ResetControlText <TextBox>(this); } }
public void Add_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var OwnerWindowInstance = this.Owner as LessonsWindow; SchoolLesson lesson = null; for (int i = 0; i < int.Parse(LessonsPerWeekTextBox.Text); i++) { lesson = new SchoolLesson(NameTextBox.Text, SubjectComboBox.SelectedItem as SchoolSubject, TeacherComboBox.SelectedItem as SchoolTeacher, AudienceComboBox.SelectedItem as SchoolAudience, GroupComboBox.SelectedItem as SchoolGroup, int.Parse(LessonsPerWeekTextBox.Text)); OwnerWindowInstance.SchoolLessonDict.dictionaryList.Add(lesson); } OwnerWindowInstance.LessonsList.Items.Add(lesson); ((Owner as LessonsWindow).Owner as EditorWindow).HomePage.LessonsIndicator.Fill = ColorPalette.GetPredefinedColor(PredefinedColors.Green); ElementsModification.ResetControlText <ComboBox>(this); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var ownerWindowInstance = (AudiencesWindow)this.Owner; var audience = ownerWindowInstance.SchoolAudienceDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.AudiencesList.SelectedItem.GetHashCode()); audience.Name = NameTextBox.Text; audience.AudienceType = AudienceTypeTextBox.Text; audience.Capacity = int.Parse(CapacityTextBox.Text); int index = ownerWindowInstance.AudiencesList.Items.IndexOf(ownerWindowInstance.AudiencesList.SelectedItem); ownerWindowInstance.AudiencesList.Items.Remove(ownerWindowInstance.AudiencesList.SelectedItem); ownerWindowInstance.AudiencesList.Items.Insert(index, audience); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var ownerWindowInstance = this.Owner as TeachersWindow; var teacher = ownerWindowInstance.SchoolTeacherDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.TeachersList.SelectedItem.GetHashCode()); teacher.Name = NameTextBox.Text; teacher.Post = PostTextBox.Text; teacher.Experience = int.Parse(ExperienceTextBox.Text); teacher.Address = AddressTextBox.Text; teacher.Telephone = TelephoneTextBox.Text; int index = ownerWindowInstance.TeachersList.Items.IndexOf(ownerWindowInstance.TeachersList.SelectedItem); ownerWindowInstance.TeachersList.Items.Remove(ownerWindowInstance.TeachersList.SelectedItem); ownerWindowInstance.TeachersList.Items.Insert(index, teacher); ElementsModification.ResetControlText <TextBox>(this); } }
public void Done_Click(object sender, RoutedEventArgs e) { if (!IsWrongTextBoxValue()) { var ownerWindowInstance = this.Owner as LessonsWindow; var lesson = ownerWindowInstance.SchoolLessonDict.dictionaryList.Find(item => item.GetHashCode() == ownerWindowInstance.LessonsList.SelectedItem.GetHashCode()); lesson.Name = NameTextBox.Text; lesson.Subject = SubjectComboBox.SelectedItem as SchoolSubject; lesson.Teacher = TeacherComboBox.SelectedItem as SchoolTeacher; lesson.Audience = AudienceComboBox.SelectedItem as SchoolAudience; lesson.Group = GroupComboBox.SelectedItem as SchoolGroup; lesson.LessonsPerWeek = int.Parse(LessonsPerWeekTextBox.Text); int index = ownerWindowInstance.LessonsList.Items.IndexOf(ownerWindowInstance.LessonsList.SelectedItem); ownerWindowInstance.LessonsList.Items.Remove(ownerWindowInstance.LessonsList.SelectedItem); ownerWindowInstance.LessonsList.Items.Insert(index, lesson); ElementsModification.ResetControlText <ComboBox>(this); ElementsModification.ResetControlText <TextBox>(this); } }
private void OnClosed(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; ElementsModification.ResetControlText <TextBox>(this); }