コード例 #1
0
        public bool AddRssFeeds(RssFeedRequest request)
        {
            bool result = false;

            try
            {
                SqlSvrDAL     dal     = new SqlSvrDAL(request.ClientInfo);
                RSSFeedMaster rSSFeed = new RSSFeedMaster();
                rSSFeed.ID = request.ID;
                rSSFeed.DescriptionNode  = request.DescriptionNode;
                rSSFeed.itemNodePath     = request.itemNodePath;
                rSSFeed.RSSFeedUrl       = request.RSSFeedUrl;
                rSSFeed.PubDateNode      = request.PubDateNode;
                rSSFeed.rssFeedOrder     = request.rssFeedOrder;
                rSSFeed.TitleNode        = request.TitleNode;
                rSSFeed.Title            = request.Title;
                rSSFeed.hrfTitleNodePath = request.hrfTitleNodePath;
                result = dal.AddRssFeeds(rSSFeed);
            }
            catch (Exception ex)
            {
                //LogHelper.AddLog("RSSController,AddRssFeeds", ex.Message, ex.StackTrace, "HCL.Academy.Service", request.ClientInfo.emailId);
                TelemetryClient telemetry = new TelemetryClient();
                telemetry.TrackException(ex);
            }
            return(result);
        }
コード例 #2
0
        public RSSFeedMaster GetRssFeedById(RequestBase request, int id)
        {
            SqlSvrDAL     dal     = new SqlSvrDAL(request.ClientInfo);
            RSSFeedMaster rSSFeed = new RSSFeedMaster();

            rSSFeed = dal.GetRssFeedById(id);
            return(rSSFeed);
        }
コード例 #3
0
        public async Task <ActionResult> Edit(int id)
        {
            InitializeServiceClient();
            RSSFeedMaster       rSS      = new RSSFeedMaster();
            HttpResponseMessage response = await client.PostAsJsonAsync("RSS/GetRssFeedById/" + id.ToString(), req);

            rSS = await response.Content.ReadAsAsync <RSSFeedMaster>();

            return(View(rSS));
        }
コード例 #4
0
        public async Task <ActionResult> Edit(RSSFeedMaster feed)
        {
            try
            {
                InitializeServiceClient();
                bool           result  = false;
                RssFeedRequest rssFeed = new RssFeedRequest();
                rssFeed.ClientInfo       = req.ClientInfo;
                rssFeed.ID               = feed.ID;
                rssFeed.DescriptionNode  = feed.DescriptionNode;
                rssFeed.itemNodePath     = feed.itemNodePath;
                rssFeed.RSSFeedUrl       = feed.RSSFeedUrl;
                rssFeed.PubDateNode      = feed.PubDateNode;
                rssFeed.rssFeedOrder     = feed.rssFeedOrder;
                rssFeed.Title            = feed.Title;
                rssFeed.TitleNode        = feed.TitleNode;
                rssFeed.hrfTitleNodePath = feed.hrfTitleNodePath;
                HttpResponseMessage response = await client.PostAsJsonAsync("RSS/UpdateRssFeeds", rssFeed);

                result = await response.Content.ReadAsAsync <bool>();

                if (result)
                {
                    TempData["Message"] = "Rss Feed updated successfully.";
                    TempData.Keep();
                }
                else
                {
                    TempData["Message"] = "Rss Feed was not updated due to an error.";
                    TempData.Keep();
                }
            }
            catch (Exception ex)
            {
                //LogHelper.AddLog("RSSController", ex.Message, ex.StackTrace, "HCL.Academy.Web", user.EmailID);
                TelemetryClient telemetry = new TelemetryClient();
                telemetry.TrackException(ex);
            }
            return(RedirectToAction("Index"));
        }
コード例 #5
0
        public ActionResult Create()
        {
            RSSFeedMaster rSS = new RSSFeedMaster();

            return(View(rSS));
        }