using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using basic; using WebApp.Components; using System.Text; public partial class Product : System.Web.UI.Page { public MyClass mc = new MyClass(); public BasicPage bp = new BasicPage(); public int ClassID; public string strParentColumnName = null; public string strColumnName = "产品展示"; public string strColumnSubName = "PRODUCTS"; public string strPath = null; public SystemTools systemtools = new SystemTools(); public string yangban; public int intTypeID; protected void Page_Load(object sender, EventArgs e) { //调用类 Common common = new Common(); //读取整站SEO的设置信息 ClientSEO clientseo = common.showSEO(); this.Title = strColumnName + "-" + mc.ShowWebsiteKeyById(1, "CompanyName"); description.Attributes["content"] = clientseo.WebDescription; keywords.Attributes["content"] = clientseo.WebKeywords; intTypeID = basic.Tools.RequestClass.GetQueryInt("TypeID", 0); if (!Page.IsPostBack) { showseo(); showNews3(); } } //显示seo public void showseo() { if (intTypeID > 0) { SqlDataReader reader = bp.getRead("select content,context from ProClass where id=" + intTypeID); if (reader.Read()) { string neiron = reader["content"].ToString(); string context = reader["context"].ToString(); this.Title = context + "-" + mc.ShowWebsiteKeyById(1, "CompanyName"); //seo int len = neiron.Split('^').Length; if (len > 1) { if (!string.IsNullOrEmpty(neiron.Split('^')[1].ToString())) this.Title = neiron.Split('^')[1]; if (!string.IsNullOrEmpty(neiron.Split('^')[2].ToString())) description.Attributes["content"] = neiron.Split('^')[2]; if (!string.IsNullOrEmpty(neiron.Split('^')[3].ToString())) keywords.Attributes["content"] = neiron.Split('^')[3]; } } reader.Close(); } else { SqlDataReader reader = bp.getRead("select ColumnTitle,ColumnDescription,ColumnKeywords from ColumnList where ColumnType='产品列表' order by ColumnNo desc,id asc"); if (reader.Read()) { string ColumnTitle = reader["ColumnTitle"].ToString(); string ColumnDescription = reader["ColumnDescription"].ToString(); string ColumnKeywords = reader["ColumnKeywords"].ToString(); //seo if (!string.IsNullOrEmpty(ColumnTitle)) this.Title = ColumnTitle; if (!string.IsNullOrEmpty(ColumnDescription)) description.Attributes["content"] = ColumnDescription; if (!string.IsNullOrEmpty(ColumnKeywords)) keywords.Attributes["content"] = ColumnKeywords; } reader.Close(); } } //产品分类 public DataTable dtblNew3 = new DataTable(); public int intNews3; private void showNews3() { dtblNew3 = bp.SelectDataBase("ProClass", "select * from ProClass where ParentId=0 and State=0 order by Paixu desc,Id asc").Tables[0]; intNews3 = dtblNew3.Rows.Count; } //产品展示 public DataTable dtPro = new DataTable(); public int intPro; public void showPro(int classid) { dtPro = bp.SelectDataBase("product", "select ProName,ProPath,ProId from product where classid like '%," + classid + ",%' order by paixu desc,proid desc").Tables[0]; intPro = dtPro.Rows.Count; } }