本文整理汇总了C#中Content.GetNextNews方法的典型用法代码示例。如果您正苦于以下问题:C# Content.GetNextNews方法的具体用法?C# Content.GetNextNews怎么用?C# Content.GetNextNews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Content
的用法示例。
在下文中一共展示了Content.GetNextNews方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Detail
public ActionResult Detail(string key)
{
key = key.ToLower();
ViewBag.VideoHeight = (Request.Browser.IsMobileDevice) ? 190 : 400;
ViewBag.VideoWidth = (Request.Browser.IsMobileDevice) ? 285 : 600;
var modelOut = new ContentModel();
string cacheKey = string.Concat(Lib.BOL.UserContent.Content.Key, key, Utilities.GetCurrentLanguageCode());
if (HttpRuntime.Cache[cacheKey] == null)
{
var model = new Content(key);
modelOut.ThumbIcon = Utilities.S3ContentPath(model.ContentPhotoThumbURL);
var otherNews = new Content();
otherNews.GetPreviousNews(model.ReleaseDate);
if (otherNews.ContentID > 0)
{
modelOut.PreviousNews = otherNews.ToUnorderdListItem;
}
otherNews = new Content();
otherNews.GetNextNews(model.ReleaseDate);
if (otherNews.ContentID > 0)
{
modelOut.NextNews = otherNews.ToUnorderdListItem;
}
if (!string.IsNullOrWhiteSpace(model.ContentVideoURL2) &&
string.IsNullOrWhiteSpace(model.ContentVideoURL))
{
// TODO: parse just the key, it's currently requiring the embed
model.ContentVideoURL2 = string.Concat(model.ContentVideoURL2, "?rel=0");
modelOut.VideoWidth = "100%";
}
modelOut.ContentID = model.ContentID;
modelOut.ContentKey = model.ContentKey;
modelOut.ContentPhotoThumbURL = model.ContentPhotoThumbURL;
modelOut.ContentPhotoURL = model.ContentPhotoURL;
modelOut.ContentTypeID = model.ContentTypeID;
modelOut.ContentVideoURL = model.ContentVideoURL;
modelOut.ContentVideoURL2 = model.ContentVideoURL2;
modelOut.CurrentStatus = model.CurrentStatus;
modelOut.Detail = model.Detail;
modelOut.IsEnabled = model.IsEnabled;
modelOut.Language = model.Language;
modelOut.MetaDescription = model.MetaDescription;
modelOut.MetaKeywords = model.MetaKeywords;
modelOut.OutboundURL = model.OutboundURL;
modelOut.ReleaseDate = model.ReleaseDate;
modelOut.SiteDomainID = model.SiteDomainID;
modelOut.Title = model.Title;
modelOut.UrlTo = model.UrlTo;
modelOut.CreateDate = model.CreateDate;
modelOut.CreatedByUserID = model.CreatedByUserID;
modelOut.UpdateDate = model.UpdateDate;
modelOut.UpdatedByUserID = model.UpdatedByUserID;
HttpRuntime.Cache.AddObjToCache(modelOut, cacheKey);
}
else
{
modelOut = (ContentModel) HttpRuntime.Cache[cacheKey];
}
return View(modelOut);
}