partial void DeleteInti_TeamAthlete(Inti_TeamAthlete instance);
Ejemplo n.º 2
0
        public void ReloadTransferVersion(IntiDataContext db, Inti_TeamVersion transferVersion, Inti_TeamVersion currentVersion, Guid teamId)
        {
            //delete the ones in transferversion
            var teamAthletesToDelete = transferVersion.Inti_TeamAthlete.ToList();
            db.Inti_TeamAthlete.DeleteAllOnSubmit(teamAthletesToDelete);
            db.SubmitChanges();

            //get players from current version
            foreach (var ta in currentVersion.Inti_TeamAthlete.ToList())
            {
                var newTa = new Inti_TeamAthlete();
                newTa.AthleteGUID = ta.AthleteGUID;
                newTa.TeamVersionGUID = transferVersion.GUID;
                db.Inti_TeamAthlete.InsertOnSubmit(newTa);

                db.SubmitChanges();
            }
        }
 partial void UpdateInti_TeamAthlete(Inti_TeamAthlete instance);
 partial void InsertInti_TeamAthlete(Inti_TeamAthlete instance);
		private void detach_Inti_TeamAthlete(Inti_TeamAthlete entity)
		{
			this.SendPropertyChanging();
			entity.Inti_TeamVersion = null;
		}
		private void attach_Inti_TeamAthlete(Inti_TeamAthlete entity)
		{
			this.SendPropertyChanging();
			entity.Inti_AthleteClub = this;
		}
Ejemplo n.º 7
0
 private void AddPlayer(Guid athleteGuid)
 {
     //test so the player isn't added already
     using (var db = Global.GetConnection())
     {
         var test = from ta in db.Inti_TeamAthlete
                    where ta.AthleteGUID == athleteGuid &&
                             ta.TeamVersionGUID == TeamVersionId
                        select ta;
         if (!test.Any())
         {
             var teamAthlete = new Inti_TeamAthlete();
             teamAthlete.AthleteGUID = athleteGuid;
             teamAthlete.TeamVersionGUID = TeamVersionId;
             db.Inti_TeamAthlete.InsertOnSubmit(teamAthlete);
             db.SubmitChanges();
         }
     }
 }