Ejemplo n.º 1
0
        public Giveaway RemoveGiveaway(Giveaway giveaway)
        {
            if (Giveaways.Contains(giveaway))
            {
                this.Giveaways.Remove(giveaway);
                return giveaway;
            }

            return null;
        }
Ejemplo n.º 2
0
 public void AddGiveaway(Giveaway giveaway)
 {
     giveaway.Listing = this;
     this.Giveaways.Add(giveaway);
 }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 4
0
 public ActivityFeedContainer(Giveaway giveaway, DateTime date)
     : this()
 {
     ItemDate = date;
     CreatedGiveaway = giveaway;
 }
Ejemplo n.º 5
0
 public void InsertGiveaway(Giveaway giveaway)
 {
     context.Giveaways.Add(giveaway);
 }