예제 #1
0
        public Giveaway RemoveGiveaway(Giveaway giveaway)
        {
            if (Giveaways.Contains(giveaway))
            {
                this.Giveaways.Remove(giveaway);
                return giveaway;
            }

            return null;
        }
예제 #2
0
 public void AddGiveaway(Giveaway giveaway)
 {
     giveaway.Listing = this;
     this.Giveaways.Add(giveaway);
 }
예제 #3
0
        public void UpdateGiveaway(Giveaway giveaway)
        {
            Giveaway targetGiveaway = context.Giveaways.Find(giveaway.GiveawayID);

            if (targetGiveaway != null)
            {
                targetGiveaway.EndDate = giveaway.EndDate;
                targetGiveaway.EntryFee = giveaway.EntryFee;
                targetGiveaway.ListingID = giveaway.ListingID;
                targetGiveaway.PointsPrize = giveaway.PointsPrize;
                targetGiveaway.Prize = giveaway.Prize;
                targetGiveaway.CreatedTime = giveaway.CreatedTime;
                targetGiveaway.StartDate = giveaway.StartDate;
                targetGiveaway.CreatorID = giveaway.CreatorID;
                targetGiveaway.WinnerID = giveaway.WinnerID;
            }

            foreach (GiveawayEntry entry in giveaway.GiveawayEntries)
            {
                if (entry.GiveawayEntryID == 0)
                {
                    InsertGiveawayEntry(entry);
                }
                else
                {
                    UpdateGiveawayEntry(entry);
                }
            }
        }
예제 #4
0
 public ActivityFeedContainer(Giveaway giveaway, DateTime date)
     : this()
 {
     ItemDate = date;
     CreatedGiveaway = giveaway;
 }
예제 #5
0
 public void InsertGiveaway(Giveaway giveaway)
 {
     context.Giveaways.Add(giveaway);
 }