public static List <Article> Trigger(Model.KeywordInfo keywordInfo, ELotteryType lotteryType, string requestFromUserName) { var articleList = new List <Article>(); DataProviderWx.CountDao.AddCount(keywordInfo.PublishmentSystemId, ECountType.RequestNews); var lotteryInfoList = DataProviderWx.LotteryDao.GetLotteryInfoListByKeywordId(keywordInfo.PublishmentSystemId, lotteryType, keywordInfo.KeywordId); var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(keywordInfo.PublishmentSystemId); foreach (var lotteryInfo in lotteryInfoList) { Article article = null; if (lotteryInfo != null && lotteryInfo.StartDate < DateTime.Now) { var isEnd = false; if (lotteryInfo.EndDate < DateTime.Now) { isEnd = true; } if (isEnd) { var endImageUrl = GetEndImageUrl(publishmentSystemInfo, lotteryType, lotteryInfo.EndImageUrl); article = new Article() { Title = lotteryInfo.EndTitle, Description = lotteryInfo.EndSummary, PicUrl = endImageUrl }; } else { var imageUrl = GetImageUrl(publishmentSystemInfo, lotteryType, lotteryInfo.ImageUrl); var pageUrl = GetLotteryUrl(publishmentSystemInfo, lotteryInfo, requestFromUserName); article = new Article() { Title = lotteryInfo.Title, Description = lotteryInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } } if (article != null) { articleList.Add(article); } } return(articleList); }
public static List <Article> Trigger(PublishmentSystemInfo publishmentSystemInfo, Model.KeywordInfo keywordInfo, string wxOpenId) { var articleList = new List <Article>(); DataProviderWX.CountDAO.AddCount(keywordInfo.PublishmentSystemID, ECountType.RequestNews); var albumInfoList = DataProviderWX.AlbumDAO.GetAlbumInfoListByKeywordID(keywordInfo.PublishmentSystemID, keywordInfo.KeywordID); foreach (var albumInfo in albumInfoList) { Article article = null; if (albumInfo != null) { var imageUrl = GetImageUrl(publishmentSystemInfo, albumInfo.ImageUrl); var pageUrl = GetAlbumUrl(publishmentSystemInfo, albumInfo, wxOpenId); article = new Article { Title = albumInfo.Title, Description = albumInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } if (article != null) { articleList.Add(article); } } return(articleList); }
//public static List<ContentInfo> GetContentInfoList(PublishmentSystemInfo publishmentSystemInfo, int nodeID, string keywords) //{ // List<ContentInfo> contentInfoList = new List<ContentInfo>(); // if (nodeID > 0) // { // contentInfoList = DataProvider.BackgroundContentDAO. // } // if (!string.IsNullOrEmpty(keyWords)) // { // contentInfoList = DataProvider.ContentDAO.GetContentInfoList(ETableStyle.Site, publishmentSystemInfo.AuxiliaryTableForContent, publishmentSystemID, nodeID, keyWords); // } // return contentInfoList; //} public static List <Article> Trigger(PublishmentSystemInfo publishmentSystemInfo, Model.KeywordInfo keywordInfo, string wxOpenID) { var articleList = new List <Article>(); DataProviderWx.CountDao.AddCount(keywordInfo.PublishmentSystemId, ECountType.RequestNews); var searchInfoList = DataProviderWx.SearchDao.GetSearchInfoListByKeywordId(keywordInfo.PublishmentSystemId, keywordInfo.KeywordId); foreach (var searchInfo in searchInfoList) { Article article = null; if (searchInfo != null) { var imageUrl = GetImageUrl(publishmentSystemInfo, searchInfo.ImageUrl); var pageUrl = GetSearchUrl(publishmentSystemInfo, searchInfo); article = new Article { Title = searchInfo.Title, Description = searchInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } if (article != null) { articleList.Add(article); } } return(articleList); }
public static List <Article> Trigger(PublishmentSystemInfo publishmentSystemInfo, Model.KeywordInfo keywordInfo, string wxOpenID) { var articleList = new List <Article>(); DataProviderWx.CountDao.AddCount(keywordInfo.PublishmentSystemId, ECountType.RequestNews); var voteInfoList = DataProviderWx.VoteDao.GetVoteInfoListByKeywordId(keywordInfo.PublishmentSystemId, keywordInfo.KeywordId); foreach (var voteInfo in voteInfoList) { Article article = null; if (voteInfo != null && voteInfo.StartDate < DateTime.Now) { var isEnd = false; if (voteInfo.EndDate < DateTime.Now) { isEnd = true; } if (isEnd) { var endImageUrl = GetEndImageUrl(publishmentSystemInfo, voteInfo.EndImageUrl); article = new Article() { Title = voteInfo.EndTitle, Description = voteInfo.EndSummary, PicUrl = endImageUrl }; } else { var imageUrl = GetImageUrl(publishmentSystemInfo, voteInfo.ImageUrl); var pageUrl = GetVoteUrl(publishmentSystemInfo, voteInfo, wxOpenID); article = new Article() { Title = voteInfo.Title, Description = voteInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } } if (article != null) { articleList.Add(article); } } return(articleList); }
public static List <Article> Trigger(Model.KeywordInfo keywordInfo, string keyword, string requestFromUserName) { var articleList = new List <Article>(); DataProviderWX.CountDAO.AddCount(keywordInfo.PublishmentSystemID, ECountType.RequestNews); var actInfoList = DataProviderWX.CouponActDAO.GetActInfoListByKeywordID(keywordInfo.PublishmentSystemID, keywordInfo.KeywordID); var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(keywordInfo.PublishmentSystemID); foreach (var actInfo in actInfoList) { Article article = null; if (actInfo != null && actInfo.StartDate < DateTime.Now) { var isEnd = false; var snID = 0; if (actInfo.EndDate < DateTime.Now) { isEnd = true; } else { snID = DataProviderWX.CouponSNDAO.Hold(keywordInfo.PublishmentSystemID, actInfo.ID, requestFromUserName); if (snID == 0) { isEnd = true; } } if (isEnd) { var endImageUrl = GetEndImageUrl(publishmentSystemInfo, actInfo.EndImageUrl); article = new Article() { Title = actInfo.EndTitle, Description = actInfo.EndSummary, PicUrl = endImageUrl }; } else { var imageUrl = GetImageUrl(publishmentSystemInfo, actInfo.ImageUrl); var pageUrl = GetCouponHoldUrl(publishmentSystemInfo, actInfo.ID); article = new Article() { Title = actInfo.Title, Description = actInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } } if (article != null) { articleList.Add(article); } } return(articleList); }
public static List <Article> Trigger(Model.KeywordInfo keywordInfo, string wxOpenID) { var articleList = new List <Article>(); DataProviderWx.CountDao.AddCount(keywordInfo.PublishmentSystemId, ECountType.RequestNews); var appointmentInfoList = DataProviderWx.AppointmentDao.GetAppointmentInfoListByKeywordId(keywordInfo.PublishmentSystemId, keywordInfo.KeywordId); var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(keywordInfo.PublishmentSystemId); foreach (var appointmentInfo in appointmentInfoList) { Article article = null; if (appointmentInfo != null && appointmentInfo.StartDate < DateTime.Now) { var isEnd = false; if (appointmentInfo.EndDate < DateTime.Now) { isEnd = true; } if (isEnd) { var endImageUrl = GetEndImageUrl(publishmentSystemInfo, appointmentInfo.EndImageUrl); article = new Article() { Title = appointmentInfo.EndTitle, Description = appointmentInfo.EndSummary, PicUrl = endImageUrl }; } else { var imageUrl = GetImageUrl(publishmentSystemInfo, appointmentInfo.ImageUrl); var pageUrl = GetIndexUrl(publishmentSystemInfo, appointmentInfo.Id, wxOpenID); if (appointmentInfo.ContentIsSingle) { var itemID = DataProviderWx.AppointmentItemDao.GetItemId(publishmentSystemInfo.PublishmentSystemId, appointmentInfo.Id); pageUrl = GetItemUrl(publishmentSystemInfo, appointmentInfo.Id, itemID, wxOpenID); } article = new Article() { Title = appointmentInfo.Title, Description = appointmentInfo.Summary, PicUrl = imageUrl, Url = pageUrl }; } } if (article != null) { articleList.Add(article); } } return(articleList); }