Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            MainWindowInstance = this;
            bool connecting = true;

            while (connecting)
            {
                try
                {
                    DBDateController.LoadDates();
                    DBRosterController.LoadRosters();
                    DBEmployeeController.LoadEmployees();
                    DBWishForDayOffController.LoadWishForDayOffs();
                    DBDutyController.LoadDuties();
                    DBDutyExchangeController.LoadDutyExchanges();
                    connecting = false;
                }
                catch (Exception e)
                {
                    MessageBoxButton btn    = MessageBoxButton.OK;
                    MessageBoxImage  image  = MessageBoxImage.Exclamation;
                    MessageBoxResult result = MessageBox.Show($"{e.Message}\n\nDu er ikke tilsuttet vpn.eal.dk, tilslut først, og prøv igen.", "Husk at bruge vpn.eal.dk!", btn, image);
                    if (result == MessageBoxResult.OK)
                    {
                        connecting = false;
                        this.Close();
                    }
                }
            }
        }
Пример #2
0
 private void WindowClosed(object sender, CancelEventArgs e)
 {
     e.Cancel = true;
     DBEmployeeController.LoadEmployees();
     MenuWindow.MenuWindowInstance.Show();
     e.Cancel = false;
 }
Пример #3
0
 public MainWindow()
 {
     InitializeComponent();
     DBDateController.LoadDates();
     DBRosterController.LoadRosters();
     DBEmployeeController.LoadEmployees();
     DBWishForDayOffController.LoadWishForDayOffs();
     DBDutyController.LoadDuties();
     DBDutyExchangeController.LoadDutyExchanges();
 }