Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 public RedditRSSBot(RedditRSSBotData data)
 {
     LastSubmitted    = new Queue <RedditSubmission>();
     RedditRSSBotData = data;
 }