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); }
public RSSFeedMaster GetRssFeedById(RequestBase request, int id) { SqlSvrDAL dal = new SqlSvrDAL(request.ClientInfo); RSSFeedMaster rSSFeed = new RSSFeedMaster(); rSSFeed = dal.GetRssFeedById(id); return(rSSFeed); }
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)); }
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")); }
public ActionResult Create() { RSSFeedMaster rSS = new RSSFeedMaster(); return(View(rSS)); }