public void DeleteSelectedProduct(int id) { if (id != 0) { db.DeleteProduct(id); } else { throw new Exception("Cannot delete"); } }