Пример #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
 public AddCategory(EditProduct edit, Admin admin, Product product)
 {
     //Tomar los parametros del Forms Edit Product
     this.edit    = edit;
     this.product = product;
     this.admin   = admin;
     InitializeComponent();
 }
Пример #4
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();
        }