protected void Page_Load(object sender, EventArgs e) { if (Session["LanguageID"] != null) g_LanguageID = Convert.ToInt32(Session["LanguageID"].ToString()); if (!IsPostBack) { BLL.News b_News = new BLL.News(); Entity.News[] e_News; e_News = b_News.Select_News(3, g_LanguageID, 3, 1); if (e_News != null) { foreach (Entity.News o_News in e_News) { HyperLink o_HyperLink = new HyperLink(); o_HyperLink.NavigateUrl = "../News_Detail.aspx?News_ID=" + o_News.News_ID.ToString(); if (o_News.News_Title.Length > 24) o_HyperLink.Text = o_News.News_Title.Substring(0, 24); else o_HyperLink.Text = o_News.News_Title; o_HyperLink.CssClass = "nav8"; Form_Controls.Controls.Add(o_HyperLink); HtmlGenericControl o_HtmlGenericControl = new HtmlGenericControl(); o_HtmlGenericControl.InnerHtml = "<br/>"; Form_Controls.Controls.Add(o_HtmlGenericControl); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetHyperLinkTitle(HyperLink_Title); if (g_News_ClassID == 1 || g_News_ClassID == 2) SetHyperLinkNewsClass(HyperLink_News_ClassID_1, HyperLink_News_ClassID_2); else { HyperLink_News_ClassID_1.Visible = false; HyperLink_News_ClassID_2.Visible = false; } BLL.News b_News = new BLL.News(); Entity.News e_News = b_News.Select_News(g_News_ID); if (e_News != null) { g_News_ClassID = e_News.News_ClassID; SetHyperLinkNews(HyperLink_News); News_Content.InnerHtml += "<h1><strong>" + e_News.News_Title + "</strong></h1>"; News_Content.InnerHtml += e_News.News_Content; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetHyperLinkTitle(HyperLink_Title); SetHyperLinkNews(HyperLink_News); if (g_News_ClassID == 1 || g_News_ClassID == 2) SetHyperLinkNewsClass(HyperLink_News_ClassID_1, HyperLink_News_ClassID_2); else { HyperLink_News_ClassID_1.Visible = false; HyperLink_News_ClassID_2.Visible = false; } BLL.News b_News = new BLL.News(); Entity.News[] e_News = b_News.Select_News(g_News_ClassID, g_LanguageID, 7, g_Page); if (e_News != null) { foreach (Entity.News o_News in e_News) { HtmlGenericControl o_Div = new HtmlGenericControl("div"); o_Div.Attributes.Add("class", "inside3_news"); HtmlGenericControl o_H3 = new HtmlGenericControl("h3"); HtmlGenericControl o_Strong = new HtmlGenericControl("strong"); HtmlAnchor o_Anchor = new HtmlAnchor(); o_Anchor.HRef = "News_Detail.aspx?News_ClassID=" + o_News.News_ClassID.ToString() + "&News_ID=" + o_News.News_ID.ToString(); o_Anchor.InnerText = o_News.News_Title; o_Anchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3"); HtmlGenericControl o_Span = new HtmlGenericControl("span"); o_Span.Style.Add(HtmlTextWriterStyle.Color, "#636363"); o_Span.InnerText = "(" + o_News.News_AddTime.ToShortDateString() + ")"; o_Strong.Controls.Add(o_Anchor); o_Strong.Controls.Add(o_Span); o_H3.Controls.Add(o_Strong); o_Div.Controls.Add(o_H3); o_Span = new HtmlGenericControl("span"); o_Span.Attributes.Add("style", "line-height:20px; color:#636363; text-indent:2em; float:left; width:620px; margin-top:10px;"); if (o_News.News_Intro.Length > 182) o_Span.InnerText = o_News.News_Intro.Substring(0, 182); else o_Span.InnerText = o_News.News_Intro; o_Div.Controls.Add(o_Span); News_Lists.Controls.Add(o_Div); } } } }
protected void Page_Load(object sender, EventArgs e) { b_News = new BLL.News(); if (!IsPostBack) { GetNewsTXT(News_Name); SetLanguageControl(News_LanguageID); switch (g_Action_ID) { case 1: News_AddTime_TD.Visible = false; News_Submit.Text = " 添加 "; break; case 2: if (g_News_ID == 0) ResponseError("参数错误"); e_News = b_News.Select_News(g_News_ID); if (e_News != null) { News_LanguageID.SelectedValue = e_News.News_LanguageID.ToString(); News_AddTime.Text = e_News.News_AddTime.ToString(); News_Intro.Text = e_News.News_Intro; News_Title.Text = e_News.News_Title; News_Content.Value = e_News.News_Content; } News_Submit.Text = " 修改 "; break; case 3: if (g_News_ID == 0) ResponseError("参数错误"); b_News.Delete_News(g_News_ID); ResponseClose("删除成功"); break; } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["LanguageID"] != null) g_LanguageID = Convert.ToInt32(Session["LanguageID"].ToString()); if (!IsPostBack) { BLL.News b_News = new BLL.News(); Entity.News[] e_News; e_News = b_News.Select_News(1, g_LanguageID, 6, 1); if (e_News != null) { foreach (Entity.News o_News in e_News) { HyperLink o_HyperLink = new HyperLink(); o_HyperLink.NavigateUrl = "../News_Detail.aspx?News_ID=" + o_News.News_ID.ToString(); if (o_News.News_Title.Length > 24) o_HyperLink.Text = o_News.News_Title.Substring(0, 24); else o_HyperLink.Text = o_News.News_Title; o_HyperLink.CssClass = "nav8"; Offers_Controls.Controls.Add(o_HyperLink); HtmlGenericControl o_HtmlGenericControl = new HtmlGenericControl(); o_HtmlGenericControl.InnerHtml = "<br/>"; Offers_Controls.Controls.Add(o_HtmlGenericControl); } HyperLink m_HyperLink = new HyperLink(); m_HyperLink.NavigateUrl = "../News_List.aspx?News_ClassID=1"; m_HyperLink.Text = "更多>>>"; m_HyperLink.CssClass = "nav8"; m_HyperLink.Style.Add(HtmlTextWriterStyle.BackgroundImage, "none"); m_HyperLink.Style.Add(HtmlTextWriterStyle.BorderWidth, "0"); m_HyperLink.Style.Add(HtmlTextWriterStyle.TextAlign, "right"); Offers_Controls.Controls.Add(m_HyperLink); } } }
private void GetNews() { BLL.News b_News = new BLL.News(); Entity.News[] e_News = b_News.Select_News(g_News_ClassID, Convert.ToInt32(News_LanguageID.SelectedValue), Search_Content.Text, Convert.ToInt32(Search_Method.SelectedValue), g_PageSize, g_Page); if (e_News != null) { int i = 1; foreach (Entity.News o_News in e_News) { HtmlTableRow o_HtmlTableRow = new HtmlTableRow(); HtmlTableCell o_HtmlTableCell; HtmlAnchor o_HtmlAnchor; HtmlGenericControl o_HtmlGenericControl; o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = ((g_Page - 1) * g_PageSize + i).ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = g_Language[o_News.News_LanguageID]; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_News.News_Title; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_News.News_AddTime.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(2, " + o_News.News_ID.ToString() + ", " + g_News_ClassID.ToString() + ");return false;"); o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2"); o_HtmlAnchor.InnerText = "修改"; o_HtmlTableCell.Controls.Add(o_HtmlAnchor); o_HtmlGenericControl = new HtmlGenericControl(); o_HtmlGenericControl.InnerHtml = " "; o_HtmlTableCell.Controls.Add(o_HtmlGenericControl); o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(3, " + o_News.News_ID.ToString() + ", " + g_News_ClassID.ToString() + ");return false;"); o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2"); o_HtmlAnchor.InnerText = "删除"; o_HtmlTableCell.Controls.Add(o_HtmlAnchor); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableRow.Align = "center"; o_HtmlTableRow.Style.Add(HtmlTextWriterStyle.Height, "30px"); g_MainTable.Rows.Add(o_HtmlTableRow); i++; } Current_Page.Text = g_Page.ToString(); Total_Page.Text = b_News.g_TotalPage.ToString(); Total_Count.Text = b_News.g_TotalCount.ToString(); if (g_Page > 1) { Previous_Page.Visible = true; Previous_Page.CommandArgument = (g_Page - 1).ToString(); } else { Previous_Page.Visible = false; } if (g_Page < b_News.g_TotalPage) { Next_Page.Visible = true; Next_Page.CommandArgument = (g_Page + 1).ToString(); } else { Next_Page.Visible = false; } Current_Page.Visible = true; Splite_Page.Visible = true; Total_Page.Visible = true; } else { Current_Page.Visible = false; Splite_Page.Visible = false; Total_Page.Visible = false; Total_Count.Text = "0"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GetMember_Info(); BLL.News b_News = new BLL.News(); Entity.News[] e_News; e_News = b_News.Select_News(1, g_LanguageID, 5, 1); if (e_News != null) { foreach (Entity.News o_News in e_News) { HyperLink o_HyperLink = new HyperLink(); o_HyperLink.NavigateUrl = "News_Detail.aspx?News_ID=" + o_News.News_ID.ToString(); if (o_News.News_Title.Length > 24) o_HyperLink.Text = o_News.News_Title.Substring(0, 24); else o_HyperLink.Text = o_News.News_Title; o_HyperLink.CssClass = "nav9"; StringBuilder o_StringBuilder = new StringBuilder(); StringWriter o_StringWriter = new StringWriter(o_StringBuilder); HtmlTextWriter o_HtmlTextWriter = new HtmlTextWriter(o_StringWriter); o_HyperLink.RenderControl(o_HtmlTextWriter); News_ClassID_1_Controls.InnerHtml += "<li>" + o_StringBuilder.ToString() + " " + o_News.News_AddTime.ToShortDateString() + "</li>"; } } else News_ClassID_1_More.Visible = false; e_News = b_News.Select_News(2, g_LanguageID, 5, 1); if (e_News != null) { foreach (Entity.News o_News in e_News) { HyperLink o_HyperLink = new HyperLink(); o_HyperLink.NavigateUrl = "News_Detail.aspx?News_ID=" + o_News.News_ID.ToString(); if (o_News.News_Title.Length > 24) o_HyperLink.Text = o_News.News_Title.Substring(0, 24); else o_HyperLink.Text = o_News.News_Title; o_HyperLink.CssClass = "nav9"; StringBuilder o_StringBuilder = new StringBuilder(); StringWriter o_StringWriter = new StringWriter(o_StringBuilder); HtmlTextWriter o_HtmlTextWriter = new HtmlTextWriter(o_StringWriter); o_HyperLink.RenderControl(o_HtmlTextWriter); News_ClassID_2_Controls.InnerHtml += "<li>" + o_StringBuilder.ToString() + " " + o_News.News_AddTime.ToShortDateString() + "</li>"; } } else News_ClassID_2_More.Visible = false; } }