public void AddPrize(Prize prize) { prize.Listing = this; this.Prize = prize; }
public void UpdatePrize(Prize prize) { Prize targetPrize = context.Prizes.Find(prize.PrizeID); if (targetPrize != null) { targetPrize.ChancePerThousand = prize.ChancePerThousand; targetPrize.Description = prize.Description; targetPrize.IsAvailable = prize.IsAvailable; targetPrize.Tier = prize.Tier; } foreach (WonPrize entry in prize.WonPrizes) { if (entry.WonPrizeID == 0) { InsertWonPrize(entry); } else { UpdateWonPrize(entry); } } }
/// <summary> Attaches the specified prize entity to this listing. </summary> /// <param name="prize"> The specified prize entity to attach to this listing. </param> public void AddPrize(Prize prize) { prize.Listing = this; this.Prize = prize; }
public void InsertPrize(Prize prize) { context.Prizes.Add(prize); }