public void EditProduct(int productToEdit) { Product tempProductToEdit = new Product(); tempProductToEdit = registeredProductsController.product[productToEdit]; RemoveProductFromJson(productToEdit); addProductController.EditProduct(tempProductToEdit); }