Esempio n. 1
0
 public Boolean InserirPontuacaoPorJogador()
 {
     try
     {
         using (var _context = new Show_de_PerguntasEntities())
         {
             Ranking r = new Ranking();
             r.pontuacaoMaxima = this.pontuacaoMax;
             r.UsuarioIdUsuario = this.IdUsuario;
             _context.AddToRankings(r);
             _context.SaveChanges();
         }
         return true;
     }
     catch (Exception)
     {
         return false;
         //throw;
     }
 }
 /// <summary>
 /// Create a new Ranking object.
 /// </summary>
 /// <param name="idRanking">Initial value of the IdRanking property.</param>
 /// <param name="pontuacaoMaxima">Initial value of the pontuacaoMaxima property.</param>
 public static Ranking CreateRanking(global::System.Int32 idRanking, global::System.Int32 pontuacaoMaxima)
 {
     Ranking ranking = new Ranking();
     ranking.IdRanking = idRanking;
     ranking.pontuacaoMaxima = pontuacaoMaxima;
     return ranking;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Rankings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRankings(Ranking ranking)
 {
     base.AddObject("Rankings", ranking);
 }