-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
86 lines (73 loc) · 2.66 KB
/
Program.cs
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
using System;
using WorkerInfo.Entites;
using WorkerInfo.Entites.Enum;
namespace WorkerInfo
{
class Program
{
static void Main(string[] args)
{
string name;
Departament departamento;
int levelInt;
int escolha;
double baseSalary;
WorkLevel level = new WorkLevel();
bool on = true;
Console.WriteLine("Insira as informações do trabalhador.");
Console.Write("Departamento: ");
departamento = new Departament(Console.ReadLine());
Console.Write("Nome: ");
name = Console.ReadLine();
Console.Write("Nivel (Junior = 1/Pleno = 2/Senior = 3): ");
levelInt = int.Parse(Console.ReadLine());
Console.Write("Salario: ");
baseSalary = double.Parse(Console.ReadLine());
if (levelInt == 1) { level = WorkLevel.JUNIOR; }
if (levelInt == 2) { level = WorkLevel.MID_LEVEL; }
if (levelInt == 3) { level = WorkLevel.SENIOR; }
Worker worker = new Worker(name, level, baseSalary, departamento);
while(on)
{
Console.WriteLine(worker);
Console.WriteLine("Você deseja.");
Console.WriteLine("1 - Novo Contrato \n2 - Apagar Contrato\n3 - Saber Ganho\n4 - Sair");
escolha = int.Parse(Console.ReadLine());
if (escolha == 4) { on = false; }
Escolhas(escolha, worker);
}
}
static void Escolhas(int escolha, Worker worker)
{
switch (escolha)
{
case 1:
Console.WriteLine("Quantos contratos esse trabalhador tem ?");
Console.WriteLine("Contratos: ");
int contratos = int.Parse(Console.ReadLine());
for (int i = 0; i < contratos; i++)
{
Console.WriteLine($"Contrato #{i}");
worker.AddContract();
Console.Clear();
}
break;
case 2:
worker.RemoveContract();
Console.ReadLine();
Console.Clear();
break;
case 3:
worker.Income();
Console.ReadLine();
Console.Clear();
break;
default:
Console.WriteLine("Invalido");
Console.ReadLine();
Console.Clear();
break;
}
}
}
}