Example #1
0
 private void removeSelectedsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in grdAssignedRoles.SelectedRows)
     {
         _AssignedRolList.Remove(((Rol)row.DataBoundItem));
     }
     grdAssignedRoles.DataSource = null;
     grdAssignedRoles.DataSource = _AssignedRolList;
     grdAssignedRoles.Refresh();
     txtRuleExpression.Text = FwkMembership.BuildRuleExpression(_AssignedRolList, _ExcludeUserList);
 }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_SelectedUser != null)
            {
                var s = from usr in _ExcludeUserList where usr.UserName == _SelectedUser.UserName select usr;
                if (!s.Any())
                {
                    _ExcludeUserList.Add(new User(_SelectedUser.UserName));

                    grdUserExcluded.DataSource = null;
                    grdUserExcluded.DataSource = _ExcludeUserList;
                }
            }

            txtRuleExpression.Text = FwkMembership.BuildRuleExpression(_AssignedRolList, _ExcludeUserList);
        }
Example #3
0
        private void btnAddRol_Click(object sender, EventArgs e)
        {
            FillSelectedRoles();
            foreach (Rol selectedRol in selectedRoles)
            {
                if (!_AssignedRolList.Any <Rol>(rol => rol.RolName.Equals(selectedRol.RolName, StringComparison.OrdinalIgnoreCase)))
                {
                    _AssignedRolList.Add(new Rol(selectedRol.RolName));

                    grdAssignedRoles.DataSource = null;
                    grdAssignedRoles.DataSource = _AssignedRolList;
                }
            }
            txtRuleExpression.Text = FwkMembership.BuildRuleExpression(_AssignedRolList, _ExcludeUserList);
            NewSecurityInfoCreatedHandler();
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ruleName"></param>
        public void Populate(string ruleName)
        {
            txtRuleName.Text = ruleName;

            _CurrentRule = FwkMembership.GetRule(ruleName, frmAdmin.Provider.Name);

            txtRuleExpression.Text = _CurrentRule.Expression;

            _AssignedRolList = new RolList();
            _ExcludeUserList = new UserList();
            FwkMembership.BuildRolesAndUsers_FromRuleExpression(_CurrentRule.Expression, out _AssignedRolList, out _ExcludeUserList);


            txtRuleExpression.Text      = FwkMembership.BuildRuleExpression(_AssignedRolList, _ExcludeUserList);
            grdAssignedRoles.DataSource = null;
            grdAssignedRoles.DataSource = _AssignedRolList;
            grdUserExcluded.DataSource  = null;
            grdUserExcluded.DataSource  = _AssignedRolList;
            grdUserExcluded.Refresh();
            grdAssignedRoles.Refresh();
        }