Exemplo n.º 1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            var product = new Product();

            product.Name        = txtName.Text;
            product.Description = txtDesc.Text;
            product.SKU         = txtSKU.Text;
            product.Vendor      = txtVendor.Text;
            product.IsDeleted   = true;
            int productID;

            if (int.TryParse(hdnProductId.Value, out productID))
            {
                product.ProductId = productID;
            }

            businessHelper.ManageProduct(product);

            grdProducts.DataSource = businessHelper.GetProducts();
            grdProducts.DataBind();

            txtName.Text       = string.Empty;
            txtDesc.Text       = string.Empty;
            txtSKU.Text        = string.Empty;
            txtVendor.Text     = string.Empty;
            hdnProductId.Value = string.Empty;
        }