-
Notifications
You must be signed in to change notification settings - Fork 0
/
Proveedor.cpp
107 lines (82 loc) · 1.92 KB
/
Proveedor.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
#include<iostream>
#include <cstring>
#include "Utilidades.h"
#include "Persona.h"
#include "Fecha.h"
#include "Proveedor.h"
#include "ArchivosTemplate.h"
using namespace std;
Proveedor::Proveedor() {
}
string Proveedor::getTipo() const {
//A - ALIMENTOS, B - BEBIDAS, S - SERVICIOS GENERALES
string retornar;
switch (_tipo) {
case 'A':
retornar = "ALIMENTICIO ";
return retornar;
break;
case 'a':
retornar = "ALIMENTICIO ";
return retornar;
break;
case 'B':
retornar = " BEBIDAS ";
return retornar;
break;
case 'b':
retornar = " BEBIDAS ";
return retornar;
break;
case 'S':
retornar = "SERVICIOS GENERALES ";
return retornar;
break;
case 's':
retornar = "SERVICIOS GENERALES ";
return retornar;
break;
}
return retornar;
}
std::string Proveedor::getEmpresa() {
return _perteneciente;
}
void Proveedor::setTipo(char tipo) {
_tipo = tipo;
}
void Proveedor::cargarProveedor() {
Utilidades util;
cargarPersona(4);
char tipo;
string empresa;
cout << "Ingrese Tipo del proveedor " << endl;
cout << " A - ALIMENTOS , B - BEBIDAS, S - SERVICIOS GENERALES " << endl;
cin >> tipo;
util.validarChar(tipo);
while (tipo != 'A' && tipo != 'a' && tipo != 'S' && tipo != 's'
&& tipo != 'b' && tipo != 'B') {
cout << "Tipo Inexistente ,ingrese nuevamente " << endl;
cin >> tipo;
util.validarChar(tipo);
}
setTipo(tipo);
cin.ignore();
string empresaprov;
cout << "Ingrese Empresa proveedora : " << endl;
getline(cin, empresaprov);
strcpy(_perteneciente, empresaprov.c_str());
cout << endl;
}
string Proveedor::mostrarProveedorstring() {
string retornar = mostrarPersonastring();
retornar += "Tipo Proveedor : " + getTipo() + "\n"
+ "Empresa perteneciente : " + getEmpresa() ;
return retornar;
}
void Proveedor::mostrar() {
mostrarPersona();
cout << "Tipo Proveedor : " << getTipo() << endl;
cout << "Empresa perteneciente : " << getEmpresa() << endl;
cout << endl;
}