Exemplo n.º 1
0
    protected void checkRoleExists(object source, ServerValidateEventArgs args)
    {
        string code = ((TextBox)(this.FV_Role.FindControl("tbCode"))).Text;
        Role   user = TheRoleMgr.LoadRole(code);

        if (user != null)
        {
            args.IsValid = false;
        }
    }
Exemplo n.º 2
0
    protected void ODS_User_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        UserRole userRole = new UserRole();

        userRole.Role = TheRoleMgr.LoadRole("everyone");
        userRole.User = user;
        TheUserRoleMgr.CreateUserRole(userRole);
        if (CreateEvent != null)
        {
            CreateEvent(user.Code, e);
            ShowSuccessMessage("Security.User.AddUser.Successfully", user.Code);
        }
    }
Exemplo n.º 3
0
    protected void ToInBT_Click(object sender, EventArgs e)
    {
        List <Permission> pList = new List <Permission>();

        foreach (ListItem item in this.CBL_NotInPermission.Items)
        {
            if (item.Selected)
            {
                pList.Add(ThePermissionMgr.LoadPermission(Convert.ToInt32(item.Value)));
            }
        }
        if (pList.Count > 0)
        {
            TheRolePermissionMgr.CreateRolePermissions(TheRoleMgr.LoadRole(this.lbCode.Text), pList);
        }
        this.CBL_NotInPermission.DataBind();
        this.CBL_InPermission.DataBind();
        this.cb_InPermission.Checked    = false;
        this.cb_NotInPermission.Checked = false;
        UpdateUserLastModifyDate();
    }
Exemplo n.º 4
0
    protected void ToInBT_Click(object sender, EventArgs e)
    {
        List <Role> rList = new List <Role>();

        foreach (ListItem item in this.CBL_NotInRole.Items)
        {
            if (item.Selected)
            {
                rList.Add(TheRoleMgr.LoadRole(item.Value));
            }
        }
        if (rList.Count > 0)
        {
            TheUserRoleMgr.CreateUserRoles(TheUserMgr.LoadUser(this.lbCode.Text), rList);
        }
        this.CBL_NotInRole.DataBind();
        this.CBL_InRole.DataBind();
        this.cb_InRole.Checked    = false;
        this.cb_NotInRole.Checked = false;
        UpdateUserLastModifyDate();
    }
Exemplo n.º 5
0
 protected void FV_Role_DataBound(object sender, EventArgs e)
 {
     Role role = TheRoleMgr.LoadRole(this.RoleCode);
 }