static void Main(string[] args) { var client = new Client(); client.name = "Client 1"; client.email = "*****@*****.**"; client.documentNumber = "ABC"; var employee = new Employee(); employee.name = "Employee 50"; employee.email = "*****@*****.**"; employee.registrationNumber = "ER34"; employee.cellPhone = "55112222222"; var savePeople = new SavePeople(); var sendMessage = new SendMessage(); employee.Accept(savePeople); employee.Accept(sendMessage); client.Accept(savePeople); client.Accept(sendMessage); }
private static void ExecutionVisitors(Employee emp) { NetAnnualEarningVisitor netAnnualEarningVisitor = new NetAnnualEarningVisitor(); emp.Accept(netAnnualEarningVisitor); TaxableAmountVisitor annualTaxableAmount = new TaxableAmountVisitor(); emp.Accept(annualTaxableAmount); Console.WriteLine("Annual Net Earning Amount : {0}", netAnnualEarningVisitor.NetEarningoftheYear); Console.WriteLine("Annual Taxable Amount : {0}", annualTaxableAmount.TaxableAmount); }