Example #1
0
 public static int DeletePokedexEntry(Pokedex oldPokedex)
 {
     try
     {
         using (DB_r0739290Entities entities = new DB_r0739290Entities())
         {
             entities.Entry(oldPokedex).State = EntityState.Deleted;
             return(entities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         ErrorLogging(ex);
         return(0);
     }
 }
Example #2
0
        public static int UpdatePlayerInventory(PlayerInventory currentPlayerInventory)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.Entry(currentPlayerInventory).State = EntityState.Modified;

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Example #3
0
        public static int ChangePosition(PokemonGroup currentPosition)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.Entry(currentPosition).State = EntityState.Modified;

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Example #4
0
        public static int RemoveMove(LearnedMoves toRemove)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.Entry(toRemove).State = EntityState.Deleted;

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Example #5
0
        public static int RemoveItemFromList(PlayerInventory toRemove)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.Entry(toRemove).State = EntityState.Deleted;

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Example #6
0
        public static int UpdatePokemon(Pokemon currentPokemon)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    //Vangt een fout op die modification onmogelijk maakt
                    currentPokemon.Ability = null;
                    entities.Entry(currentPokemon).State = EntityState.Modified;

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }