Exemplo n.º 1
0
 //Nieuwe pokemon toevoegen aan de playerpokedex
 public static int AddNewPokemonPlayerPokedex(PlayerPokedex entry)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.PlayerPokedexes.Add(entry);
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 2
0
 public static int DeletePlayer(Player player)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.Entry(player).State = EntityState.Deleted;
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 3
0
 // OwnedPokemonAttacks toevoegen
 public static int AddCaughtPokemonAttacks(OwnedPokemonAttack ownedPokemonAttack)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.OwnedPokemonAttacks.Add(ownedPokemonAttack);
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 4
0
 // player items toevoegen
 public static int AddPlayerItem(PlayerItem playerItem)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.PlayerItems.Add(playerItem);
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 5
0
 // Updaten van playerpokedex
 public static int UpdatePlayerPokedex(PlayerPokedex playerPokedexEntry)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.Entry(playerPokedexEntry).State = EntityState.Modified;
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 6
0
 // Updaten welke aanvallen de pokemon momenteel kent.
 public static int UpdateKnownAttacks(OwnedPokemonAttack knownAttack)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.Entry(knownAttack).State = EntityState.Modified;
             return(projectPokemonEntities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }
Exemplo n.º 7
0
 // Pokemon object toevoegen
 public static int AddPokemon(Pokemon pokemon)
 {
     try
     {
         using (Project_Pokemon_Entities projectPokemonEntities = new Project_Pokemon_Entities())
         {
             projectPokemonEntities.Pokemons.Add(pokemon);
             projectPokemonEntities.SaveChanges();
             int id = pokemon.Id;
             return(id);
         }
     }
     catch (Exception ex)
     {
         FileOperations.FoutLoggen(ex);
         return(0);
     }
 }