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,
                StatusTypeID=1
            };
            ctx.RedditRSSBotDatas.Add(botData);
            ctx.SaveChanges();

            ucBotList.DataBind();
        }
Exemple #2
0
 public RedditRSSBot(RedditRSSBotData data)
 {
     LastSubmitted = new Queue<RedditSubmission>();
     RedditRSSBotData = data;
 }