/// <summary> /// 首页-新闻模块1 /// </summary> /// <param name="id"></param> protected void bd_new1(string id) { string name = ""; string nameid = ""; //select top 4 * from tb_u_info where IsElite=1 and userid in(select id from tb_User where Classid=" + id + " and GroupId in(5,6)) order by id string sql2 = "select Id,title from tb_U_schoolfl where Sid=" + id + " and mb_id=3"; DataSet dm = HXD.DBUtility.SQLHelper.ExecuteDataset(sql2); if (dm.Tables[0].Rows.Count > 0) { name = dm.Tables[0].Rows[0]["title"].ToString(); nameid = dm.Tables[0].Rows[0]["id"].ToString(); } string sql = "select top 8 * from tb_u_info where ClassId=(select id from tb_U_schoolfl where Sid=" + id + " and mb_id=3) and userid in(select id from tb_User where Classid=" + id + " and GroupId in(5,6)) order by id desc"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); if (ds.Tables[0].Rows.Count > 0) { str_new1 += "<div class=\"hd\">"; str_new1 += "<h3 class=\"title\">" + name + "</h3>"; str_new1 += "<div class=\"more\"><a href=\"list.aspx?c=" + nameid + "\">MORE</a></div></div>"; str_new1 += "<div class=\"bd\">"; str_new1 += "<div class=\"hot\"><h3 style=\"text-align: center; font-family: Microsoft YaHei;\">"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string yymm = StringDeal.GetDateTime(ds.Tables[0].Rows[i]["posttime"], "yyyy-MM-dd"); if (i == 0) { str_new1 += "<a target=\"_blank\" style=\"font-size: 18px; color: rgb(107, 41, 43);\" href=\"/news.aspx?id=" + ds.Tables[0].Rows[i]["id"].ToString() + "\">" + ds.Tables[0].Rows[i]["title"].ToString() + "</a></h3></div>"; str_new1 += "<div class=\"focusList\"><ul class=\"sidelist22\">"; } else { str_new1 += "<li style=\";\"><span style=\"font-size: 14px; color: rgb(64, 64, 64);\">" + yymm + "</span><span class=\"spe\">|</span><a class=\"normal_title\" target=\"_blank\" title=\"" + ds.Tables[0].Rows[i]["title"].ToString() + "\" href=\"/news.aspx?id=" + ds.Tables[0].Rows[i]["id"].ToString() + "\">" + ds.Tables[0].Rows[i]["title"].ToString() + "</a></li>"; } } str_new1 += "<li class=\"clear\"></li></ul>"; str_new1 += "<li class=\"clear\"></li></ul></div></div>"; } }
/// <summary> /// 首页-通知 /// </summary> /// <param name="id"></param> protected void bd_tz(string id) { //select top 4 * from tb_u_info where IsElite=1 and userid in(select id from tb_User where Classid=" + id + " and GroupId in(5,6)) order by id string sql = "select top 4 * from tb_u_info where ClassId=(select id from tb_U_schoolfl where Sid=" + id + " and mb_id=2) and userid in(select id from tb_User where Classid=" + id + " and GroupId in(5,6)) order by id desc"; DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset(sql); if (ds.Tables[0].Rows.Count > 0) { str_tz += "<ul class=\"label_list3_date\">"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string yymm = StringDeal.GetDateTime(ds.Tables[0].Rows[i]["posttime"], "yyyy-MM"); string dd = StringDeal.GetDateTime(ds.Tables[0].Rows[i]["posttime"], "dd"); str_tz += "<li><div class=\"date3\">"; str_tz += "<span class=\"ny\">" + yymm + "</span>"; str_tz += "<span class=\"rq\">" + dd + "</span></div>"; str_tz += "<div class=\"text3\"><h4><a href=\"/news.aspx?id=" + ds.Tables[0].Rows[i]["id"].ToString() + "\" title=\"" + ds.Tables[0].Rows[i]["title"].ToString() + "\" target=\"_blank\">" + ds.Tables[0].Rows[i]["title"].ToString() + "</a></h4></div></li>"; } str_tz += "</ul>"; } }