private void databind(string sort) { int SParentCode = int.Parse(Request.QueryString["sid"].ToString()); PagedDataSource pd = new PagedDataSource(); pd.DataSource = bll.GetList(SParentCode, sort);//第一级菜单 //pd.AllowPaging = true; //pd.PageSize = 15; // pd.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; //if (pd.Count > 0) //{ // this.lblCurrentPage.Text = "共" + AspNetPager1.RecordCount + "条记录,当前第" + (pd.CurrentPageIndex + 1).ToString() + "页,共" + pd.PageCount.ToString() + "页,每页" + pd.PageSize + "条纪录"; //} foreach (Tz888.Model.Sys.SysMenuTab mo in bll.GetList(SParentCode, sort)) { ViewState["parentCode"] = mo.SParentCode; break; } if (ViewState["parentCode"] == null) { ViewState["parentCode"] = SParentCode; } GridView1.DataSource = pd; GridView1.DataBind(); }
protected DataSet GetDataList() { if (AppCache.IsExist("SysMenuList")) { ds = (DataSet)AppCache.Get("SysMenuList"); } else { ds = bll.GetList(""); AppCache.AddCache("SysMenuList", ds); } return(ds); }
protected DataSet getRoleID(string tem, string SParentCode) { if (tem != "") { string[] tems = tem.Split(','); string strWhere = " RoleID in ("; //拼接查询条件 for (int i = 0; i < tems.Length; i++) { if (i < tems.Length - 1) { strWhere = strWhere + tems[i] + ","; } else { strWhere = strWhere + tems[i]; } } strWhere += ")"; Tz888.BLL.Sys.SysPermissionTab sysPerm = new Tz888.BLL.Sys.SysPermissionTab(); DataSet ds = sysPerm.GetList(strWhere); string spCode = ""; //获取所有的菜单码 if (ds.Tables[0] != null) { for (int j = 0; j < ds.Tables[0].Rows.Count; j++) { spCode = spCode + ds.Tables[0].Rows[j]["SPCode"].ToString(); } } //拼接菜单码查询条件 string strspCode = " scode in ("; string[] strspCodes = spCode.Split(','); for (int f = 0; f < strspCodes.Length; f++) { if (strspCode.IndexOf(strspCodes[f].Trim()) < 0) { strspCode = strspCode + "'" + strspCodes[f] + "',"; } } strspCode = strspCode.Substring(0, strspCode.Length - 1) + ") and sparentcode = '" + SParentCode + "'"; Tz888.BLL.Sys.SysMenuTab sysMenu = new Tz888.BLL.Sys.SysMenuTab(); return(sysMenu.GetList(strspCode)); } else { return(null); } }