Beispiel #1
0
 private void btnFindUsers_Click(object sender, EventArgs e)
 {
     using (frmUserFind frm = new frmUserFind())
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             FwkMembership.CreateUsersToRole(selectedRol.RolName, frm.SelectedUserList, frmAdmin.Provider.Name);
             grdUsers.DataSource = FwkMembership.GetUsersDetailedInRole(selectedRol.RolName, frmAdmin.Provider.Name);
             grdUsers.Refresh();
         }
     }
 }
Beispiel #2
0
        private void grdRoles2_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (grdRoles.CurrentRow == null || grdRoles.CurrentRow.DataBoundItem == null)
            {
                return;
            }
            selectedRol = (Rol)grdRoles.CurrentRow.DataBoundItem;

            using (new WaitCursorHelper(this))
            {
                grdUsers.DataSource = FwkMembership.GetUsersDetailedInRole(selectedRol.RolName, frmAdmin.Provider.Name);
                grdUsers.Refresh();
            }
        }
Beispiel #3
0
        private void RemoveItem()
        {
            MessageViewInfo.MessageBoxButtons = MessageBoxButtons.YesNo;
            MessageViewInfo.MessageBoxIcon    = Fwk.Bases.FrontEnd.Controls.MessageBoxIcon.Question;
            if (MessageViewInfo.Show("Are you sure to remove selected users from current role : " + selectedRol.RolName) == DialogResult.Yes)
            {
                UserList removedUsersList = new UserList();

                foreach (DataGridViewRow row in grdUsers.SelectedRows)
                {
                    removedUsersList.Remove(((User)row.DataBoundItem));
                }

                FwkMembership.RemoveUsersFromRole(removedUsersList.GetArraNames(), selectedRol.RolName, frmAdmin.Provider.Name);

                grdUsers.DataSource = FwkMembership.GetUsersDetailedInRole(selectedRol.RolName, frmAdmin.Provider.Name);
                grdUsers.Refresh();
            }
            SetMessageViewToDefault();
        }