Esempio n. 1
0
 public void AddPrize(Prize prize)
 {
     prize.Listing = this;
     this.Prize = prize;
 }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
 /// <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;
 }
Esempio n. 4
0
 public void InsertPrize(Prize prize)
 {
     context.Prizes.Add(prize);
 }