예제 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //Abre el Forms EditProduct
            EditProduct edit = new EditProduct(this);

            edit.Show();
        }
예제 #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            //Abre el Forms EditProduct y le pasa el producto actualmente seleccionado
            EditProduct edit = new EditProduct(this, listProducts.SelectedItem as Product);

            edit.Show();
        }
예제 #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //Reinicia el forms Edit Product y le pasa la nueva categoria
            string category = null;

            if (txtCategory.Text.Length > 0)
            {
                category = txtCategory.Text;                               //Comprueba si hay algo escrito
            }
            EditProduct edit2 = new EditProduct(admin, product, category);

            this.Close();
            edit.Close();
            edit2.Show();
        }