/// <summary> /// Delete System User Group and it's relationships /// </summary> /// <param name="group"></param> public static void DeleteSystemUserGroup(Simplified.Ring3.SystemUserGroup group) { // Remove System user member's Db.SlowSQL("DELETE FROM Simplified.Ring3.SystemUserGroupMember WHERE SystemUserGroup=?", group); group.Delete(); }
/// <summary> /// Delete System user /// </summary> /// <param name="user"></param> public static void DeleteSystemUser(Simplified.Ring3.SystemUser user) { if (user == null) { throw new ArgumentNullException("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(); }