コード例 #1
0
 /// <summary>
 /// Author: Ryan Taylor
 /// Click logic for New user button
 /// Date: 2/26/16
 /// </summary>
 public void NewUser_Click(object sender, RoutedEventArgs e)
 {
     // Made changes to login when user registers By : Poonam Dubey
     _newUser = new NewUserCreation();
     _newUser.AccessTokenCreatedEvent += setAccessToken;
     _newUser.ShowDialog();
     if (_accessToken != null)
     {
         this.btnLogin.Content = "Log Out";
         CheckPermissions();
     }
 }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            //clearUnusedSidebars();
            /// Added by Trevor
            /// Checking to see if there are users in the DB----- If not prompt to create admin account
            UserManager um    = new UserManager();
            int         users = um.GetUserCount();

            if (users == 0)
            {
                _newUser = new NewUserCreation(true);
                _newUser.AccessTokenCreatedEvent += setAccessToken;
                _newUser.ShowDialog();
                if (_accessToken != null)
                {
                    this.btnLogin.Content = "Log Out";
                }
            }

            mainFrame.NavigationService.Navigate(new HomeContent(_accessToken));
            CheckPermissions();
        }