private void btnAgregar_Click(object sender, EventArgs e) { Proveedor aux = new Proveedor(); PersonaJuridicaNegocio auxnegocio = new PersonaJuridicaNegocio(); ProveedorNegocio negocio = new ProveedorNegocio(); try { if (txtCuit.Text == "" || txtNombreProv.Text == "" || txtRazonSocial.Text == "" || txtTelefono.Text == "") { MessageBox.Show("Solo el campo EMAIL puede estar vacio", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { int auxint; aux.Nombre = txtNombreProv.Text; aux.Telefono = txtTelefono.Text; aux.contacto = txtContacto.Text; aux.razonSocial = txtRazonSocial.Text; aux.cuit = Int64.Parse(txtCuit.Text); aux.estado = true; auxnegocio.Agregar_PersonaJuridica(aux.razonSocial, aux.cuit, aux.estado); auxint = auxnegocio.recuperar_id(); aux.id = auxint; negocio.Agregar_proveedor(aux); cargar_grilla(); } } catch (Exception ex) { throw ex; } finally { txtNombreProv.Text = ""; txtTelefono.Text = ""; txtContacto.Text = ""; txtRazonSocial.Text = ""; txtCuit.Text = ""; } }