Esempio n. 1
0
        /// <summary>
        /// Delete System user
        /// </summary>
        /// <param name="user"></param>
        public static void DeleteSystemUser(SystemUser user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            // Remove Email adresses associated to the system user
            //            Db.SlowSQL("DELETE FROM Simplified.Ring3.EmailAddress WHERE ToWhat=?", user);

            // Remove ResetPassword associated to the system user Sombody
            Db.SlowSQL("DELETE FROM Simplified.Ring6.ResetPassword WHERE User=?", user);

            // TODO: Should we also delete the Somebody (Person/Company)?

            // Remove system user group member (If system user is member of a system user group)
            Db.SlowSQL("DELETE FROM Simplified.Ring3.SystemUserGroupMember WHERE SystemUser=?", user);

            user.Delete();
        }