Ejemplo n.º 1
0
    private void UpdateUserLastModifyDate()
    {
        IList <User> userList = TheUserRoleMgr.GetUsersByRoleCode(this.lbCode.Text);

        foreach (User user in userList)
        {
            user.LastModifyDate = DateTime.Now;
            user.LastModifyUser = this.CurrentUser;
            TheUserMgr.UpdateUser(user);
        }
    }
Ejemplo 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);
        }
    }
Ejemplo n.º 3
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();
    }
Ejemplo n.º 4
0
    protected void ToOutBT_Click(object sender, EventArgs e)
    {
        List <UserRole> urList = new List <UserRole>();

        foreach (ListItem item in this.CBL_InRole.Items)
        {
            if (item.Selected)
            {
                UserRole userRole = TheUserRoleMgr.LoadUserRole(this.lbCode.Text, item.Value);
                urList.Add(userRole);
            }
        }
        if (urList.Count > 0)
        {
            TheUserRoleMgr.DeleteUserRole(urList);
        }
        this.CBL_NotInRole.DataBind();
        this.CBL_InRole.DataBind();
        this.cb_InRole.Checked    = false;
        this.cb_NotInRole.Checked = false;
        UpdateUserLastModifyDate();
    }