Пример #1
0
        private void AddProduct_Click(object sender, EventArgs e)
        {
            ProductEditForm form   = new ProductEditForm();
            var             result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                _productsRepository.Insert(form.Product);
                FillGrids();
            }
        }
Пример #2
0
        private void UpdateProduct_Click(object sender, EventArgs e)
        {
            Product product = (Product)ProductsDataGrid.CurrentRow.DataBoundItem;

            ProductEditForm form   = new ProductEditForm(product);
            var             result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                _productsRepository.Update(form.Product);
                FillGrids();
            }
        }