private void BtnAddNew_Click(object sender, EventArgs e)
        {
            ProductViewModel viewModel = new ProductViewModel()
            {
                NameText      = txtName.Text,
                PriceText     = txtPrice.Text,
                PhotoPathText = txtPhotoPath.Text
            };

            AddNewProduct?.Invoke(this, viewModel);
        }
Beispiel #2
0
        private void AcceptBtn_Click(object sender, EventArgs e)
        {
            if (Id != 0)
            {
                UpdateProduct.Invoke(sender, EventArgs.Empty);
            }
            else
            {
                AddNewProduct.Invoke(sender, EventArgs.Empty);
            }

            UpdateDataGridView();
            ClearGroupBoxFields();
        }