Which part of the UCMJ did he violate?
Punitive Articles of the UCMJ
Article 134 Adultery
This has ruined many careers.
There was an air force general on the Joint Chiefs of Staff - separated from his wife, and involved with another woman. He was charged with adultery and withdrawn from consideration for promotion.