-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.hs
105 lines (87 loc) · 3.04 KB
/
Main.hs
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
module Main where
import Preco
import Dados
import Compra
import Mais_Vendido
import Facturas
import FaturaCliente
--menu adjuto para chamar a função meuPreco do modulo Preco
verPreco::IO()
verPreco=do
putStr "\n------------------- Menu Preco ------------------\n"
putStr("1-Consultar preco\n2-Menu principal \n\nDigite:")
op<-readLn :: IO Int
case op of
1-> meuPreco
2-> main
putStr("Prima qualquer tecla seguido de Enter para voltar ")
c<-getLine
verPreco
--menu adjuto para chamar a função meuPreco do modulo Preco
listar_facturas_Data::IO()
listar_facturas_Data=do
--putStr "\n------------------- Menu Ver Factura Daiara ------------------\n"
putStr("Digite a data:")
datA<-readLn
buscaFacturaData datA
putStr("Prima qualquer tecla seguido de Enter para voltar ")
c<-getLine
main
--menu adjuto para chamar a função listar do modulo Dados
listar_dados::IO()
listar_dados = do
listar
putStrLn "\nDIGITE {ENTER} PARA CONTINUAR"
a <- getLine
main
--menu adjuto para chamar a função listar Factura do modulo Facturas
listar_facturas::IO()
listar_facturas= do
buscarFactura
putStrLn "\nDIGITE {ENTER} PARA CONTINUAR"
a <- getLine
main
--menu adjunto para chamar a função compra do modulo Compra
efectuarCompra::IO()
efectuarCompra = do
compra
putStrLn "\n COMPRA EFECTUADO COM SUCESSO!\n\n\n"
main
--menu função adjunta para chamar a função que verifca o automovel mais vendido
carroMaisVendido::IO()
carroMaisVendido = do
putStr "AUTOMOVEL MAIS VENDIDO\n------------------------------------------\n"
putStr "O Automovel mais vendido é: "
chamar
main
buscaCarroCod::IO()
buscaCarroCod = do
putStr "___________________________________________________________________\n"
putStr "Digite o Codigo da Factura: "
a<-getLine
buscaCodigo (read a)
putStrLn "Digite ENTER para Sair"
b<-getLine
main
main::IO()
main = do
putStr "-------------- Menu ------------------\n"
putStr "1- Ver Preçario\n"
putStr "2- Listar Automóvel\n"
putStr "3- Efectuar Compra\n"
putStr "4- Consultar Factura\n"
putStr "5- Ver Factura do Diário\n"
putStr "6- Ver todas Facturas\n"
putStr "7- Mostrar as informações do automóvel mais vendido\n"
putStr "8- Sair\n *Selecione a Tarefa que deseja realizar: "
op<-getLine
case read(op) of
1-> verPreco
2-> listar_dados
3-> efectuarCompra
4-> buscaCarroCod
5-> listar_facturas_Data
6-> listar_facturas
7-> carroMaisVendido
8-> putStrLn (" ")
_-> main