public GroupsDataPage(DispatcherWindow window)
        {
            try
            {
                InitializeComponent();

                Groups = new ObservableCollection <groups>(Connection.Database.groups);

                DataContext = this;

                this.dispatcherWindow = window;
            }catch (EntityException err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка.",
                                MessageBoxButton.OK, MessageBoxImage.Error);

                MainWindow mainWindow = new MainWindow();
                mainWindow.IsConnected = false;
                mainWindow.Show();

                window.Close();
            }

            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка.",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 2
0
        public TimetableDataPage(DispatcherWindow dispatcherWindow)
        {
            try
            {
                InitializeComponent();

                this.Timetable = new ObservableCollection <timetable>(Connection.Database.timetable.ToList());

                this.dispatcherWindow = dispatcherWindow;

                DataContext = this;
            }catch (EntityException err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка.",
                                MessageBoxButton.OK, MessageBoxImage.Error);

                MainWindow mainWindow = new MainWindow();
                mainWindow.IsConnected = false;
                mainWindow.Show();

                dispatcherWindow.Close();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка.",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 3
0
        public TeachersDataPage(DispatcherWindow owner)
        {
            try
            {
                InitializeComponent();

                this.windowOwner = owner;

                Teachers = new ObservableCollection <teachers>(Connection.Database.teachers);

                DataContext = this;
            }
            catch (EntityException err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка", MessageBoxButton.OK, MessageBoxImage.Error);

                MainWindow mainWindow = new MainWindow();
                mainWindow.IsConnected = false;
                mainWindow.Show();

                owner.Close();
            }catch (Exception err)
            {
                MessageBox.Show(err.Message, "Произошла ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }