Example #1
0
 partial void DeletePlayerInjuryHistory(PlayerInjuryHistory instance);
Example #2
0
 partial void UpdatePlayerInjuryHistory(PlayerInjuryHistory instance);
Example #3
0
 partial void InsertPlayerInjuryHistory(PlayerInjuryHistory instance);
Example #4
0
		private void detach_PlayerInjuryHistories(PlayerInjuryHistory entity)
		{
			this.SendPropertyChanging();
			entity.Players = null;
		}
Example #5
0
		private void attach_PlayerInjuryHistories(PlayerInjuryHistory entity)
		{
			this.SendPropertyChanging();
			entity.InjuryStatus = this;
		}
Example #6
0
        private static PlayerInjuryHistory InsertPlayerInjuryHistory(NPGGFFLDataContext context, int playerId, int injuryStatusId, string description, DateTime reportDtm)
        {
            var pihExists = context.PlayerInjuryHistories.Where(pih => pih.PlayerId == playerId && pih.ReportDtm == reportDtm && pih.InjuryStatusId == injuryStatusId).FirstOrDefault();
            if (pihExists == null)
            {
                PlayerInjuryHistory pih = new PlayerInjuryHistory
                {
                    PlayerId = playerId,
                    InjuryStatusId = injuryStatusId,
                    Description = description,
                    ReportDtm = reportDtm
                };

                context.PlayerInjuryHistories.InsertOnSubmit(pih);
                context.SubmitChanges();
                return context.PlayerInjuryHistories.Where(pih2 => pih2.PlayerId == playerId && pih2.ReportDtm == reportDtm && pih2.InjuryStatusId == injuryStatusId).First();
            }
            else
            {
                return pihExists;
            }
        }