static void Main(string[] args) { Console.WriteLine("Digite o cpf para migrar o telefone:"); var cpf = Console.ReadLine(); customer = getCustumer(cpf); Console.WriteLine("Customer name: {0} and telefone {1}", customer.Name, customer.Phone); Console.WriteLine("Validando financeiro"); customer = ObterStatusFinanceiroCliente(cpf); if (customer.FinanceStatus) { Common.Contracts.Account account = ObterDadosConta(customer); Console.WriteLine("Account: {0} , solicitando portabilidade", account.Agency); abrirHost(); bilhete = SolicitarBilhetePortabilidade(customer, account); Console.WriteLine("Recebido Ticket {0}. aguardando resposta anatel", bilhete.Ticket); } else { Console.WriteLine("É necessário atualizar o financeiro."); } Console.ReadKey(); if (host != null) { if (host.State == CommunicationState.Faulted) { host.Abort(); } host.Close(); ((IDisposable)host).Dispose(); } }
//private static Common.Contracts.Account convert(Inovix.Service.ConsoleHost.KgbService.Account account) //{ // if (account != null) // { // return new AptService.Account() // { // AccountNumber = account.AccountNumber, // Agency = account.Agency, // Id = account.Id // }; // } // return null; //} //private static Common.Contracts.Customer convert(Inovix.Service.ConsoleHost.KgbService.Customer customer) //{ // if (customer == null) // { // return new AptService.Customer() // { // Cpf = customer.Cpf, // FinanceStatus = customer.FinanceStatus, // Id = customer.Id, // Name = customer.Name, // Phone = customer.Phone // }; // } // return null; //} public static Common.Contracts.Portability SolicitarBilhetePortabilidade(Common.Contracts.Customer customer, Common.Contracts.Account account) { Common.Contracts.Portability p = null; AptService.AptServiceClient service = null; try { service = new AptService.AptServiceClient(); p = service.SolicitarBilhetePortabilidade(customer, account); } catch (Exception) { if (service != null) { service.Abort(); } throw; } finally { if (service != null) { service.Close(); } } return(p); }
static void Main(string[] args) { Console.WriteLine("Digite o cpf para migrar o telefone:"); var cpf = Console.ReadLine(); customer = getCustumer(cpf); Console.WriteLine("Customer name: {0} and telefone {1}", customer.Name, customer.Phone); Console.WriteLine("Validando financeiro"); customer = ObterStatusFinanceiroCliente(cpf); if (customer.FinanceStatus) { Common.Contracts.Account account = ObterDadosConta(customer); Console.WriteLine("Account: {0} , solicitando portabilidade", account.Agency); abrirHost(); bilhete = SolicitarBilhetePortabilidade(customer, account); Console.WriteLine("Recebido Ticket {0}. aguardando resposta anatel", bilhete.Ticket); } else { Console.WriteLine("É necessário atualizar o financeiro."); } Console.ReadKey(); if (host != null) { if (host.State == CommunicationState.Faulted) { host.Abort(); } host.Close(); ((IDisposable)host).Dispose(); } }