Ejemplo n.º 1
0
        private void BtnCerto_Click(object sender, RoutedEventArgs e)
        {
            int pontos = PontosMediador();

            Negocio.NParticipante NParticipante = new Negocio.NParticipante();
            Modelo.Participante   Mediador      = NParticipante.GetMediador();
            Modelo.Participante   JogadorVez    = NParticipante.GetJogadorVez();
            NParticipante.UpdatePontos(JogadorVez.id, 10 - pontos);
            if ((JogadorVez.placar + 10 - pontos) >= 10)
            {
                Modelo.Participante.SetGanhador(JogadorVez.nome);
                NavigationService.Navigate(new Uri("/PageVencedor.xaml", UriKind.Relative));
            }
            NParticipante.UpdatePontos(Mediador.id, pontos);
            if ((Mediador.placar + pontos) >= 10)
            {
                Modelo.Participante.SetGanhador(Mediador.nome);
                NavigationService.Navigate(new Uri("/PageVencedor.xaml", UriKind.Relative));
            }
            if ((JogadorVez.placar + 10 - pontos) < 10 && (Mediador.placar + pontos < 10))
            {
                NavigationService.Navigate(new Uri("/PageMediador.xaml", UriKind.Relative));
            }
        }
Ejemplo n.º 2
0
 private void BtnErrado_Click(object sender, RoutedEventArgs e)
 {
     setWrong();
     JogarRodada();
     if (PontosMediador() == 10)
     {
         Negocio.NParticipante NParticipante = new Negocio.NParticipante();
         Modelo.Participante   Mediador      = NParticipante.GetMediador();
         NParticipante.UpdatePontos(Mediador.id, PontosMediador());
         if ((Mediador.placar + PontosMediador()) >= 20)
         {
             Modelo.Participante.SetGanhador(Mediador.nome);
             NavigationService.Navigate(new Uri("/PageVencedor.xaml", UriKind.Relative));
         }
         else
         {
             NavigationService.Navigate(new Uri("/PageMediador.xaml", UriKind.Relative));
         }
     }
 }