Ejemplo n.º 1
0
        // Нажатие кнопки редактировать семестр.
        private void btnEditSemester_Click(object sender, RoutedEventArgs e)
        {
            if (currentTerm != null)
            {
                SemesterWindow window = new SemesterWindow(currentTerm);
                if (window.ShowDialog() == true)
                {
                    // Делаем небольшой костыль, чтобы таблица не обновлялась дважды.
                    //endDateValue = DateTime.MinValue;
                    cbSemesterList.SelectedItem = null;
                    cbSemesterList.SelectedItem = currentTerm;

                    /* dpStartDate.SelectedDate = currentTerm.beginDate;
                     * dpEndDate.SelectedDate = currentTerm.endDate;*/
                }
            }
        }
Ejemplo n.º 2
0
        private void OpenAddTermWindow()
        {
            SemesterWindow semester = new SemesterWindow();

            try
            {
                if (semester.ShowDialog() == true)
                {
                    Term newTerm = DBHelper.getLastTerm();
                    termList.Add(newTerm);
                    cbSemesterList.SelectedItem = newTerm;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0} Exception cought", ex);
            }
        }