One ECR affected item is required before promotion

I need help with a C# script that when a user selects to promote the ECR from the state of "New" to the next life cycle state (New to In Review) the script will check to see if a minimum of one affected item has been added to the ECR. If not, an error will appear and the ECR will not be promoted forward.

Can someone help me with this?