示例#1
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        DatabaseProcedures db = new DatabaseProcedures();

        db.Update(ddlBooksList.SelectedItem.Text.ToString(), txtBookAuthor.Text.ToString(), txtShortDescription.Text.ToString(), txtLongDescription.Text.ToString(),
                  txtImageFile.Text.ToString(), Convert.ToInt32(txtCategoryID.Text), txtISBN.Text.ToString(), txtBookStatus.Text.ToString(),
                  txtRating.Text.ToString(), Convert.ToDecimal(txtUnitPrice.Text), Convert.ToDecimal(txtPreOrder.Text), Convert.ToInt32(txtDiscount.Text.ToString()),
                  (txtPrintLength.Text.ToString()), Convert.ToInt32(txtQuantity.Text.ToString()));

        /*
         * conn = new SqlConnection(SQLConnectionString.getConnectionString());
         *
         * string storedProcedureName = "spUpdateBookInformation";
         * SqlCommand cmd = new SqlCommand(storedProcedureName, conn);
         * cmd.CommandType = CommandType.StoredProcedure;
         * //cmd.Parameters.AddWithValue("@Id", 2);
         * cmd.Parameters.AddWithValue("@Title", ddlBooksList.SelectedItem.Text.ToString());
         * cmd.Parameters.AddWithValue("@Author", txtBookAuthor.Text.ToString());
         * conn.Open();
         * cmd.ExecuteNonQuery();
         * conn.Close();*/
    }