private void btnconsultar_Click(object sender, EventArgs e) { Form consultar = new ConsultarProductos(); this.Hide(); consultar.Show(); }
private void btnremover_Click(object sender, EventArgs e) { if (this.txtno.TextLength == 0) { MessageBox.Show("Ingresa el ID del producto"); } else { int id = Int32.Parse(this.txtno.Text); try { Producto.Cart.RemoveAt(id); MessageBox.Show("El producto fue eliminado"); this.Hide(); Form consultar = new ConsultarProductos(); consultar.Show(); } catch (System.ArgumentOutOfRangeException) { MessageBox.Show("El ID " + id + " no es válido"); } } }