コード例 #1
0
        private static void InserindoCliente(ClienteRowGateWay clienteRowGateWay)
        {
            Cliente cliente = new Cliente()
            {
                DataNascimento = DateTime.Parse("04/05/1982"),
                Nome           = "Cliente Teste",
                Sobrenome      = "Teste",
                Enderecos      = new System.Collections.Generic.List <Endereco>()
                {
                    new Endereco {
                        Logradouro = "a", Bairro = "b", Cidade = "c", Estado = "e", Cep = "18135070", Tipo = TipoEndereco.Residencial
                    },
                    new Endereco {
                        Logradouro = "f", Bairro = "g", Cidade = "h", Estado = "i", Cep = "18135070", Tipo = TipoEndereco.Comercial
                    }
                }
            };

            clienteRowGateWay.Idade          = cliente.Idade;
            clienteRowGateWay.Nome           = cliente.Nome;
            clienteRowGateWay.Sobrenome      = cliente.Sobrenome;
            clienteRowGateWay.DataNascimento = cliente.DataNascimento;

            clienteRowGateWay.Insert();

            cliente.Id = clienteRowGateWay.Id;
        }
コード例 #2
0
        static void Main(string[] args)
        {
            ClienteRowGateWay clienteRowGateWay = new ClienteRowGateWay();

            InserindoCliente(clienteRowGateWay);
            ExibindoTodosClientes();

            AtualizandoCliente(clienteRowGateWay.Id);
            ExibindoTodosClientes();

            RemovendoCliente(clienteRowGateWay);
            ExibindoTodosClientes();
        }
コード例 #3
0
 private static void RemovendoCliente(ClienteRowGateWay clienteRowGateWay)
 {
     clienteRowGateWay.Delete();
 }