public void btnCadastrar_Click(object sender, EventArgs e) { if (VerificarDigitacao() == false) { return; } BLL.Fornecedor f = new BLL.Fornecedor(); f.RazaoSocial = txtRazao.Text; f.NomeFantasia = txtNomeFant.Text; f.CEP = txtCep.Text; f.Numero = txtNumero.Text; f.Complemento = txtComplemento.Text; f.StatusFornecedor = 1; f.IncluirComParametro(); MessageBox.Show("Inserido com sucesso"); }
private void CadastrarFornecedor(object o, EventArgs e) { BLL.Fornecedor f = new BLL.Fornecedor(); f.NomeFantasia = txtFantasia.Text; f.CNPJ = txtCnpj.Text; f.RazaoSocial = txtRazao.Text; f.Email = txtEmail.Text; f.Tel = txtTel.Text; f.CEP = txtCep.Text; f.Complemento = txtComplemento.Text; f.Numero = Convert.ToInt32(txtNumero.Text); f.StatusFornecedor = 1; f.IncluirComParametro(); MessageBox.Show("Fornecedor cadastrado com sucesso !!"); DialogResult dr = MessageBox.Show("Deseja Cadastrar outro Fornecedor ?", "Fornecedor", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { txtFantasia.Clear(); txtEndereco.Clear(); txtBairro.Clear(); txtCidade.Clear(); txtEmail.Clear(); txtTel.Clear(); txtComplemento.Clear(); txtCnpj.Clear(); txtRazao.Clear(); txtCep.Clear(); txtNumero.Clear(); cbUF.SelectedText = ""; txtFantasia.Focus(); //Limpar text e colocar foco no txt nome } else { Consultar.FrmListagemFornecedores n = new Consultar.FrmListagemFornecedores(); Close(); n.ShowDialog(); } }