Exemple #1
0
 // Construtor sem PK
 public Endereco(Bairro neighborhood, int type, string Street, string number, int zipcode)
 {
     Logradouro = Street;
     tipo_endereco = type;
     Bairro_Endereco = neighborhood.Cod_Bairro;
     Numero = number;
     CEP = zipcode;
 }
Exemple #2
0
 // Construtor com PK
 public Endereco(int codigo, Bairro neighborhood, Tipo_Endereco type,string Street,   string number, int zipcode)
 {
     cod_end = codigo;
     Logradouro = Street;
     tipo_endereco = type.Cod_tp_endereco;
     Bairro_Endereco = neighborhood.Cod_Bairro;
     Numero = number;
     CEP = zipcode;
 }
 public bool Delete(Bairro neighborhood)
 {
     try
     {
         DadosBairro.Excluir(neighborhood);
         return true;
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public bool Alter(Bairro neighborhood)
 {
     try
     {
         DadosBairro.Alterar(neighborhood);
         return true;
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public bool Insert(string municipio, string nome)
        {
            MunicipioNegocio municipioNegocio = new MunicipioNegocio();

            Municipio municipioBusca = municipioNegocio.Buscar(municipio);

            Bairro bairro = new Bairro(municipioBusca.Cod_municipio1, nome);

            try
            {
                DadosBairro.Inserir(bairro);
                return true;
            }
            catch (Exception e)
            {
                throw e;
            }
        }