コード例 #1
0
ファイル: Inicio.cs プロジェクト: PoorTunic/shopping-example
        private void btnconsultar_Click(object sender, EventArgs e)
        {
            Form consultar = new ConsultarProductos();

            this.Hide();
            consultar.Show();
        }
コード例 #2
0
 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");
         }
     }
 }