Esempio n. 1
0
 partial void DeleteTEAM(TEAM instance);
Esempio n. 2
0
 partial void InsertTEAM(TEAM instance);
Esempio n. 3
0
 partial void UpdateTEAM(TEAM instance);
Esempio n. 4
0
        private TEAM GetTeam(string TeamName)
        {
            TEAM team = (from t in mlbData.TEAMs
                         where t.City + " " + t.Nickname == TeamName
                         select t).SingleOrDefault();

            if (team == null)
            {
                //add team
                team = new TEAM();
                string[] teamParts = TeamName.Split(' ');
                team.City = teamParts[0];
                for (int i = 1; i < teamParts.Length; i++)
                {
                    team.Nickname += teamParts[i];
                }
                team.Franchise = 31;
                team.Division = 1;
                team.YearStarted = 2000;
                team.YearEnded = 2000;
                mlbData.TEAMs.InsertOnSubmit(team);
                mlbData.SubmitChanges();
            }

            return team;
        }