protected void Agregar_Click(object sender, EventArgs e) { int IdNegocio = Convert.ToInt16(Session["IdNegocio"]); ObjEN = ObjNN.BuscarNegocioPorId(IdNegocio); ObjEP = ObjNP.BuscarProductoPorNombre(ddlNombre.Text); ObjEPN.IdProducto = ObjEP.IdProducto; ObjEPN.IdNegocios = ObjEN.IdNegocios; if (Precio.Text.All(char.IsDigit)) { ObjEPN.Precios = Convert.ToInt16(Precio.Text); string msnPN = ObjNPN.InsertarProductoNegocios(ObjEPN); Response.Redirect("productos.aspx"); } else { perror.Text = "¡Introduce solo números!"; } }