-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuClientes.cpp
executable file
·776 lines (601 loc) · 21.7 KB
/
MenuClientes.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
// Created by Hugo.
#include "MenuClientes.h"
using namespace std;
///@escritura codigo[50], nombre[50], estado[50], direccion[50], RFC[13], tipoC[10]
MenuClientes::MenuClientes() : ListaClientesRAM()
{
//ListaClientesRAM.deleteAll();
if (ListaClientesRAM.isEmpty())
{
cout << "constructor menu clientes lista empty" << endl;
}
}
void MenuClientes::setClienteRam(Cliente clnt)
{
clienteRAM = clnt;
}
Cliente MenuClientes::getClienteRam()
{
return clienteRAM;
}
void MenuClientes::create()
{
Cliente auxCliente;
string myStr("");
string codCliente("");
string nomEdo("");
string archivoClientes("clientes.txt");
string inde("indexInv.txt"); //index.txt
//posición inicial para escribir en clientes.txt
long int posInicial;
ifstream posIn(archivoClientes, ios::ate);
posInicial = posIn.tellg();
if (posInicial == -1)
{
posInicial = 0;
}
posIn.close();
//Creacion de cliente
cout << "Creación de Clientes\n\nEscribe el Codigo del cliente"
<< endl; //todo validar codigos, o hacer una funcion que asigen codigos aleatorios y los valide contra la lista recien leida
fflush(stdin);
getline(cin, codCliente);
getline(cin, codCliente);
auxCliente.setCodigoCliente(codCliente);
cout << "Escribe el nombre del cliente:\t" << endl;
fflush(stdin);
getline(cin, myStr);
//getline(cin, nomCliente);
auxCliente.setName(myStr);
cout << "Escribe el nombre de estado" << endl;
fflush(stdin);
getline(cin, nomEdo);
auxCliente.setEstado(nomEdo);
cout << "Escribe el resto de la direccion del cliente" << endl;
fflush(stdin);
getline(cin, myStr);
auxCliente.setDireccion(myStr);
cout << "Escribe el RFC del cliente" << endl;
fflush(stdin);
getline(cin, myStr);
auxCliente.setRfc(myStr);
cout << "Escribe el tipo de cliente que es " << auxCliente.getName() << " (Mayoreo/Menudeo)" << endl;
fflush(stdin);
getline(cin, myStr);
auxCliente.setTipoCliente(myStr);
char auxChar[50];
strcpy(auxChar, auxCliente.getCodigoCliente().c_str());
if (invertidaRAM.isListaEdosEmpty())
{
invertidaRAM.crearEstado(nomEdo, codCliente); // porque aqui hacemos 2 veces la creacion?
}
invertidaRAM.crearEstado(nomEdo, codCliente);
///insertar a listaClientesRam
///escribir indice
ofstream escrIndex(inde, ios::app);
escrIndex.write((char *) &auxChar, sizeof auxChar); //escribir el codigo
escrIndex.write((char *) &posInicial, sizeof posInicial); //escribir la posición donde escribiremos el registro
escrIndex.close();
ofstream escribirCliente(archivoClientes, ios::app);
escribirCliente.seekp(posInicial);
///escribir cliente
escribirCliente.write((char *) &auxChar, sizeof auxChar);
char nam[50];
strcpy(nam, auxCliente.getName().c_str());
escribirCliente.write((char *) &nam, sizeof nam);
char estado[50];
strcpy(estado, auxCliente.getEstado().c_str());
escribirCliente.write((char *) &estado, sizeof estado);
char direccion[50];
strcpy(direccion, auxCliente.getDireccion().c_str());
escribirCliente.write((char *) &direccion, sizeof direccion);
char rfc[13];
strcpy(rfc, auxCliente.getRfc().c_str());
escribirCliente.write((char *) &rfc, sizeof rfc);
char tipoC[10];
strcpy(tipoC, auxCliente.getTipoCliente().c_str());
escribirCliente.write((char *) &tipoC, sizeof tipoC);
escribirCliente.close();
}
void MenuClientes::show()
{
char codigo[50], nombre[50], estado[50], direccion[50], rfc[13], tipoC[10];
long int start;
Cliente auxCliente;
string a("");
auxCliente.setCodigoCliente(a);
string archivoInd("indexInv.txt");
string archivoClientes("clientes.txt");
ifstream leerI(archivoInd, ios::in);
ifstream leerCliente(archivoClientes, ios::in);
while (!leerCliente.eof())
{
leerI.read((char *) &codigo, sizeof codigo);
leerI.read((char *) &start, sizeof start);
/// /// /// /// /// /// /// /// /// /// /// /// ///
leerCliente.seekg(start);
leerCliente.read((char *) &codigo, sizeof codigo);
string codigoStr(codigo);
if (auxCliente.getCodigoCliente() == codigoStr) //criterio de paro
{
break;
}
auxCliente.setCodigoCliente(codigoStr);
leerCliente.read((char *) &nombre, sizeof nombre);
string nombreStr(nombre);
auxCliente.setName(nombreStr);
leerCliente.read((char *) &estado, sizeof estado);
string estadoStr(estado);
auxCliente.setEstado(estadoStr);
leerCliente.read((char *) &direccion, sizeof direccion);
string direccionStr(direccion);
auxCliente.setDireccion(direccionStr);
leerCliente.read((char *) &rfc, sizeof rfc);
string rfcStr(rfc);
auxCliente.setRfc(rfcStr);
leerCliente.read((char *) &tipoC, sizeof tipoC);
string tipoCStr(tipoC);
auxCliente.setTipoCliente(tipoCStr);
cout << auxCliente.toString() << endl;
}
leerI.close();
leerCliente.close();
}
void MenuClientes::update()
{
char codigo[50], nombre[50], estado[50], direccion[50], rfc[13], tipoC[10];
string nameStr, stateStr, addStr, rfcStr, typeStr;
long int start, posInicial;
Cliente auxCliente, clienteModificar;
string a("");
auxCliente.setCodigoCliente(a);
string codigoModificar;
bool bandera(false);
string archivoInd("indexInv.txt");
string archivoClientes("clientes.txt");
string indTemporal("tempi.txt");
string clienteTemp("tempclnt.txt");
cout << "Ingrese el codigo del cliente que desea modificar" << endl;
fflush(stdin);
getline(cin, codigoModificar);
getline(cin, codigoModificar);
ifstream leerIndex(archivoInd, ios::in);
while (!leerIndex.eof())
{
leerIndex.read((char *) &codigo, sizeof codigo);
leerIndex.read((char *) &start, sizeof start);
string codigoLeido(codigo);
if (codigoLeido == codigoModificar)
{
bandera = true;
break;
}
}
leerIndex.close();
if (!bandera)
{
cout << "No se encontro el codigo en la lista..." << endl;
return;
}
string codigoMod(codigo);
clienteModificar.setCodigoCliente(codigoMod);
//estaria bien imprimir el cliente
cout << "Escribe el nuevo nombre del cliente:\t" << endl;
fflush(stdin);
getline(cin, nameStr);
clienteModificar.setName(nameStr);
cout << "Escribe el nombre del nuevo estado" << endl;
fflush(stdin);
getline(cin, stateStr);
clienteModificar.setEstado(stateStr);
cout << "Escribe el resto de la direccion del cliente" << endl;
fflush(stdin);
getline(cin, addStr);
clienteModificar.setDireccion(addStr);
cout << "Escribe el nuevo RFC del cliente" << endl;
fflush(stdin);
getline(cin, rfcStr);
clienteModificar.setRfc(rfcStr);
cout << "Escribe el nuevo tipo de cliente " << auxCliente.getName() << " (Mayoreo/Menudeo)" << endl;
fflush(stdin);
getline(cin, typeStr);
clienteModificar.setTipoCliente(typeStr);
//modificacion
ifstream leerInd(archivoInd, ios::in);
ifstream leerClientes(archivoClientes, ios::in);
ofstream escrindexTemp(indTemporal, ios::app);
ofstream escribirClientesTemp(clienteTemp, ios::app);
while (!leerInd.eof())
{
//leer indice
leerInd.read((char *) &codigo, sizeof codigo);
leerInd.read((char *) &start, sizeof start);
//leer de clientes.txt
leerClientes.seekg(start);
leerClientes.read((char *) &codigo, sizeof codigo);
string codigoStr(codigo);
if (auxCliente.getCodigoCliente() == codigoStr) //criterio de paro
{
break;
}
auxCliente.setCodigoCliente(codigoStr);
leerClientes.read((char *) &nombre, sizeof nombre);
string nombreStr(nombre);
auxCliente.setName(nombreStr);
leerClientes.read((char *) &estado, sizeof estado);
string estadoStr(estado);
auxCliente.setEstado(estadoStr);
leerClientes.read((char *) &direccion, sizeof direccion);
string direccionStr(direccion);
auxCliente.setDireccion(direccionStr);
leerClientes.read((char *) &rfc, sizeof rfc);
string rfcString(rfc);
auxCliente.setRfc(rfcString);
leerClientes.read((char *) &tipoC, sizeof tipoC);
string tipoCStr(tipoC);
auxCliente.setTipoCliente(tipoCStr);
//crear nuevo indice
posInicial = escribirClientesTemp.tellp();
escrindexTemp.write((char *) &codigo, sizeof codigo);
escrindexTemp.write((char *) &posInicial, sizeof posInicial);
if (codigoMod != codigoStr) //copiar del archivo
{
escribirClientesTemp.write((char *) &codigo, sizeof codigo);
char nam[50];
strcpy(nam, auxCliente.getName().c_str());
escribirClientesTemp.write((char *) &nam, sizeof nam);
strcpy(estado, auxCliente.getEstado().c_str());
escribirClientesTemp.write((char *) &estado, sizeof estado);
strcpy(direccion, auxCliente.getDireccion().c_str());
escribirClientesTemp.write((char *) &direccion, sizeof direccion);
strcpy(rfc, auxCliente.getRfc().c_str());
escribirClientesTemp.write((char *) &rfc, sizeof rfc);
strcpy(tipoC, auxCliente.getTipoCliente().c_str());
escribirClientesTemp.write((char *) &tipoC, sizeof tipoC);
} else //escribir nuevo registro
{
escribirClientesTemp.write((char *) &codigo, sizeof codigo);
char namMod[50];
strcpy(namMod, clienteModificar.getName().c_str());
escribirClientesTemp.write((char *) &namMod, sizeof namMod);
char estadoMod[50];
strcpy(estadoMod, clienteModificar.getEstado().c_str());
escribirClientesTemp.write((char *) &estadoMod, sizeof estadoMod);
char direccionMod[50];
strcpy(direccionMod, clienteModificar.getDireccion().c_str());
escribirClientesTemp.write((char *) &direccionMod, sizeof direccionMod);
char rfcMod[13];
strcpy(rfcMod, clienteModificar.getRfc().c_str());
escribirClientesTemp.write((char *) &rfcMod, sizeof rfcMod);
char tipoCMod[10];
strcpy(tipoCMod, clienteModificar.getTipoCliente().c_str());
escribirClientesTemp.write((char *) &tipoCMod, sizeof tipoCMod);
}
}
leerClientes.close();
leerInd.close();
escribirClientesTemp.close();
escrindexTemp.close();
remove("clientes.txt");
rename("tempclnt.txt", "clientes.txt");
remove("indexInv.txt");
rename("tempi.txt", "indexInv.txt");
cargarLista();
}
void MenuClientes::deleteC()
{
char codigo[50], nombre[50], estado[50], direccion[50], rfc[13], tipoC[10];
string nameStr, stateStr, addStr, rfcStr, typeStr;
long int start, posInicial;
Cliente auxCliente, clienteModificar;
string a("");
auxCliente.setCodigoCliente(a);
string codigoEliminar;
bool bandera(false);
string archivoInd("indexInv.txt");
string archivoClientes("clientes.txt");
string indTemporal("tempi.txt");
string clienteTemp("tempclnt.txt");
cout << "Ingrese el codigo del cliente que desea eliminar" << endl;
fflush(stdin);
getline(cin, codigoEliminar);
getline(cin, codigoEliminar);
ifstream leerIndex(archivoInd, ios::in);
while (!leerIndex.eof())
{
leerIndex.read((char *) &codigo, sizeof codigo);
leerIndex.read((char *) &start, sizeof start);
string codigoLeido(codigo);
if (codigoLeido == codigoEliminar)
{
bandera = true;
break;
}
}
leerIndex.close();
if(!bandera)
{
cout<<"No se encontro el codigo en la lista..."<<endl;
return;
}
//eliminacion
ifstream leerClientes(archivoClientes,ios::in);
ifstream leerInd(archivoInd,ios::in);
ofstream escribirClientesTemp(clienteTemp,ios::out);
ofstream escrindexTemp(indTemporal,ios::app);
while (!leerInd.eof())
{
//leer indice
leerInd.read((char *) &codigo, sizeof codigo);
leerInd.read((char *) &start, sizeof start);
//leer de clientes.txt
leerClientes.seekg(start);
leerClientes.read((char *) &codigo, sizeof codigo);
string codigoStr(codigo);
if (auxCliente.getCodigoCliente() == codigoStr) //criterio de paro
{
break;
}
auxCliente.setCodigoCliente(codigoStr);
leerClientes.read((char *) &nombre, sizeof nombre);
string nombreStr(nombre);
auxCliente.setName(nombreStr);
leerClientes.read((char *) &estado, sizeof estado);
string estadoStr(estado);
auxCliente.setEstado(estadoStr);
leerClientes.read((char *) &direccion, sizeof direccion);
string direccionStr(direccion);
auxCliente.setDireccion(direccionStr);
leerClientes.read((char *) &rfc, sizeof rfc);
string rfcString(rfc);
auxCliente.setRfc(rfcString);
leerClientes.read((char *) &tipoC, sizeof tipoC);
string tipoCStr(tipoC);
auxCliente.setTipoCliente(tipoCStr);
//crear nuevo indice
posInicial = escribirClientesTemp.tellp();
escrindexTemp.write((char *) &codigo, sizeof codigo);
escrindexTemp.write((char *) &posInicial, sizeof posInicial);
if (codigoEliminar != codigo) //copiar del archivo
{
escribirClientesTemp.write((char *) &codigo, sizeof codigo);
char nam[50];
strcpy(nam, auxCliente.getName().c_str());
escribirClientesTemp.write((char *) &nam, sizeof nam);
strcpy(estado, auxCliente.getEstado().c_str());
escribirClientesTemp.write((char *) &estado, sizeof estado);
strcpy(direccion, auxCliente.getDireccion().c_str());
escribirClientesTemp.write((char *) &direccion, sizeof direccion);
strcpy(rfc, auxCliente.getRfc().c_str());
escribirClientesTemp.write((char *) &rfc, sizeof rfc);
strcpy(tipoC, auxCliente.getTipoCliente().c_str());
escribirClientesTemp.write((char *) &tipoC, sizeof tipoC);
}
}
leerClientes.close();
leerInd.close();
escribirClientesTemp.close();
escrindexTemp.close();
remove("clientes.txt");
rename("tempclnt.txt", "clientes.txt");
remove("indexInv.txt");
rename("tempi.txt", "indexInv.txt");
cargarLista();
}
void MenuClientes::mainMenu()
{
char opc('x');
string edo("");
while (opc != 's')
{
//system("cls");
cout << endl << "menu principal" << endl
<< "1)agregar cliente\n2)mostrar clientes\n3)mostrar clientes por estado\n4)cargar lista\n5)Mostrar lista invertida\n6)Modificar Clientes\n7)Eliminar clientes\n8)Mostrar lista normal\ns)salir"
<< endl;
fflush(stdin);
cin >> opc;
//cin >> opc;
switch (opc)
{
case '1':
{
create();
break;
}
case '2':
{
show();
break;
}
case '3':
{
cout << endl << "Escribe el estado:\t";
fflush(stdin);
getline(cin, edo);
getline(cin, edo);
mostrarClientesPorEdo(edo);
break;
}
case '4':
{
cargarLista();
break;
}
case '5':
{
mostrarLlistaInvertida();
break;
}
case '6':
{
update();
break;
}
case '7':
{
deleteC();
break;
}
case '8':
{
mostrarLista();
break;
}
default:
break;
}
}
}
void MenuClientes::cargarLista()
{
string ind("indexInv.txt"), clnt("clientes.txt");
char codigo[50], nombre[50], estado[50], direccion[50], rfc[13], tipoC[10];
long int start;
Cliente auxCliente;
if (invertidaRAM.getAnclaEstados() != nullptr)
{
invertidaRAM.deleteAll(); //limpiamos las listas antes de leer del archivo
}
ifstream leerI(ind, ios::in);
ifstream leerCliente(clnt, ios::in);
while (!leerCliente.eof()) //&& !leerI.eof()
{
//leer indice
leerI.read((char *) &codigo, sizeof codigo);
leerI.read((char *) &start, sizeof start);
//leer cliente
leerCliente.seekg(start);
leerCliente.read((char *) &codigo, sizeof codigo);
string codigoStr(codigo);
if (auxCliente.getCodigoCliente() == codigoStr) //criterio de paro
{
break;
}
auxCliente.setCodigoCliente(codigoStr);
leerCliente.read((char *) &nombre, sizeof nombre);
string nombreStr(nombre);
auxCliente.setName(nombreStr);
leerCliente.read((char *) &estado, sizeof estado);
string estadoStr(estado);
auxCliente.setEstado(estadoStr);
leerCliente.read((char *) &direccion, sizeof direccion);
string direccionStr(direccion);
auxCliente.setDireccion(direccionStr);
leerCliente.read((char *) &rfc, sizeof rfc);
string rfcStr(rfc);
auxCliente.setRfc(rfcStr);
leerCliente.read((char *) &tipoC, sizeof tipoC);
string tipoCStr(tipoC);
auxCliente.setTipoCliente(tipoCStr);
ListaClientesRAM.insertData(ListaClientesRAM.getLastPos(), auxCliente);
//cout << getListaClientesRam().toString() << endl;
if (invertidaRAM.isListaEdosEmpty())
{
invertidaRAM.crearEstado(estadoStr, codigoStr);
}
invertidaRAM.crearEstado(estadoStr, codigoStr);
cout << "insertando a lista invertida" << endl;
}
leerCliente.close();
leerI.close();
}
void MenuClientes::mostrarLista()
{
cout << endl << endl << endl << ListaClientesRAM.toString() << endl;
}
void MenuClientes::mostrarClientesPorEdo(std::string edo)
{
string ind("indexInv.txt"), clnt("clientes.txt");
string codigoStr(""), codigoAnt("");
NodoInv *auxEdo(invertidaRAM.findEdo(edo));
char codigo[50], nombre[50], estado[50], direccion[50], rfc[13], tipoC[10];
long int start;
Cliente auxCliente;
if (auxEdo == nullptr)
{
cout << "problema con la busqueda del estado, no existe" << endl;
system("pause");
return;
}
NodoInv *auxNodoInv(auxEdo->getSecundario());
cout << invertidaRAM.estadosToString() << endl << endl;
cout << endl << "Estado:\t" << edo << endl << "Clientes:" << endl;
cout << invertidaRAM.clientesToString(edo) << endl << endl;
ifstream leerI(ind);
ifstream leerClientes(clnt);
while (auxNodoInv != nullptr)
{
while (auxNodoInv->getLLave() !=
codigoStr) // leemos los registros hasta encontrar el codigo que es igual al nodo.
{
leerI.read((char *) &codigo, sizeof codigo);
leerI.read((char *) &start, sizeof start);
codigoStr = codigo;
}
//leer cliente
leerClientes.seekg(start);
leerClientes.read((char *) &codigo, sizeof codigo);
codigoStr = codigo;
if (codigoAnt == codigoStr)
{
break;
}
leerClientes.read((char *) &nombre, sizeof nombre);
leerClientes.read((char *) &estado, sizeof estado);
leerClientes.read((char *) &direccion, sizeof direccion);
leerClientes.read((char *) &rfc, sizeof rfc);
leerClientes.read((char *) &tipoC, sizeof tipoC);
//convertir a string
string nombreStr(nombre);
string estadoStr(estado);
string direccionStr(direccion);
string rfcStr(rfc);
string tipocStr(tipoC);
//crear cliente
auxCliente.setName(nombreStr);
auxCliente.setCodigoCliente(codigoStr);
auxCliente.setEstado(estadoStr);
auxCliente.setDireccion(direccionStr);
auxCliente.setRfc(rfcStr);
auxCliente.setTipoCliente(tipocStr);
cout << auxCliente.toString() << endl;
codigoAnt = codigoStr;
auxNodoInv = auxNodoInv->getSecundario();
}
leerClientes.close();
leerI.close();
}
void MenuClientes::mostrarLlistaInvertida()
{
string llave("");
NodoInv *auxEdo(invertidaRAM.getAnclaEstados());
NodoInv *sec(nullptr);
NodoInv *prim(nullptr);
cout << "Estados" << endl;
while (auxEdo != nullptr)
{
auto a = auxEdo;
auto sigSec = auxEdo->getSecundario();
auto sigPrim = auxEdo->getPrimario();
llave = auxEdo->getLLave();
cout << "Nombre de estado: " << llave << " Direccion: " << a << " Sig. Edo. " << sigPrim
<< " Primer cliente: " << sigSec << endl;
auxEdo = auxEdo->getPrimario();
}
cout << endl << endl;
NodoInv *auxCliente(invertidaRAM.getAnclaClientes());
while (auxCliente != nullptr)
{
auto actual = auxCliente;
auto sigSecClt = auxCliente->getSecundario();
auto sigPrimClt = auxCliente->getPrimario();
llave = auxCliente->getLLave();
cout << "Clave de cliente: " << llave << " Direccion: " << actual << " Sig. Cliente del estado "
<< sigSecClt << " Siguiente cliente de la lista: " << sigPrimClt << endl;
auxCliente = auxCliente->getPrimario();
}
}
ListaClientes& MenuClientes::getListaClientesRam()
{
return ListaClientesRAM;
}