530Chapter 12 • Creating an ADO.NET Shopping Cart
5.Return string indicating success or failure of the operation.
■updateItem (string ISBN, string author, double price, string
title, string description, string imagePath, int CAT_ID) Updates a book item’s information.
1.Call init().
2.Create Command object accessing the AdminUpdateBook proc.
3.Create the Parameter objects and assign their values.
4.Execute the procedure. Call ExecuteQuery( commandObj ).
5.Return string indicating success or failure of the operation.
■addCat (string CAT_Name) Adds a category name to the database.
1.Call init().
2.Create Command object accessing the AdminAddCat proc.
3.Create the Parameter object and assign its value.
4.Execute the procedure. Call ExecuteQuery(commandObj).
5.Return string indicating success or failure of the operation.
■updateCat (int CAT_ID, string CAT_Name) Updates category details.
1.Call init().
2.Create Command object accessing the AdminUpdateCat proc.
3.Create the Parameter objects and assign their values.
4.Execute the procedure. Call ExecuteQuery(commandObj).
5.Return string indicating success or failure of the operation.
■removeCat (int CAT_ID) Removes a category from the database.
1.Call init().
2.Create Command object accessing the AdminUpdateCat proc.
3.Create the Parameter object and assign its value.
4.Execute the procedure. Call ExecuteQuery(commandObj).
5.Return string indicating success or failure of the operation.