public Giveaway RemoveGiveaway(Giveaway giveaway) { if (Giveaways.Contains(giveaway)) { this.Giveaways.Remove(giveaway); return giveaway; } return null; }
public void AddGiveaway(Giveaway giveaway) { giveaway.Listing = this; this.Giveaways.Add(giveaway); }
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); } } }
public ActivityFeedContainer(Giveaway giveaway, DateTime date) : this() { ItemDate = date; CreatedGiveaway = giveaway; }
public void InsertGiveaway(Giveaway giveaway) { context.Giveaways.Add(giveaway); }