private void loadData() { BLL_NoticeBoard bll = new BLL_NoticeBoard(); DataTable dt = new DataTable(); dt = bll.GetList(1, "", " create_time desc").Tables[0]; foreach (DataRow item in dt.Rows) { ltlContent.Text = item["notice_content"].ToString(); ltlCreateTime.Text = pfunction.ConvertToLongDateTime(item["create_time"].ToString(), "yyyy年MM月dd日"); } }
/// <summary> /// 公告 /// </summary> private void noticeBoard() { try { BLL_NoticeBoard bll = new BLL_NoticeBoard(); DataTable dt = new DataTable(); dt = bll.GetList(1, "", " create_time desc").Tables[0]; foreach (DataRow item in dt.Rows) { if (Convert.ToDateTime(item["start_time"]) <= DateTime.Now && Convert.ToDateTime(item["end_time"]) > DateTime.Now) { ClientScript.RegisterStartupScript(this.GetType(), "login", "<script>layer.open({type: 2,title: false,closeBtn: false,shade: false,area:['600px','80%'],content: 'noticeBoard.aspx'});</script>"); } } } catch (Exception) { } }