protected void btnUpdate_Click(object sender, EventArgs e) { try { string theID = txtID.Text; string newName = txtName.Text; double newPrice = double.Parse(txtPrice.Text.Replace("$", "")); string newDesc = txtDescription.Text; SQLDataClass.UpdateProduct(theID, newName, newPrice, newDesc); txtMessage.Text = "Record updated."; SQLDataClass.getAllProducts(); } catch (Exception ex) { txtMessage.Text = "Product Not Updated: " + ex.Message; } }
protected void Button5_Click(object sender, EventArgs e) { try { string theID = TextBox1.Text; string newName = TextBox2.Text; double newPrice = double.Parse(TextBox3.Text.Replace("$", "")); string newDesc = TextBox4.Text; SQLDataClass.UpdateProduct(theID, newName, newPrice, newDesc); TextArea1.InnerText = "Record Updated"; SQLDataClass.getAllProducts(); } catch (Exception ex) { TextArea1.InnerText = "Product Not Updated:" + ex.Message; } }