President Trump urging Republicans to falsely switch party affiliation for the day to participate in the process in a deliberate attempt to influence the outcome is unethical to say the least.
Anyway, it is probably as legal as any of his other business practices.