//网站公告右侧列表 /**/ public void Notice_List(int cateid) { int page = tools.CheckInt(Request["page"]); if (page < 1) { page = 1; } NoticeCateInfo CateInfo = MyNoticeCate.GetNoticeCateByID(cateid, pub.CreateUserPrivilege("fb3e87ba-3d4d-480d-934e-80048bcc0100")); if (CateInfo != null) { Response.Write("<div id=\"help-right\">"); Response.Write(" <h3>" + CateInfo.Notice_Cate_Name + "</h3>"); Response.Write(" <div id=\"help-rightwen1\">"); Response.Write(" <ul>"); QueryInfo Query = new QueryInfo(); Query.PageSize = 20; Query.CurrentPage = page; Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_IsAudit", "=", "1")); Query.ParamInfos.Add(new ParamInfo("AND", "str", "NoticeInfo.Notice_Site", "=", "CN")); Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_Cate", "=", CateInfo.Notice_Cate_ID.ToString())); Query.OrderInfos.Add(new OrderInfo("NoticeInfo.Notice_ID", "DESC")); IList <NoticeInfo> notices = Webnotice.GetNotices(Query, pub.CreateUserPrivilege("9d4d1366-35ab-4eb6-b88e-e49e6bfae9d7")); if (notices != null) { foreach (NoticeInfo entity in notices) { Response.Write("<li><span style=\"color:#535353;\">[ " + entity.Notice_Addtime.ToString("yy-MM-dd") + " ]</span><a href=\"/notice/detail.aspx?notice_id=" + entity.Notice_ID + "\">" + tools.CutStr(entity.Notice_Title, 35) + "</a></li>"); } } else { Response.Write("<div height=\"50\" style=\" height:50px; text-align:center;line-height:50px; color:#707070;\">信息正在维护中...</div>"); } Response.Write("</ul>"); PageInfo pageinfo = Webnotice.GetPageInfo(Query, pub.CreateUserPrivilege("9d4d1366-35ab-4eb6-b88e-e49e6bfae9d7")); if (pageinfo != null && pageinfo.RecordCount >= 1) { string url = "/notice/index.aspx?cate_id=" + CateInfo.Notice_Cate_ID; Response.Write("<div style=\" float:right; padding-right:30px; padding-bottom:5px;\">"); pub.Page(pageinfo.PageCount, pageinfo.CurrentPage, url, pageinfo.PageSize, pageinfo.RecordCount); Response.Write("</div>"); } Response.Write(" </div>"); Response.Write("</div>"); } else { Response.Write("<div id=\"help-right\">"); Response.Write(" <h3>热点公告</h3>"); Response.Write(" <div id=\"help-rightwen1\">"); Response.Write(" <ul>"); QueryInfo Query = new QueryInfo(); Query.PageSize = 20; Query.CurrentPage = 1; Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_IsAudit", "=", "1")); Query.ParamInfos.Add(new ParamInfo("AND", "int", "NoticeInfo.Notice_IsHot", "=", "1")); Query.ParamInfos.Add(new ParamInfo("AND", "str", "NoticeInfo.Notice_Site", "=", "CN")); Query.OrderInfos.Add(new OrderInfo("NoticeInfo.Notice_ID", "DESC")); IList <NoticeInfo> notices = Webnotice.GetNotices(Query, pub.CreateUserPrivilege("9d4d1366-35ab-4eb6-b88e-e49e6bfae9d7")); if (notices != null) { foreach (NoticeInfo entity in notices) { Response.Write("<li><span>[ " + entity.Notice_Addtime.ToString("yy-MM-dd") + " ]</span><a href=\"/notice/detail.aspx?notice_id=" + entity.Notice_ID + "\">" + tools.CutStr(entity.Notice_Title, 35) + "</a></li>"); } } else { Response.Write("<div height=\"50\" style=\" height:50px; text-align:center;line-height:50px; color:#707070;\">信息正在维护中...</div>"); } Response.Write(" </ul>"); PageInfo pageinfo = Webnotice.GetPageInfo(Query, pub.CreateUserPrivilege("9d4d1366-35ab-4eb6-b88e-e49e6bfae9d7")); if (pageinfo != null && pageinfo.RecordCount > 0) { string url = "/notice/index.aspx?cate_id=0"; Response.Write("<div style=\" float:right; padding-right:30px; padding-bottom:5px;\">"); pub.Page(pageinfo.PageCount, pageinfo.CurrentPage, url, pageinfo.PageSize, pageinfo.RecordCount); Response.Write("</div>"); } Response.Write(" </div>"); Response.Write("</div>"); } }
public NoticeCateInfo GetNoticeCateByID(int cate_id) { return(MyBLL.GetNoticeCateByID(cate_id, Public.GetUserPrivilege())); }