示例#1
0
        /// <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();
            }
        }
示例#2
0
 //product delete call
 public int DeleteProduct(ProductModel aProductModel)
 {
     return(newProductGateway.DeleteProduct(aProductModel));
 }