-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·85 lines (70 loc) · 1.83 KB
/
main.cpp
File metadata and controls
executable file
·85 lines (70 loc) · 1.83 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
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
#include <iostream>
#include "menuProv.h"
#include "menuProd.h"
#include "MenuOrdenCompra.h"
#include "MenuEmpleados.h"
#include "MenuClientes.h"
#include "MenuFacturas.h"
#include "MenuVenta.h"
#include "MenuUsuarios.h"
#include "MenuPrincipal.h"
using namespace std;
int main() {
string username;
string password;
char opcRoot('x');
string tipoUsuario;
MenuUsuarios mu;
mu.read();
bool loged = false;
while (loged == false)
{
cout << "Escribe el nombre de usuario" << endl;
fflush(stdin);
getline(cin, username);
cout << "Escribe tu contraseña" << endl;
getline(cin, password);
tipoUsuario = mu.findUser(username,password);
if (tipoUsuario != "invalido")
{
cout << "Bienvenido Usuario "<< username << endl;
cout << "Tipo de usuario:\t" << tipoUsuario;
loged = true;
} else
{
cout << "ingreso incorrecto" << endl;
}
}
MenuPrincipal menuP(tipoUsuario,username);
if (tipoUsuario == "admin")
{
menuP.menuAdministradores();
} else if (tipoUsuario == "base")
{
menuP.menuBase();
} else if (tipoUsuario == "root")
{
while (opcRoot != 's')
{
cout << "Menu Root:\n\n1) Menu usuarios\n2) Menu admin\ns) salir" << endl;
fflush(stdin);
cin >> opcRoot;
switch (opcRoot)
{
case '1':
{
menuP.menuUsuarios();
break;
}
case '2':
{
menuP.menuAdministradores();
break;
}
default:
break;
}
}
}
cout << "\n\n\n\nHasta luego!\n\n" << endl;
}