Пример #1
0
 public static int AddItem(Items item)
 {
     try
     {
         using (DB_r0739290Entities entities = new DB_r0739290Entities())
         {
             entities.Items.Add(item);
             return(entities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         ErrorLogging(ex);
         return(0);
     }
 }
Пример #2
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);
     }
 }
Пример #3
0
 public static int AddPlayerinvtoryItem(PlayerInventory item)
 {
     try
     {
         using (DB_r0739290Entities entities = new DB_r0739290Entities())
         {
             entities.PlayerInventory.Add(item);
             return(entities.SaveChanges());
         }
     }
     catch (Exception ex)
     {
         ErrorLogging(ex);
         return(0);
     }
 }
Пример #4
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);
            }
        }
Пример #5
0
        public static int AddToLearnedMoves(LearnedMoves newMove)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.LearnedMoves.Add(newMove);

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Пример #6
0
        public static int AddToGroup(PokemonGroup newGroup)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.PokemonGroup.Add(newGroup);

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Пример #7
0
        public static int AddStatPool(StatPool newPool)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.StatPool.Add(newPool);

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Пример #8
0
        public static int AddStatCollection(StatCollection newCollection)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.StatCollection.Add(newCollection);

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Пример #9
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);
            }
        }
Пример #10
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);
            }
        }
Пример #11
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);
            }
        }
Пример #12
0
        public static int AddPokedexEntry(Pokedex newPokedex)
        {
            try
            {
                using (DB_r0739290Entities entities = new DB_r0739290Entities())
                {
                    entities.Pokedex.Add(newPokedex);

                    return(entities.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogging(ex);
                return(0);
            }
        }
Пример #13
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);
            }
        }