C# Class SANTA.IO.MSAccess

A class that performs IO operations on a Microsoft Access database.
Datei anzeigen Open project: siegleal/iSanta

Public Methods

Method Description
AddCaliberUnit ( Datatype caliberUnit, ConfigReader configReader ) : void

Adds a caliber unit to the database.

AddWeaponName ( String weaponName, ConfigReader configReader ) : void

Adds a weapon name to the database.

GetCaliberUnits ( ConfigReader configReader ) : List

Returns all of the caliber options already in the database with their IDs.

GetWeaponNames ( ConfigReader configReader ) : List

Loads a list of weapon names from the database.

LoadData ( int targetID, ConfigReader configReader ) : Datatype.ImageData

Loads an ImageData from the database.

SaveData ( Datatype imageData, ConfigReader configReader ) : int

Saves an ImageData object to the Target table.

Private Methods

Method Description
CaliberIDExists ( int caliberID, ConfigReader configReader ) : System.Boolean

Returns true if the given caliberID is in the database.

GetCaliberUnit ( int caliberID, ConfigReader configReader ) : Datatype.CaliberUnit

Loads a CaliberUnit from the database.

InsertData ( Datatype imageData, ConfigReader configReader ) : int

Inserts an ImageData object into the Target table.

UpdateData ( Datatype imageData, ConfigReader configReader ) : int

Updates an existing ImageData object in the Target table.

WeaponExists ( String weaponName, ConfigReader configReader ) : System.Boolean

Returns true if the given weaponName is in the database.

openConnection ( System.Data.OleDb.OleDbConnection conn ) : void

Opens a connection to the database specified in the OleDbConnection conn.

setStringParameter ( OleDbCommand command, String parameterName, String parameterValue ) : void

Sets a string parameter to an OleDbCommand. If the parameter value is null, it is replaced with the empty string.

Method Details

AddCaliberUnit() public static method

Adds a caliber unit to the database.
A connection-level error occurred while opening the connection. The INSERT INTO Caliber command failed.
public static AddCaliberUnit ( Datatype caliberUnit, ConfigReader configReader ) : void
caliberUnit Datatype The CaliberUnit to add to the database.
configReader ConfigReader The ConfigReader with the path to the database.
return void

AddWeaponName() public static method

Adds a weapon name to the database.
A connection-level error occurred while opening the connection. The INSERT INTO Weapon command failed.
public static AddWeaponName ( String weaponName, ConfigReader configReader ) : void
weaponName String The weapon name to add to the database.
configReader ConfigReader The ConfigReader with the path to the database.
return void

GetCaliberUnits() public static method

Returns all of the caliber options already in the database with their IDs.
A connection-level error occurred while opening the connection.
public static GetCaliberUnits ( ConfigReader configReader ) : List
configReader ConfigReader The ConfigReader with the path to the database.
return List

GetWeaponNames() public static method

Loads a list of weapon names from the database.
A connection-level error occurred while opening the connection.
public static GetWeaponNames ( ConfigReader configReader ) : List
configReader ConfigReader The ConfigReader with the path to the database.
return List

LoadData() public static method

Loads an ImageData from the database.
A connection-level error occurred while opening the connection.
public static LoadData ( int targetID, ConfigReader configReader ) : Datatype.ImageData
targetID int The of the target to load.
configReader ConfigReader The ConfigReader with the path to the database.
return Datatype.ImageData

SaveData() public static method

Saves an ImageData object to the Target table.
A connection-level error occurred while opening the connection. The SQL command failed. The caliber or weapon name was not found in the database.
public static SaveData ( Datatype imageData, ConfigReader configReader ) : int
imageData Datatype The ImageData to save.
configReader ConfigReader The ConfigReader with the path to the database.
return int