Example #1
0
 /// <summary>
 /// Executes the logoff command
 /// </summary>
 private void LogoffExecute()
 {
     try
     {
         Login login = new Login();
         allUsers.Close();
         login.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 /// <summary>
 /// Executes the logoff command
 /// </summary>
 private void LogoffExecute()
 {
     try
     {
         if (Application.Current.Windows.OfType <AllUsers>().FirstOrDefault() != null)
         {
             allUsers.Close();
         }
         else if (Application.Current.Windows.OfType <Manager>().FirstOrDefault() != null)
         {
             manWindow.Close();
         }
         else if (Application.Current.Windows.OfType <Employee>().FirstOrDefault() != null)
         {
             empWindow.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }