Ejemplo n.º 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());
            }
        }
Ejemplo n.º 2
0
 public static List <Trainer> GetTrainerList()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         DbSet <Trainer> query = entities.Trainer;
         return(query.ToList());
     }
 }
Ejemplo n.º 3
0
 public static int CurrentPokemonGroups()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         DbSet <PokemonGroup> query = entities.PokemonGroup;
         return(query.ToList().Max(x => x.Id));
     }
 }
Ejemplo n.º 4
0
 public static List <Items> ItemList()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         DbSet <Items> query = entities.Items;
         return(query.ToList());
     }
 }
Ejemplo n.º 5
0
        public static int CurrentPlayerItems()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <PlayerInventory> query = entities.PlayerInventory;

                return(query.ToList().Max(x => x.id));
            }
        }
Ejemplo n.º 6
0
        public static int CurrentStatCollections()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <StatCollection> query = entities.StatCollection;

                return(query.ToList().Max(x => x.Id));;
            }
        }
Ejemplo n.º 7
0
        public static int CurrentLearnedMoves()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <LearnedMoves> query = entities.LearnedMoves;

                return(query.ToList().Max(x => x.Id));
            }
        }
Ejemplo n.º 8
0
 public static List <PokemonMoves> AllMoves()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <PokemonMoves> query = entities.PokemonMoves
                                                  .OrderBy(x => x.Id);
         return(query.ToList());
     }
 }
Ejemplo n.º 9
0
        public static int CurrentStatpools()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <StatPool> query = entities.StatPool;

                return(query.ToList().Max(x => x.Id));;
            }
        }
Ejemplo n.º 10
0
 public static List <Ability> AbilityList()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <Ability> query = entities.Ability
                                             .OrderBy(x => x.Id);
         return(query.ToList());
     }
 }
Ejemplo n.º 11
0
 public static List <Types> Typinglist()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <Types> query = entities.Types
                                           .OrderBy(x => x.Id);
         return(query.ToList());
     }
 }
Ejemplo n.º 12
0
 public static List <Pokedex> PokedexEntryAZ()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <Pokedex> query = entities.Pokedex
                                             .OrderBy(x => x.PokemonName);
         return(query.ToList());
     }
 }
Ejemplo n.º 13
0
        public static int CurrentItems()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <Items> query = entities.Items;

                return(query.ToList().Max(x => x.Id));
            }
        }
Ejemplo n.º 14
0
        public static List <Pokemon> PokemonList()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                DbSet <Pokemon> query = entities.Pokemon;

                return(query.ToList());
            }
        }
Ejemplo n.º 15
0
 public static List <Trainer> SelectMoneyOwnedFromTrainer(Trainer trainer)
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IQueryable <Trainer> query = entities.Trainer
                                      .Where(x => x.TrainerName == trainer.TrainerName);
         return(query.ToList());
     }
 }
Ejemplo n.º 16
0
 public static List <Trainer> TrainerList()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <Trainer> query = entities.Trainer
                                             .Include("PokemonGroup")
                                             .OrderBy(x => x.Id);
         return(query.ToList());
     }
 }
Ejemplo n.º 17
0
        public static Pokedex SelectPokemonFromPokedex(Pokedex pokedexpokemon)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IQueryable <Pokedex> query = entities.Pokedex
                                             .Where(x => x.Id == pokedexpokemon.Id);

                return(query.SingleOrDefault());
            }
        }
Ejemplo n.º 18
0
        public static List <PlayerInventory> SelectQuantityFromItems(Items item)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IQueryable <PlayerInventory> query = entities.PlayerInventory

                                                     .Where(x => x.ItemID == item.Id);
                return(query.ToList());
            }
        }
Ejemplo n.º 19
0
        public static List <Items> GetDistinctCategory()
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IOrderedQueryable <Items> query = entities.Items
                                                  .OrderBy(x => x.Catagory);

                return(query.ToList());
            }
        }
Ejemplo n.º 20
0
 public static Trainer SelectTrainer(int trainerId)
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IQueryable <Trainer> query = entities.Trainer
                                      .Include("PlayerInventory")
                                      .Include("Pokemon")
                                      .Include("PokemonGroup")
                                      .Where(x => x.Id == trainerId);
         return(query.SingleOrDefault());
     }
 }
Ejemplo n.º 21
0
        public static List <LearnedMoves> SelectMovesFromPokemon(Pokemon pokemon)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IOrderedQueryable <LearnedMoves> query = entities.LearnedMoves
                                                         .Include("PokemonMoves")
                                                         .Include("PokemonMoves.Types")
                                                         .Where(x => x.PokemonId == pokemon.Id)
                                                         .OrderBy(x => x.Position);

                return(query.ToList());
            }
        }
Ejemplo n.º 22
0
 public static List <PlayerInventory> GetItems(int trainerId)
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         List <int> query = entities.Items
                            .Select(i => i.Id).ToList();
         IQueryable <PlayerInventory> iquery = entities.PlayerInventory
                                               .Include("Items")
                                               .Include("Trainer")
                                               .Where(x => query.Contains(x.ItemID.Value));
         return(iquery.ToList());
     }
 }
Ejemplo n.º 23
0
 public static List <Pokedex> PokedexEntry()
 {
     using (DB_r0739290Entities entities = new DB_r0739290Entities())
     {
         IOrderedQueryable <Pokedex> query = entities.Pokedex
                                             .Include("Types")
                                             .Include("Types1")
                                             .Include("Types.Pokedex")
                                             .Include("Types.Pokedex1")
                                             .OrderBy(x => x.Id);
         return(query.ToList());
     }
 }
Ejemplo n.º 24
0
        public static List <PokemonMoves> AllMovesExceptCurrent(Pokemon pokemon)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                List <int?> iQuery = entities.LearnedMoves
                                     .Where(x => x.PokemonId == pokemon.Id)
                                     .Select(i => i.MoveId).ToList();;

                IOrderedQueryable <PokemonMoves> query = entities.PokemonMoves
                                                         .Where(x => !iQuery.Contains(x.Id))
                                                         .OrderBy(x => x.Id);
                return(query.ToList());
            }
        }
Ejemplo n.º 25
0
        public static List <PlayerInventory> SelectAllInventory(string category)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                List <int> iQuery = entities.Items
                                    .Where(i => i.Catagory.ToString() == category)
                                    .Select(i => i.Id).ToList();

                IQueryable <PlayerInventory> query = entities.PlayerInventory
                                                     .Include("Items")
                                                     .Include("Trainer")
                                                     .Where(x => iQuery.Contains(x.ItemID.Value));
                return(query.ToList());
            }
        }
Ejemplo n.º 26
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);
     }
 }
Ejemplo n.º 27
0
        public static PokemonGroup SelectPokemonFromParty(int trainerID, int position)
        {
            using (DB_r0739290Entities entities = new DB_r0739290Entities())
            {
                IQueryable <PokemonGroup> query = entities.PokemonGroup
                                                  .Include("Pokemon")
                                                  .Include("Pokemon.Statpool")
                                                  .Include("Pokemon.Statpool.BaseStats")
                                                  .Include("Pokemon.Statpool.EVStats")
                                                  .Include("Pokemon.Statpool.IVStats")
                                                  .Where(x => x.PlayerId == trainerID && x.Position == position);


                return(query.SingleOrDefault());
            }
        }
Ejemplo n.º 28
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);
     }
 }
Ejemplo n.º 29
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);
     }
 }
Ejemplo n.º 30
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);
            }
        }