NMR-NQR studies in cuprates: from the antiferromagnetic to the superconducting state