IMAT1604: Visual Web Development

List Classes

Although the Wine class can store a single wine record, another class is needed in order to handle all the wine records in the data table. Typically this is based on a List. Again, a WineList class can be added to the App_Code folder (remember to set Build Action to complile).

This class is part of the Middle layer, in the three layered architecture. I needs methods to Delete, Add, Update and Select wine records. The code below is a skeleton, it contains empty methods which return false. Returning false means that the method has not been successful. As the method contains no code it does not yet work. Code can be added later to the methods one bye one to get them working.

C# Custom Class - Wine

This class cannot work without the assistance of the final class, DatabaseQuery. This class connects to the database and executes stored procedures to accomplish the required action. When the DatabaseQuery class has been added, then the code for the WineList delete method can be added.

C# Custom Class - Wine