protected void Page_Load(object sender, EventArgs e) { NewsInfoImpl op = new NewsInfoImpl(); DataSet ds = op.GetNewsInfoByCondition(sum, _istop, condition); Repeater1.DataSource = ds; Repeater1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); id = news.id.ToString(); title = news.title; datetime = news.addtime.ToShortDateString(); scource = news.source == "" ? "不详" : news.source; content = news.newscontent; catname = news.categoryName; catid = news.catid.ToString(); author = news.author == "" ? "工大在线运营团队" : news.author; introduction = Common.CutString((news.introduce == "" ? Common.DelHTML(news.newscontent) : news.introduce), 200); keywords = news.keyword; Page.Title = title; //找出校区 if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) campus = "daxuecheng"; else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) campus = "longdong"; else campus = "dongfenglu"; //增加点击量 pl.UpdateNewsInfoHit(news.id); //评论部分 //CommentImpl cpl = new CommentImpl(); //commentpl.DataSource = cpl.GetCommentbyNewsId(news.id); //commentpl.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { NewsInfoImpl pl = new NewsInfoImpl(); rp.DataSource = pl.GetNewsBy_hit(5, " AND catid =" + catid); rp.DataBind(); CategoryImpl catpl = new CategoryImpl(); catname = catpl.GetCategoryById(catid).catname; }
protected void Page_Load(object sender, EventArgs e) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); id = news.id.ToString(); title = news.title; datetime = news.addtime.ToShortDateString(); scource = news.source == "" ? "不详" : news.source; content = news.newscontent; catname = news.categoryName; catid = news.catid.ToString(); author = news.author == "" ? "工大在线运营团队" : news.author; introduction = Common.CutString((news.introduce == "" ? Common.DelHTML(news.newscontent) : news.introduce), 200); keywords = news.keyword; Page.Title = title; //找出校区 if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) { campus = "daxuecheng"; } else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) { campus = "longdong"; } else { campus = "dongfenglu"; } xuexi.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[0]); shenghuo.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[1]); xiaoyuan.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[3]); //增加点击量 pl.UpdateNewsInfoHit(news.id); //相关新闻 string str = "select DISTINCT top 5 n.id,n.title,n.addtime from((dc_keyword k join dc_getnewsid g on k.id=g.keyword_id) join dc_newsinfo n on g.title_id=n.id) where n.catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") and g.title_id!= " + news.id.ToString() + " and k.keyword in ( '" + keywords.Replace(",", ",").Replace(@",", @"','") + " ')"; RepeaterRelate.DataSource = SqlHelper.ExecuteReader(SqlHelper.ConnString, CommandType.Text, str, null); RepeaterRelate.DataBind(); //评论部分 //CommentImpl cpl = new CommentImpl(); //commentpl.DataSource = cpl.GetCommentbyNewsId(news.id); //commentpl.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = Page.Title + " - " + ConfigurationManager.AppSettings["WebTitle"].ToString(); string catid, id; if (Request.Params["campus"] != null) { campus = Request.Params["campus"].ToString(); } else if (Request.Params["catid"] != null) { catid = Request["catid"].ToString(); if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) { campus = "daxuecheng"; } else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) { campus = "longdong"; } else { campus = "dongfenglu"; } } else if (Request.Params["id"] != null) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); catid = news.catid.ToString(); if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) { campus = "daxuecheng"; } else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) { campus = "longdong"; } else { campus = "dongfenglu"; } } else { campus = "daxuecheng"; } columns = ConfigurationManager.AppSettings[campus].ToString().Split(','); }
protected void Page_Load(object sender, EventArgs e) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); id = news.id.ToString(); title = news.title; datetime = news.addtime.ToShortDateString(); scource = news.source == "" ? "不详" : news.source; content = news.newscontent; catname = news.categoryName; catid = news.catid.ToString(); author = news.author == "" ? "工大在线运营团队" : news.author; introduction = Common.CutString((news.introduce == "" ? Common.DelHTML(news.newscontent) : news.introduce), 200); keywords = news.keyword; Page.Title = title; //找出校区 if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) { campus = "daxuecheng"; } else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) { campus = "longdong"; } else { campus = "dongfenglu"; } //增加点击量 pl.UpdateNewsInfoHit(news.id); //评论部分 //CommentImpl cpl = new CommentImpl(); //commentpl.DataSource = cpl.GetCommentbyNewsId(news.id); //commentpl.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { campus = Request.Params["campus"] == null ? "daxuecheng" : Request.Params["campus"].ToString();//获取campus参数,默认大学城 columns = ConfigurationManager.AppSettings[campus].ToString().Split(','); all.condition = "AND catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") AND isrecommemd='True' "; kaixue.condition = " AND catid="+columns[0]; xuexi.condition = " AND catid=" + columns[1]; shenghuo.condition = " AND catid=" + columns[2]; xiaoyuan.condition = " AND catid=" + columns[3]; NewsInfoImpl pl = new NewsInfoImpl(); DataSet ds = pl.GetNewsInfoByCondition(3, 1, " AND catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") AND ispic='True'"); for (int i = 0; i < 3&&i<ds.Tables[0].Rows.Count; i++) { hottitle[i] = ds.Tables[0].Rows[i]["title"].ToString(); hotlink[i] = "Detail.aspx?id=" + ds.Tables[0].Rows[i]["id"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { campus = Request.Params["campus"] == null ? "daxuecheng" : Request.Params["campus"].ToString();//获取campus参数,默认大学城 columns = ConfigurationManager.AppSettings[campus].ToString().Split(','); all.condition = "AND catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") AND isrecommemd='True' "; kaixue.condition = " AND catid=" + columns[0]; xuexi.condition = " AND catid=" + columns[1]; shenghuo.condition = " AND catid=" + columns[2]; xiaoyuan.condition = " AND catid=" + columns[3]; NewsInfoImpl pl = new NewsInfoImpl(); DataSet ds = pl.GetNewsInfoByCondition(3, 1, " AND catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") AND ispic='True'"); for (int i = 0; i < 3 && i < ds.Tables[0].Rows.Count; i++) { hottitle[i] = ds.Tables[0].Rows[i]["title"].ToString(); hotlink[i] = "Detail.aspx?id=" + ds.Tables[0].Rows[i]["id"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); id = news.id.ToString(); title = news.title; datetime = news.addtime.ToShortDateString(); scource = news.source == "" ? "不详" : news.source; content = news.newscontent; catname = news.categoryName; catid = news.catid.ToString(); author = news.author == "" ? "工大在线运营团队" : news.author; introduction = Common.CutString((news.introduce == "" ? Common.DelHTML(news.newscontent) : news.introduce), 200); keywords = news.keyword; Page.Title = title; //找出校区 if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) campus = "daxuecheng"; else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) campus = "longdong"; else campus = "dongfenglu"; xuexi.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[0]); shenghuo.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[1]); xiaoyuan.catid = Convert.ToInt32(ConfigurationManager.AppSettings[campus].ToString().Split(',')[3]); //增加点击量 pl.UpdateNewsInfoHit(news.id); //相关新闻 string str = "select DISTINCT top 5 n.id,n.title,n.addtime from((dc_keyword k join dc_getnewsid g on k.id=g.keyword_id) join dc_newsinfo n on g.title_id=n.id) where n.catid in (" + ConfigurationManager.AppSettings[campus].ToString() + ") and g.title_id!= " + news.id.ToString() + " and k.keyword in ( '" + keywords.Replace(",", ",").Replace(@",", @"','") + " ')"; RepeaterRelate.DataSource = SqlHelper.ExecuteReader(SqlHelper.ConnString, CommandType.Text, str, null); RepeaterRelate.DataBind(); //评论部分 //CommentImpl cpl = new CommentImpl(); //commentpl.DataSource = cpl.GetCommentbyNewsId(news.id); //commentpl.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Page.Title = Page.Title +" - "+ ConfigurationManager.AppSettings["WebTitle"].ToString(); string catid, id; if (Request.Params["campus"] != null) { campus = Request.Params["campus"].ToString(); } else if (Request.Params["catid"] != null) { catid = Request["catid"].ToString(); if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid)!=-1) campus = "daxuecheng"; else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid)!=-1) campus = "longdong"; else campus = "dongfenglu"; } else if (Request.Params["id"] != null) { NewsInfo news = new NewsInfo(); NewsInfoImpl pl = new NewsInfoImpl(); news = pl.GetNewsInfoById(Convert.ToInt32(Request.Params["id"])); catid = news.catid.ToString(); if (ConfigurationManager.AppSettings["daxuecheng"].ToString().IndexOf(catid) != -1) campus = "daxuecheng"; else if (ConfigurationManager.AppSettings["longdong"].ToString().IndexOf(catid) != -1) campus = "longdong"; else campus = "dongfenglu"; } else { campus="daxuecheng"; } columns = ConfigurationManager.AppSettings[campus].ToString().Split(','); }