Exemplo n.º 1
0
    private void LoadMenu()
    {
        StringBuilder sb2 = new StringBuilder();
        DataTable     dt  = new BllAdmGroupRoleList().GetAdmModuleInfoByGroupIDs("ld,url,keycode,name,parentid,icon,Title", 0, "rank asc", CurrentRoleId);


        DataRow[] rowList;

        int i = 0;

        foreach (DataRow dr in dt.Select("parentid=0"))
        {
            if (i == 0)
            {
                sb2.Append("<div title=\"" + dr["name"] + "\"  selected=\"true\">");
            }
            else
            {
                sb2.Append("<div title=\"" + dr["name"] + "\">");
            }
            sb2.Append("<ul class=\"mleft\">");
            rowList = dt.Select(" parentid=" + dr["Ld"].ToString());
            foreach (DataRow drChild in rowList)
            {
                sb2.Append("<li><a href=\"" + drChild["Url"].ToString() + "\" target=\"sysMain\"  onclick=\"showTitle('" + drChild["Title"].ToString() + "');\">" + drChild["Name"].ToString() + "</a></li>");
            }
            sb2.Append("</ul>");
            sb2.Append("</div>");
            i++;
        }
        LtlNav.Text = sb2.ToString();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 获取当前登录用户拥有的全部权限列表
    /// </summary>
    /// <param name="roleIDs"></param>
    /// <returns></returns>
    protected List <string> GetRoleModuleKeyCode()
    {
        List <string> listKeyCode = GetCookieObject <List <string> >(CFun.GetAppStr("LoginUserModuleCookieName"));

        if (listKeyCode == null)
        {
            listKeyCode = new List <string>();
            DataTable dt = new BllAdmGroupRoleList().GetAdmModuleInfoByGroupIDs("keycode", 0, "", CurrentRoleId);
            foreach (DataRow dr in dt.Rows)
            {
                listKeyCode.Add(dr["KeyCode"].ToString());
            }
            SetCookieDomain(CFun.GetAppStr("LoginUserModuleCookieName"), listKeyCode, 1);
        }
        return(listKeyCode);
    }
Exemplo n.º 3
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        bool         error     = false;
        AdmUserGroup usergroup = new AdmUserGroup();

        CFun.GetPageData <AdmUserGroup>(usergroup, this);
        AdmGroupRoleList cont    = new AdmGroupRoleList();
        string           KeyCode = CFun.RequestPamStr("mname");

        if (usergroup.Ld == 0)
        {
            usergroup.CreateDate = DateTime.Now;
        }
        usergroup.LastDate = DateTime.Now;

        if (new BllAdmUserGroup().InsertorUpdateitem(usergroup))
        {
            int GroupId = usergroup.GroupId.Value;
            new BllAdmGroupRoleList().DeleteItemByGroupId(GroupId);
            cont.GroupId = GroupId;
            cont.Ld      = 0;

            if (KeyCode != null)
            {
                string[] ss = KeyCode.Trim().Split(new char[] { ',' });
                if (ss.Length > 0)
                {
                    for (int i = 0; i < ss.Length; i++)
                    {
                        cont.KeyCode = ss[i];
                        error        = new BllAdmGroupRoleList().InsertorUpdateitem(cont);
                    }
                }
            }
            error = true;
        }

        if (error)
        {
            BllAdmActHistory.SaveLog(CurrentUId, (int)EnumCCActiveClass.权限组管理, usergroup.Ld.Value, "");
            CFun.AlertMegT("保存成功!", "closeFlowPanel", "");
        }
        else
        {
            CFun.AlertMegT("发生错误,请稍后再试!", "back", "");
        }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         ArrayList al = new ArrayList();
         int       id = CFun.RequestPamInt("id");
         if (id > 0)
         {
             AdmUserGroup usergroup = new BllAdmUserGroup().GetItem(id);
             if (usergroup != null)
             {
                 int GroupId = (int)usergroup.GroupId;
                 CFun.BindPageData <AdmUserGroup>(this, usergroup);
                 DataTable dt = new BllAdmGroupRoleList().GetItemByGroupId(GroupId);
                 if (dt.Rows.Count > 0)
                 {
                     BtnSave.Text = "修改";
                     for (int i = 0; i < dt.Rows.Count; i++)
                     {
                         string K = dt.Rows[i]["KeyCode"].ToString();
                         al.Add(K);
                     }
                     string roleList = string.Join(",", (string[])al.ToArray(typeof(string)));
                     initRoleList(roleList);
                 }
                 else
                 {
                     initRoleList("");
                 }
             }
             else
             {
                 initRoleList("");
             }
         }
         else
         {
             initRoleList("");
         }
     }
 }