void InitInfo() { if (Request.QueryString[NewsInfoParams.NEWSID] != null) { int newsId = TypeConverter.ToInt32(Request.QueryString[NewsInfoParams.NEWSID]); News = NewsFacade.GetById(newsId); if (News != null) { DataBind(); return; } } if (UserAgentUtils.IsSearchBot) { Response.Clear(); Response.StatusCode = (int)HttpStatusCode.NotFound; Response.Close(); } else { err.Visible = true; info.Visible = false; err.Text = CommonResources.NewsNotFound; } }
public static GT.BO.Implementation.News.News CreateNews() { Guid uniqueNews = Guid.NewGuid(); GT.BO.Implementation.News.News n = new GT.BO.Implementation.News.News(); n.Title = String.Format("test title {0}", uniqueNews); n.Body = String.Format("test body {0}", uniqueNews); return n; }
void InitInfo() { if (Request.QueryString[NewsInfoParams.NEWSID] != null) { int newsId = TypeConverter.ToInt32(Request.QueryString[NewsInfoParams.NEWSID]); News = NewsFacade.GetById(newsId); if (News != null) { DataBind(); return; } } err.Visible = true; info.Visible = false; err.Text = CommonResources.NewsNotFound; }
public static string CutNews(News n) { return n.LocalizedBody.Length <= MAX_NEWS_LENGTH ? n.LocalizedBody : n.LocalizedBody.Substring(0, n.LocalizedBody.LastIndexOf(' ', MAX_NEWS_LENGTH + 1, MAX_NEWS_LENGTH)) + "..."; }
public static News Add(News n) { return new News().Load<News>(NewsDataAdapter.Add(n)); }