예제 #1
0
 partial void DeletePlayerInjuryHistory(PlayerInjuryHistory instance);
예제 #2
0
 partial void UpdatePlayerInjuryHistory(PlayerInjuryHistory instance);
예제 #3
0
 partial void InsertPlayerInjuryHistory(PlayerInjuryHistory instance);
예제 #4
0
		private void detach_PlayerInjuryHistories(PlayerInjuryHistory entity)
		{
			this.SendPropertyChanging();
			entity.Players = null;
		}
예제 #5
0
		private void attach_PlayerInjuryHistories(PlayerInjuryHistory entity)
		{
			this.SendPropertyChanging();
			entity.InjuryStatus = this;
		}
예제 #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;
            }
        }