Last active
March 6, 2022 20:15
-
-
Save flaviorl-net/b7ccf2b40be530f8c230dfa1ba510795 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace FactoryMethod | |
{ | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string funil = "suspect"; | |
if (funil == "suspect") | |
{ | |
Suspect suspect = new Suspect(); | |
suspect.CadastrarSuspect("James", "Hetfield", "123456789", "Downey, Califórnia, EUA"); | |
} | |
if (funil == "prospect") | |
{ | |
Prospect prospect = new Prospect(); | |
prospect.CadastrarProspect("James", "Hetfield", "123456789", "Downey, Califórnia, EUA"); | |
} | |
Console.ReadKey(); | |
} | |
} | |
public class Suspect | |
{ | |
public void CadastrarSuspect(string nome, string sobrenome, string celular, string endereco) | |
{ | |
//Cadastra no banco de dados | |
Console.WriteLine("Suspect {0} Cadastrado.", nome); | |
} | |
} | |
public class Prospect | |
{ | |
public void CadastrarProspect(string nome, string sobrenome, string celular, string endereco) | |
{ | |
//Cadastra no banco de dados | |
Console.WriteLine("Prospect {0} Cadastrado.", nome); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment