public void LogOutExecute()
 {
     try
     {
         MainWindow main = new MainWindow();
         main.Show();
         doctorView.Close();
         MessageBox.Show("You have successfully logged out");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Example #2
0
        public void Logout()
        {
            try
            {
                MessageBoxResult result = MessageBox.Show("Are you sure you want to logout?", "Confirmation", MessageBoxButton.OKCancel);
                switch (result)
                {
                case MessageBoxResult.OK:
                    LoginView loginView = new LoginView();
                    Thread.Sleep(1000);
                    doctorView.Close();
                    loginView.Show();
                    return;

                case MessageBoxResult.Cancel:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }