private void UsersLoading(object sender, RoutedEventArgs e) { try { UserSingleton.GetInstance(); AllUsers = new Server().SetUsers(); if (AllUsers != null) { UsersList.ItemsSource = AllUsers; UsersList.SelectedIndex = 0; } } catch (Exception msg) { LoginWindow window = new LoginWindow(); window.Owner = Window.GetWindow(this); window.ShowDialog(); UsersLoading(sender, e); } //Error message }
private void CandidatesLoading(object sender, RoutedEventArgs e) { try { UserSingleton UserAdmin = UserSingleton.GetInstance(); string UserAdminID = UserAdmin.GetUserID(); Candidates = new Server().SetCandidates(VoteNum); if (Candidates != null) { CandudatesList.ItemsSource = Candidates; } CandudatesList.SelectedIndex = 0; } catch (Exception msg) { LoginWindow window = new LoginWindow(); window.Owner = Window.GetWindow(this); window.ShowDialog(); CandidatesLoading(sender, e); } }
//UserVotingsList private void UserVotingsLoading(string UserID)//() { try { UserSingleton UserAdmin = UserSingleton.GetInstance(); string UserAdminID = UserAdmin.GetUserID(); AllUserVotings = new Server().SetUserPool(UserID); if (AllVotings != null) { UserVotingsList.ItemsSource = AllUserVotings; } //VotingsList.SelectedIndex = 0; } catch (Exception msg) { LoginWindow window = new LoginWindow(); window.Owner = Window.GetWindow(this); window.ShowDialog(); UserVotingsLoading(UserID); } //Error message }
private void VotingsLoading(object sender, RoutedEventArgs e) { try { UserSingleton UserAdmin = UserSingleton.GetInstance(); string UserAdminID = UserAdmin.GetUserID(); AllVotings = new Server().SetPool(UserAdminID); if (AllVotings != null) { FilteredVotings = AllVotings; VotingsList.ItemsSource = AllVotings; } //VotingsList.SelectedIndex = 0; } catch (Exception msg) { LoginWindow window = new LoginWindow(); window.Owner = Window.GetWindow(this); window.ShowDialog(); VotingsLoading(sender, e); } //Error message }