コード例 #1
0
 /*!
  * \brief This handler is an event handler for the logout button.
  * \details This handler is to allow the user to navigate back to the login page and log out. This handler needs to also make sure that the user means to leave the order creation process, in progress.
  * \param sender <b>object</b>
  * \param e <b>RoutedEventArgs</b>
  */
 private void logoutBTN_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     // Return to login page
     if (localUser.getOrderProgress() == true)
     {
         MessageBoxResult result = MessageBox.Show("You have a order in progress. Are you sure you want to exit?", "T.M.S. Application", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             localUser.logout();
             loginPage login = new loginPage(localUser);
             this.NavigationService.Navigate(login);
             localUser.setOrderProgress(false);
         }
         else
         {
             return;
         }
     }
     else
     {
         localUser.logout();
         loginPage login = new loginPage(localUser);
         this.NavigationService.Navigate(login);
     }
 }
コード例 #2
0
        private void logoutBTN_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            localUser.logout();
            loginPage login = new loginPage(localUser);

            this.NavigationService.Navigate(login);
        }
コード例 #3
0
        /*!
         * \brief CONSTRUCTOR - This constructor constucts the main window.
         * \details This constructor constructs the main window. This window is a fiction as all it does is initiate some values and
         * \param sender <b>object</b>
         * \param e <b>RoutedEventArgs</b>
         */

        public MainWindow()
        {
            InitializeComponent();
            loginPage login = new loginPage(localUser);

            mainDisplay.NavigationService.Navigate(login);
            logfileLocation = "...";
        }
コード例 #4
0
        /*!
         * \brief This handler is an event handler for the logout button.
         * \details This handler is to allow the user to navigate back to the login page and log out. This handler needs to also make sure that the user means to leave the order creation process, in progress.
         * \param sender <b>object</b>
         * \param e <b>RoutedEventArgs</b>
         */

        private void logoutButton_Click(object sender, RoutedEventArgs e)
        {
            //log the user out
            localUser.logout();

            // Return to login page
            loginPage login = new loginPage(localUser);

            this.NavigationService.Navigate(login);
        }