コード例 #1
0
        private bool cadastrarEndereço()
        {
            try
            {
                Dados dados = new Dados();
                txtCEP.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
                string strCEP = txtCEP.Text.Replace(" ", "").Trim();
                dados.cadastrar_endereco(Convert.ToInt32(strCEP), txtEndereco.Text, Convert.ToInt32(txtNumero.Text.Trim()), txtUF.Text, txtCidade.Text, txtBairro.Text);
                if(!dados.cadastrar_estabelecimento(txtEndereco.Text, Convert.ToInt32(strCEP), Convert.ToInt32(txtNumero.Text), txtNome.Text))
                {
                    return false;
                }

                return true;
            }
            catch
            {
                return false;
            }
        }