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