Single and multibunch beam dynamics in the DAFNE main rings