protected void btnAddFeed_Click(object sender, EventArgs e) { var feed = tbFeedUrl.Text; var subreddit = tbSubReddit.Text; var interval = int.Parse(tbInterval.Text); var ctx = new RedditRSSEntities(); var selectedUserID = int.Parse(ddlUsers.SelectedValue); var user = ctx.RedditUsers.Where(x => x.ID == selectedUserID).FirstOrDefault(); var botData = new RedditRSSBotData() { FeedUrl = feed, Subreddit = subreddit, RedditUser = user, Interval = interval }; ctx.RedditRSSBotDatas.Add(botData); ctx.SaveChanges(); var manager = RedditRSSBotManager.Instance; manager.AddBot(botData.CreateBot()); ucBotList.DataBind(); }
public RedditRSSBot(RedditRSSBotData data) { LastSubmitted = new Queue <RedditSubmission>(); RedditRSSBotData = data; }