public void refreshList() { EmpresarioBLL empBLL = new EmpresarioBLL(); tbEmpresario.DataSource = empBLL.select(); tbEmpresario.Columns.Remove("idBairro"); tbEmpresario.Columns.Remove("idEmpresario"); }
private void btAdd_Click(object sender, EventArgs e) { try { Types.EmpresarioType empresario = new Types.EmpresarioType(); empresario.Nome = txtNome.Text; empresario.Sobrenome = txtSobrenome.Text; empresario.Email = txtEmail.Text; empresario.CPF = txtCPF.Text; empresario.RG = txtRG.Text; empresario.Endereco = txtEndereco.Text; empresario.idBairro = cbBairro.SelectedValue.ToString(); EmpresarioBLL bll = new EmpresarioBLL(); bll.insert(empresario); refreshList(); }catch(Exception erro){ MessageBox.Show(erro.Message); } }