public StatisticsViewModel(CurrentSessionManager currentSessionManager, DatabaseManager databaseManager, LogManager logger) { _currentSessionManager = currentSessionManager; _databaseManager = databaseManager; _logger = logger; GetDataForDisplay(); DisplayData = DataToDisplay.CandidateVotes; Display = DisplayMode.Numbers; _refreshDataTimer.AutoReset = false; _refreshDataTimer.Interval = 1000; _refreshDataTimer.Elapsed += _refreshDataTimer_Elapsed; _refreshDataTimer.Start(); }
public LoginViewModelTests() { var dbcontainer = new DbModelContainer(); var encryption = new Encryption(); var logmanager = new LogManager(); var voterService = new VoterService(dbcontainer, encryption, logmanager); var statisticService = new StatisticService(dbcontainer, logmanager); var partyService = new PartyService(dbcontainer, logmanager); var candidateService = new CandidateService(dbcontainer, logmanager); databaseManager = new DatabaseManager(dbcontainer, new Data.Helpers.Encryption(), partyService, voterService, candidateService, statisticService); currentSessionManager = new CurrentSessionManager(new ViewManager(new IoCManager(new UnityContainer())), databaseManager, logmanager); }
public VoterViewModel(CurrentSessionManager currentSessionManager, DatabaseManager databaseManager, ViewManager viewManager, LogManager logger) { _currentSessionManager = currentSessionManager; _databaseManager = databaseManager; _viewManager = viewManager; _voter = _currentSessionManager.CurrentlyLoggedVoter; Voted = _voter.Voted; var candidates = _databaseManager.Candidate.Get(); Candidates = candidates.Select(x => new CandidateControl { Name = x.Name, Party = x.Party.Name, Vote = false }).ToList(); _logger = logger; }
public LoginViewModel(CurrentSessionManager currentSessionManager, DatabaseManager databaseManager) { _currentSessionManager = currentSessionManager; _databaseManager = databaseManager; }