-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
82 lines (75 loc) · 2.22 KB
/
Program.cs
File metadata and controls
82 lines (75 loc) · 2.22 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
using System.Globalization;
using Repositorio;
namespace AppClientes;
class Program
{
static ClienteRepositorio _clienteRepositorio = new ClienteRepositorio();
static void Main(string[] args)
{
var cultura = new CultureInfo("pt-BR");
Thread.CurrentThread.CurrentCulture = cultura;
Thread.CurrentThread.CurrentUICulture = cultura;
while(true)
{
Menu();
Console.ReadKey();
}
}
static void Menu()
{
Console.Clear();
Console.WriteLine("Cadastro de Clientes");
Console.WriteLine("----------------------");
Console.WriteLine("1 - Cadastrar Cliente");
Console.WriteLine("2 - Exibir Cliente");
Console.WriteLine("3 - Editar Cliente");
Console.WriteLine("4 - Excluir Cliente");
Console.WriteLine("5 - Sair");
Console.WriteLine("----------------------");
EscolherOpcao();
}
static void EscolherOpcao()
{
Console.Write("Escolha uma opção: ");
var opcao = Console.ReadLine();
switch (int.Parse(opcao))
{
case 1:
{
_clienteRepositorio.CadastrarCliente();
Menu();
break;
}
case 2:
{
_clienteRepositorio.ExibirClientes();
Menu();
break;
}
case 3:
{
_clienteRepositorio.EditarCliente();
Menu();
break;
}
case 4:
{
_clienteRepositorio.ExcluirCliente();
Menu();
break;
}
case 5:
{
_clienteRepositorio.GravarDadosClientes();
Environment.Exit(0);
break;
}
default:
{
Console.Clear();
Console.WriteLine("Opção Inválida!");
break;
}
}
}
}