YAMILDIAZ

validar

Jun 13th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. bool VendedorManager::LegajoRepetido(int idLegajo){
  2. Vendedor registro;
  3. int cantidad=_archivo.ContarRegistro();
  4.  
  5. for(int i = 0; i < cantidad; i++){
  6. registro=_archivo.leerRegistro(i);
  7.  
  8. if(registro.getNroLegajo()== idLegajo){
  9. return true;
  10. }
  11. }
  12. return false;
  13. }
  14.  
  15.  
  16.  
  17. bool PersonaManager::DniRepetido(long long idPersona){
  18. Vendedor registro;
  19. VendedorArchivo va("Vendedores.dat");
  20. int cantidad=va.ContarRegistro();
  21.  
  22. for(int i = 0; i < cantidad; i++){
  23. registro=va.leerRegistro(i);
  24.  
  25. if(registro.getDni() == idPersona){
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment