Exemple #1
0
        public static Pokemon SelectPokemonFromParty(PokemonGroup partyPokemon)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IQueryable <Pokemon> query = entities.Pokemon

                                             .Include("Statpool")
                                             .Include("Statpool.BaseStats")
                                             .Include("Statpool.EVStats")
                                             .Include("Statpool.IVStats")
                                             .Include("LearnedMoves")
                                             .Include("Pokedex")
                                             .Include("Trainer")
                                             .Include("Pokedex.Types")
                                             .Include("Pokedex.Types1")
                                             .Include("LearnedMoves.PokemonMoves")
                                             .Include("StatusEffects")
                                             .Include("Items")
                                             .Include("Ability")
                                             .Where(x => x.Id == partyPokemon.PokemonId);


                return(query.SingleOrDefault());
            }
        }
Exemple #2
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);
            }
        }
Exemple #3
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);
            }
        }
Exemple #4
0
        public static int RemovePokemonFromGroup(PokemonGroup 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);
            }
        }