public void Voting()
 {
     if (Person != null)
     {
         if (Person.Vote != true)
         {
             DataOperation data      = new DataOperation();
             Candidate     Candidate = selectedCandidate();
             data.AddVoice(Person.Pesel, Candidate);
             data.ChangeVote(Person.Pesel);
             Person.Vote = true;
         }
         StatisticVM = new VoicesStatisticViewModel(_mainVm, false);
         _mainVm.CurrentViewModel = StatisticVM;
     }
 }
Exemplo n.º 2
0
 private void ExecuteVotingViewCommand()
 {
     if (!IsAuthenticated)
     {
         LogOn();
     }
     if (IsAuthenticated)
     {
         DataOperation data = new DataOperation();
         if (data.canVote(long.Parse(Pesel)) == true)
         {
             VotingVM = new VotingViewModel(Person, IsAuthenticated, _mainVM);
             _mainVM.CurrentViewModel = VotingVM;
         }
         else
         {
             _statisticVM             = new VoicesStatisticViewModel(_mainVM, IsAuthenticated);
             _mainVM.CurrentViewModel = _statisticVM;
         }
     }
 }