District attorney resigns as part of plea deal in pressured-sex case