protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Request.Cookies["T_USERID"] != null) { string id = HttpContext.Current.Request.Cookies["T_USERID"].Value; BLL.BLLRole br = new BLL.BLLRole(); User_id = br.GetRoleId(id); } BLL.BLLDefault BD = new BLL.BLLDefault(); this.lbl_Capacity.Text = BD.GetCapacity(DateTime.Now).ToString(); this.lbl_Reaload.Text = BD.GetReaload("1=1", 1).ToString(); this.lbl_Power.Text = BD.GetPower("1=1", DateTime.Now).ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Request.Cookies["T_USERID"] != null) { string id = HttpContext.Current.Request.Cookies["T_USERID"].Value; BLL.BLLRole br = new BLL.BLLRole(); User_id = br.GetRoleId(id); } BLL.BLLDefault BD = new BLL.BLLDefault(); this.lbl_Capacity.Text = BD.GetCapacity(DateTime.Now).ToString(); this.lbl_Reaload.Text = BD.GetReaload("1=1", 1).ToString(); this.lbl_Power.Text = BD.GetPower("1=1",DateTime.Now).ToString(); }
/// <summary> /// 获取横向导航菜单 /// </summary> /// <returns></returns> /// 修改:李东峰 日期:2014-2-28 /// 修改内容:增加根据visible属性判断是否显示该菜单并返回首页的url public void GetMenuRoot() { string userId = Request.Cookies["T_USERID"].Value.ToString(); string roleId = bl.GetRoleId(userId); DataTable udt = bl.GetUserInfo(userId); string realName = udt.Rows[0]["T_USERNAME"].ToString(); //BLLRole bl = new BLLRole(); //string errMsg = ""; //string realName = bl.GetUserRealNameById(userId, out errMsg); dt = new DataTable(); GetTreeList(); DataRow[] dr = null; DataRow[] dr_HomePage = null; dr_HomePage = dt.Select("PID='000'"); HomePageUrl = dr_HomePage[0][6].ToString(); dr = dt.Select("PID='00'"); int c = 0; for (int i = 0; i < dr.Length; i++) { string[] nodeRoleId = dr[i][5].ToString().TrimStart(',').TrimEnd(',').Split(','); string visible = dr[i][4].ToString(); if (nodeRoleId.Contains(roleId) && visible == "1") { c = c + 1; DataRow[] _dr = dt.Select("PID='" + dr[i][0] + "'"); if (_dr.Length > 0) { sb.AppendFormat("<a id=\"menu{4}\" runat=\"server\" href=\"javascript:SetUrl('{0}','{1}','{2}')\" onclick=\"changeMenu({4})\" hidefocus=\"true\">{3}</a>", 1, dr[i][0], dr[i][6], dr[i][1], c); } else { if (i == 0) { sb.AppendFormat("<a id=\"menu{4}\" runat=\"server\" href=\"javascript:SetUrl('{0}','{1}','{2}')\" onclick=\"changeMenu({4})\" hidefocus=\"true\">{3}</a>", 0, dr[i][0], dr[i][6], dr[i][1], c); } else { sb.AppendFormat("<a id=\"menu{4}\" runat=\"server\" href=\"javascript:SetUrl('{0}','{1}','{2}')\" onclick=\"changeMenu({4})\" hidefocus=\"true\">{3}</a>", 0, dr[i][0], dr[i][6], dr[i][1], c); } } } } this.lblUserWelcome.Text = realName; this.mu.Value = (c + 1).ToString(); this.dv_Menu_left.InnerHtml = sb.ToString(); }