generated from UF-IRI/qt_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/UF-IRI/entrega-final-tp-202…
- Loading branch information
Showing
3 changed files
with
144 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#include <libreria.h>//.h> | ||
|
||
|
||
|
||
Asistencia* resizeClientes(Asistencia *AsistenciaClientes, u_int CantAsistencias, u_int nuevoTam){ | ||
|
||
Asistencia* aux = new Asistencia[nuevoTam]; | ||
|
||
u_int longitud = (CantAsistencias < nuevoTam) ? CantAsistencias : nuevoTam; | ||
|
||
if(aux != nullptr) { | ||
|
||
for(u_int i = 0; i < longitud; i++) | ||
aux[i] = AsistenciaClientes[i]; | ||
return aux; | ||
} | ||
return nullptr; | ||
} | ||
|
||
Inscripcion* resizeInscripcion(Asistencia* AsistenciaClientes, u_int cantinscripciones, u_int nuevoTam){ | ||
|
||
Inscripcion* aux = new Inscripcion[nuevoTam]; | ||
|
||
u_int longitud = (cantinscripciones < nuevoTam) ? cantinscripciones : nuevoTam; | ||
|
||
if(aux != nullptr) { | ||
|
||
for(u_int i = 0; i < longitud; i++) | ||
aux[i] = AsistenciaClientes->CursosInscriptos[i];; | ||
return aux; | ||
} | ||
return nullptr; | ||
} | ||
eCliente BuscarIdCliente(ClientesGYM *Clientes, u_int idCliente, u_int CantClientes, ClientesGYM &cliente) | ||
{ | ||
ClientesGYM *aux = Clientes, *ultimo = (Clientes) + CantClientes - 1; | ||
while(true) { | ||
if (aux->idCliente == idCliente ){ | ||
cliente = *aux; | ||
return eCliente :: ExitoCliente; | ||
} | ||
if (aux == ultimo) | ||
break; | ||
aux++; | ||
} | ||
return eCliente :: ErrIdClienteinx; | ||
} | ||
|
||
eClase BuscarIdClase(ClasesGym *Clases, u_int idClase, u_int cantClases, ClasesGym &clase) | ||
{ | ||
ClasesGym *aux = Clases, *ultimo = (Clases) + cantClases - 1; | ||
while(true) { | ||
if (aux->idClase == idClase ){ | ||
clase = *aux; | ||
return eClase :: ExitoClase; | ||
} | ||
if (aux == ultimo) | ||
break; | ||
aux++; | ||
} | ||
return eClase :: ErrIdClaseinx; | ||
} | ||
int BuscarIdCliente(ClientesGYM *Clientes, u_int idCliente, u_int CantClientes, ClientesGYM &cliente) | ||
{ | ||
ClientesGYM *aux = Clientes, *ultimo = (Clientes) + CantClientes - 1; | ||
while(true) { | ||
if (aux->idCliente == idCliente ){ | ||
cliente = *aux; | ||
return 1 ;//Exito Cliente | ||
} | ||
if (aux == ultimo) | ||
break; | ||
aux++; | ||
} | ||
return 0;//Error id Cliente | ||
} | ||
|
||
int BuscarIdClase(ClasesGym *Clases, u_int idClase, u_int cantClases, ClasesGym &clase) | ||
{ | ||
ClasesGym *aux = Clases, *ultimo = (Clases) + cantClases - 1; | ||
while(true) { | ||
if (aux->idClase == idClase ){ | ||
clase = *aux; | ||
return 1 // exito id clase | ||
} | ||
if (aux == ultimo) | ||
break; | ||
aux++; | ||
} | ||
return 0 // error id clase | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters