-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
56 lines (55 loc) · 1.56 KB
/
main.c
File metadata and controls
56 lines (55 loc) · 1.56 KB
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <locale.h>
#include <windows.h>
#include "constantes.h"
#include "vistas.h"
#include "lectores.h"
#include "mensajes.h"
#include "utilities.h"
int main(){
system("cls");
hidecursor(0); // OCULTA CURSOR
char key;
InitialMenu();
do{
fflush(stdin);
key = getch();
switch(key)
{
case UNO: // INICIO DE SESION
system("cls");
LoginLector(archivoLectores);
InitialMenu();
break;
case DOS: // REGISTRO
system("cls");
if (UserRegistration(archivoLectores) > 0){// grabo un nuevo usuario al archivo
MostrarMensaje("USUARIO CREADO SATISFACTORIAMENTE");
} else {
MostrarMensaje("CANCELANDO...ESPERE.");
}
InitialMenu();
break;
case OCHO: // OLIVDE MI PASSWORD
MensajeAdminMenu();
MensajesAlAdministrador(0); // el cero es por mensaje de olvide password
InitialMenu();
break;
case NUEVE: // DESBLOQUEAR USUARIO
MensajeAdminMenu();
MensajesAlAdministrador(1); // el uno es por mensaje de desbloqueo
InitialMenu();
break;
case ESC: /// SALIR
system("cls");
MostrarMensaje("GRACIAS POR USAR NUESTRO SISTEMA.");
gotoxy(1,23);
break;
}
}
while (key != ESC);
return 0;
}