コード例 #1
0
        /* *******************************************************
         *
         */
        public void AddLeague(DLeague league)
        {
            using (var cmd = new SqlCmdExt(_connectionString))
            {
                cmd.CreateCmd(@"
                    INSERT INTO League (Name)
                    VALUES (@Name)
                ");
                cmd.SetInArg("@Name", league.Name);

                cmd.ExecuteInsertUpdateDelete();
            }
        }
コード例 #2
0
        /* *******************************************************
         *
         */
        public void AddProspect(DProspect prospect)
        {
            using (var cmd = new SqlCmdExt(_connectionString))
            {
                cmd.CreateCmd(@"
                    INSERT INTO Prospect
                    (
                        Name,
                        TeamId,
                        Height,
                        Weight,
                        PositionId,
                        HandednessId,
                        BirthDay,
                        DraftYear,
                        BirthCity,
                        BirthCountry,
                        Notes
                    )
                    VALUES
                    (
                        @Name,
                        @TeamId,
                        @Height,
                        @Weight,
                        @PositionId,
                        @HandednessId,
                        @BirthDay,
                        @DraftYear,
                        @BirthCity,
                        @BirthCountry,
                        @Notes
                    )");
                cmd.SetInArg("@Name", prospect.Name);
                cmd.SetInArg("@TeamId", prospect.Team.Id);
                cmd.SetInArg("@Height", prospect.Height);
                cmd.SetInArg("@Weight", prospect.Weight);
                cmd.SetInArg("@PositionId", GetPositionId(prospect.Position));
                cmd.SetInArg("@HandednessId", GetHandednessId(prospect.Handedness));
                cmd.SetInArg("@BirthDay", prospect.BirthDay);
                cmd.SetInArg("@DraftYear", prospect.DraftYear);
                cmd.SetInArg("@BirthCity", prospect.BirthCity);
                cmd.SetInArg("@BirthCountry", prospect.BirthCountry);
                cmd.SetInArg("@Notes", prospect.Notes);

                cmd.ExecuteInsertUpdateDelete();
            }
        }
コード例 #3
0
        /* *******************************************************
         *
         */
        public void AddTeam(DTeam team)
        {
            using (var cmd = new SqlCmdExt(_connectionString))
            {
                cmd.CreateCmd(@"
                    INSERT INTO Team (Name, LeagueId)
                    VALUES (@Name, @LeagueId)
                ");
                cmd.SetInArg("@Name", team.Name);
                cmd.SetInArg("@LeagueId", team.League.Id);

                cmd.ExecuteInsertUpdateDelete();
            }
        }