/// <summary> /// Call gateway.DeleteProduct() to initiate delete of selected product, if product cannot be deleted gateway.DeleteProduct /// does not return null and response is shown to user via MessageBox. /// </summary> private void btnDeleteProduct_Click(object sender, RoutedEventArgs e) { Product p = ProductsListView.SelectedItem as Product; if (p != null) { string returned = gateway.DeleteProduct(p); if (returned != null) { MessageBox.Show(returned); } BindProducts(); } }
//product delete call public int DeleteProduct(ProductModel aProductModel) { return(newProductGateway.DeleteProduct(aProductModel)); }