Beispiel #1
0
 public void savePlayer(int playerId, string playerName, string playerPositionCode, string playerHW)
 {
     using (var context = new ModelTrophy())
     {
         context.Players.Add(new Player {
             Id = playerId, Name = playerName, PositionCode = playerPositionCode, TrophyCode = playerHW
         });
         context.SaveChanges();
     }
 }
Beispiel #2
0
        public IEnumerable <Player> getPlayers()
        {
            using (var context = new ModelTrophy())
            {
                var player = from playerDict in context.Players
                             orderby playerDict.PositionCode
                             select playerDict;

                if (player.Any())
                {
                    return(player.ToList());
                }
            }
            return(null);
        }
Beispiel #3
0
        public Player getPlayerById(string playerId)
        {
            using (var context = new ModelTrophy())
            {
                var player = from playerDict in context.Players
                             where playerDict.TrophyCode == playerId
                             select playerDict;

                if (player.Any())
                {
                    return(player.First());
                }
            }
            return(null);
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            var connectionString = ConfigurationManager.ConnectionStrings["ModelTrophy"].ConnectionString;

            using (var context = new ModelTrophy(connectionString))
            {
                // Age
                new ContextBroker().saveSkillInDictionary(1, "age", "Age", "Wiek");

                // ASI
                new ContextBroker().saveSkillInDictionary(2, "asi", "ASI", "ASI");

                // Routine
                new ContextBroker().saveSkillInDictionary(3, "routine", "Routine", "Doświadczenie");

                // Strength
                new ContextBroker().saveSkillInDictionary(4, "str", "Strength", "Siła");

                // Stamina
                new ContextBroker().saveSkillInDictionary(5, "sta", "Stamina", "Wytrzymałość");

                // Pace
                new ContextBroker().saveSkillInDictionary(6, "pac", "Pace", "Szybkość");

                // Marking
                new ContextBroker().saveSkillInDictionary(7, "mar", "Marking", "Krycie");

                // Tacking
                new ContextBroker().saveSkillInDictionary(8, "tac", "Tacking", "Odbiór");

                // Workrate
                new ContextBroker().saveSkillInDictionary(9, "wor", "Workrate", "Pracowitość");

                // Positioning
                new ContextBroker().saveSkillInDictionary(10, "pos", "Positioning", "Ustawianie się");

                // Passing
                new ContextBroker().saveSkillInDictionary(11, "pas", "Passing", "Podania");

                // Crossing
                new ContextBroker().saveSkillInDictionary(12, "cro", "Crossing", "Dośrodkowania");

                // Technique
                new ContextBroker().saveSkillInDictionary(13, "tec", "Technique", "Technika");

                // Heading
                new ContextBroker().saveSkillInDictionary(14, "hea", "Heading", "Główkowanie");

                // Finishing
                new ContextBroker().saveSkillInDictionary(15, "fin", "Finishing", "Wykańczanie");

                // Longshots
                new ContextBroker().saveSkillInDictionary(16, "log", "Longshots", "Strzały z dystansu");

                // Set Pieces
                new ContextBroker().saveSkillInDictionary(17, "set", "Set Pieces", "Stałe fragmenty");

                // Handing
                new ContextBroker().saveSkillInDictionary(18, "han", "Handing", "Łapanie");

                // One-on-ones
                new ContextBroker().saveSkillInDictionary(19, "one", "One-on-ones", "Jeden na jednego");

                // Reflexes
                new ContextBroker().saveSkillInDictionary(20, "ref", "Reflexes", "Refleks");

                // Aerial Ability
                new ContextBroker().saveSkillInDictionary(21, "ari", "Aerial Ability", "Gra w powietrzu");

                // Jumping
                new ContextBroker().saveSkillInDictionary(22, "jum", "Jumping", "Skoczność");

                // Communication
                new ContextBroker().saveSkillInDictionary(23, "com", "Communication", "Komunikacja");

                // Kicking
                new ContextBroker().saveSkillInDictionary(24, "kic", "Kicking", "Wykop");

                // Throwing
                new ContextBroker().saveSkillInDictionary(25, "thr", "Throwing", "Rzucanie");
            }
        }