//This methods checks which cell has been clicked and then opens a dialog to edit or remove a specific product
        public void DataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                if (e.ColumnIndex == 12)
                {
                    // run edit screen here
                    // make an editscreen with current product as argument
                    var editProduct = new EditProductScreen(ProductModel.Result[e.RowIndex]);
                    editProduct.ShowDialog();
                    _screen.assortmentGridView.DataSource = null;
                    _screen.assortmentGridView.DataSource = ProductModel.Result;
                    FillData();
                    this.RemoveFilters();
                }

                if (e.ColumnIndex == 13)
                {
                    var removeProduct = new RemoveProductScreen(ProductModel.Result[e.RowIndex]);
                    removeProduct.ShowDialog();
                    _screen.assortmentGridView.DataSource = null;
                    _screen.assortmentGridView.DataSource = ProductModel.Result;
                    FillData();
                    this.RemoveFilters();
                }
            }
        }
 public EditProductController(EditProductScreen screen, ProductModel productModel)
 {
     this._screen       = screen;
     _dbc               = DatabaseController.Instance;
     this._productModel = productModel;
     _currentImagePath  = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                          @"\Kantoor Inrichting\Afbeeldingen producten\" + productModel.ImageFileName;
     _isNewImage = false;
     FillComboBox();
     FillTextBoxes();
 }