Skip to content

Commit

Permalink
feat: client register
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus-mondaini committed May 28, 2023
1 parent 045d071 commit 8e8d08b
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 8 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/PedidoInternacional/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/PedidoInternacional/v17/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
37 changes: 29 additions & 8 deletions PedidoInternacional/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
using System;
using System.Linq;
using System.Runtime.CompilerServices;

namespace PedidoInternacional
{
class Program
{
static List<Cliente> clientes = new List<Cliente>();
static void Main(string[] args)
{
MenuPrincipal.MostrarOpcoes();
while (MenuPrincipal.Escolha()!=8)
int opcao;
do
{
switch(MenuPrincipal.Escolha())
opcao = MenuPrincipal.Escolha();
switch (opcao)
{
case 2:
{
Cliente.Registrar();
Cliente.Registrar(clientes);
break;
}
case 8:
Expand All @@ -25,10 +29,11 @@ static void Main(string[] args)
default:
{
Console.WriteLine("Opção inválida! Tente novamente. ");
Console.WriteLine();
break;
}
}
}
} while (opcao != 8);
}
public class MenuPrincipal
{
Expand Down Expand Up @@ -57,12 +62,28 @@ public class Produto
}
public class Cliente
{
public int codigo { get; set; }
public string nome { get; set; }
public Pais pais { get; set; }
public static void Registrar()
public int Codigo { get; set; }
public string Nome { get; set; }
public Pais Pais { get; set; }
public static void Registrar(List<Cliente> clientes)
{
int codCliente = clientes.Count;
Console.WriteLine();
Console.WriteLine($"Cadastre o Cliente {codCliente + 1}");
Console.WriteLine("Digite o nome do cliente: ");
string nomeCliente = Console.ReadLine();
//Console.WriteLine("Digite o código do país: ");
//int codPais = Convert.ToInt32(Console.ReadLine());

Cliente cliente = new Cliente()
{
Codigo = codCliente,
Nome = nomeCliente,
//Pais = pais
};
clientes.Add(cliente);
Console.WriteLine("Cliente cadastrado com sucesso");
Console.WriteLine();
}

}
Expand Down
Binary file modified PedidoInternacional/bin/Debug/net7.0/PedidoInternacional.dll
Binary file not shown.
Binary file modified PedidoInternacional/bin/Debug/net7.0/PedidoInternacional.pdb
Binary file not shown.
Binary file modified PedidoInternacional/obj/Debug/net7.0/PedidoInternacional.dll
Binary file not shown.
Binary file modified PedidoInternacional/obj/Debug/net7.0/PedidoInternacional.pdb
Binary file not shown.
Binary file modified PedidoInternacional/obj/Debug/net7.0/ref/PedidoInternacional.dll
Binary file not shown.
Binary file not shown.

0 comments on commit 8e8d08b

Please sign in to comment.