//Button click gets product to remove from database based off ID //Button click sets product active attribute to 0 protected void RemoveProduct_Click(object sender, EventArgs e) { //Get the product id using URL parameter String param = Request.QueryString["ID"]; int product_ID = Convert.ToInt32(param); //Service function to set product active attribute 0 string delete = SR.DeleteProduct(product_ID); //if deleting is successfull if (delete.Equals("Deleted")) { //Redirect to home page Response.Redirect("Home.aspx"); } else if (delete.Equals("Product not deleted")) { error.Value = "Product couldn't be deleted. Please try again."; error.Visible = true; } else if (delete.Equals("Product doesn't exist")) { error.Value = "Product does not exist."; error.Visible = true; } }