using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Maticsoft.Model; using System.Data; using System.Data.SqlClient; using Ajax; public partial class Framework_File_Console : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Utility.RegisterTypeForAjax(typeof(Framework_File_Console)); if (Session["user"] == null) { Response.Redirect("../index.aspx"); } getuse(); getgxxnr(); getricheng(); } #region 获取加载菜单选项卡 private void getuse() { nr_z_yhzh zh = (nr_z_yhzh)Session["user"]; usezh.InnerText = zh.zhanghao+","; RqYear.InnerText = DateTime.Now.Year.ToString(); RqYr.InnerText = "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Date.ToString("dd")+"日"; Rqsj.InnerText = DateTime.Now.ToString("HH:mm"); dbrq.Value = DateTime.Now.ToString("yyyy-MM-dd"); DataSet yhzhds=DBHlper.Execute("select * from dbo.view_nr_z_yhzh where isqiyong='启用'"); if (yhzhds != null && yhzhds.Tables[0].Rows.Count>0) { richenglx.DataSource = yhzhds.Tables[0].DefaultView; richenglx.DataValueField = "zhanghao"; richenglx.DataTextField = "zhanghao"; richenglx.DataBind(); richenglx.Items.Insert(0, new ListItem("新闻公告", "新闻公告")); richenglx.Items.Insert(0, new ListItem("我的日程", "我的日程")); } } #endregion #region 获取代办事务 private void getgxxnr() { Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]); string htmlcode = "
"; string wherecode = string.Format("select top 7 * from view_nr_z_sysmsg where userid=" + user.id + " and msgval>0 order by riqi desc"); int txtssum=DBHlper.getcount("select sum(msgval) from view_nr_z_sysmsg where userid=" + user.id + " and msgval>0 "); int dbtxsum = DBHlper.getcount("select count(*) from view_nr_z_sysmsg where userid=" + user.id + " and msgval>0 and isview=0"); dbsxzts.InnerText = txtssum.ToString(); dbsxwdts.InnerText = dbtxsum.ToString(); DataTable rzdt = DBHlper.Execute(wherecode).Tables[0]; for (int i = 0; i < rzdt.Rows.Count; i++) { if (rzdt.Rows[i]["msgtypeid"].ToString() == "10") { string ids = shoukuan(); if (ids != "") { htmlcode += "