forked from catarinaivf/Bibliotecas-Universal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menuLIVROS.h
125 lines (95 loc) · 3.21 KB
/
menuLIVROS.h
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
#include <stdio.h>
#include <stdlib.h>
void LISTA_LIVROS(void){ // Menu Livros -> Lista
system("cls"); // Limpa o ecrã
int op; // variável a "entrar" - op
printf("\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD LIVROS - Lista \xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
printf("\n\n\t\t ID DO LIVRO:");
printf("\n\t\t 0. Voltar");
scanf("%d", &op); // FALTA SABER COMO INSERIR O ID DO LIVRO E O PROGRAMA IR BUSCAR AO FICHEIRO COM OS ID'S DOS LIVROS TODOS
if (op==0) // se inserir 0, volta para o menu principal
{
return;
}
else // tudo o resto, vai para o menu ListaIDL - Lista - ID livro - apresenta informações
{
}
return(0);
}
void NOVO_LIVRO(void) // Menu Livros -> Adicionar Novo Livro
{
system ("cls"); // Limpa o ecrã
char tit, aut, ed, gen; // variaveis a entrar: titulo , autor, editora, género ; char porque vamos guardar caracteres
int op;
printf("\t\t Título do Livro:");
scanf("%c", &tit); // %c por ser do tipo char, falta saber se é suposto usar o &
printf("\n\t\t Autor:");
scanf("%c", &aut);
printf("\n\t\t Editora:");
scanf("%c", &ed);
printf("\n\t\t Género:");
scanf("%c", &gen);
// FALTA SABER COMO GUARDAR AS INFORMAÇÕES
// Falta saber como e que o sistema atribui um ID de Livro
printf("\n\n\t\t0. Voltar");
scanf("%d", &op);
switch(op){
case '0':
return;
break;
}while (op !=0);
}
void EDITAR_LIVRO(void){ // Menu livros -> Lista -> ID Livro -> Editar
// como fazer para alterar as informações novas???
}
void REQUISI_LIVRO(void){ // Menu Livros -> Lista -> ID LIVRO -> Requisição
system ("cls");
int IDUtili; // variavel a entrar
printf("\n\n\t\t Inserir ID de Utilizador:");
scanf("%d", &IDUtili);
// falta saber como associar a requisição do livro ao utilizador
}
void ID_LIVRO(void){ // Menu Livros --> lista --> ID LIVRO , após inserir o ID do Livro
system("cls"); // limpa o ecrã
printf("\n\t\tTítulo:");
// AIDICONAR PROGRAMAÇAO PARA DEVOLVER A "INFORMAÇÃO"
printf("\n\t\t Disponibilidade:");
// DEVOLVER A "INFORMAÇÃO"
// falta fazer como aparecer as informações relativas ao ID do Livro, deverá aparecer o Título e a Disponibilidade
int op; // variavel a "entrar" - op
printf("\n\n\t\t 1. REQUISICAO");
printf("\n\n\t\t 2. EDITAR");
printf("\n\n\t\t 0. Voltar");
scanf("%d", &op);
switch(op){
case '1': // Se 1, vai para menu RequiL - requisição do livro
REQUISI_LIVRO();
break;
case '2': // Se 2, vai para ADICIONAR NOVO LIVRO
EDITAR_LIVRO();
break;
case '0': // Volta para o menu Lista
return;
break;
}while (op !=0);
}
void LIVROS(void){ // menu LIVROS
system("cls"); //limpa o ecrã
int op; // variável a "entrar" - op
printf("\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD LIVROS \xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD");
printf("\n\n \t\t 1. LISTA");
printf("\n\t\t 2. ADICIONAR NOVO LIVRO");
printf("\n\t\t 0. VOLTAR");
scanf("%d", &op);
switch(op){
case '1': // Se 1, vai para menu LISTA
LISTA_LIVROS();
break;
case '2': // Se 2, vai para ADICIONAR NOVO LIVRO
NOVO_LIVRO();
break;
case '0': // Volta para o menu principal
return;
break;
}while (op !=0);
}