Пример #1
0
        void OnDeleteUser(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete the user " + UserName + " ?", "Credentials Manager", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                IMembershipManager membershipManager = UserManagerProviderFactory.CreateMembershipManager(); // new AspNetSqlProviderService(ServiceAddress);
                bool deleted = membershipManager.DeleteUser(ApplicationName, UserName, m_RelatedDataCheckBox.Checked);
                if (deleted == false)
                {
                    MessageBox.Show("Encountered an error trying to delete user " + UserName, "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    //Upade the roles page
                    m_UsersToAssignListView.RemoveItem(UserName);
                    RefreshUsersForRoleComboBox();
                    RefreshRolesForUserComboBox();
                    RefreshRolePageButtons();

                    //Update the users list
                    m_UsersListView.RemoveItem(UserName);
                    RefreshUserStatus();
                    RefreshUsersPageButtonsAndMenuItems();
                }
            }
        }
Пример #2
0
        void IMembershipManager.DeleteAllUsers(string application, bool deleteAllRelatedData)
        {
            IMembershipManager membershipManager = this;

            string[] users = membershipManager.GetAllUsers(application);

            Action <string> deleteUser =
                delegate(string user) { membershipManager.DeleteUser(application, user, deleteAllRelatedData); };

            Array.ForEach(users, deleteUser);
        }
Пример #3
0
 public void Delete()
 {
     membershipManager.DeleteUser(membershipUser.UserName);
 }
Пример #4
0
 public override bool DeleteUser(string username, bool deleteAllRelatedData)
 {
     return(m_MembershipManager.DeleteUser(username));
 }