Exemplo n.º 1
0
        private void OnProductAdd(object sender, EventArgs e)
        {
            var button = sender as ToolStripMenuItem;

            var form = new ProductDetailForm("Add Movie Details");

            //Show form modally
            var result = form.ShowDialog(this);

            if (result != DialogResult.OK)
            {
                return;
            }

            //"Add" the product
            _product = form.Product;
        }
Exemplo n.º 2
0
        private void OnProductEdit(object sender, EventArgs e)
        {
            if (_product == null)
            {
                return;
            }

            var form = new ProductDetailForm(_product);
            //form.Product = _product;

            //Show form modally
            var result = form.ShowDialog(this);

            if (result != DialogResult.OK)
            {
                return;
            }

            //"Editing" the product
            _product = form.Product;
        }