JDTractorManager Class Reference

provides a manager for adding and removing tractor information More...

List of all members.

Public Member Functions

(instancetype) - init
(bool) - newVehicle:withType:withImage:andConnectionName:andUserID:andEnabled:
(bool) - editVehicle:intTable:withName:withType:withImage:andConnectionName:andUserID:andEnabled:
(bool) - editVehicle:withName:withType:withImage:andConnectionName:andUserID:andEnabled:
(BOOL) - deleteVehicle:
(NSMutableArray *) - getTractors
(NSMutableArray *) - getTractorsWithUserID:
(NSMutableArray *) - getTractorsWithUserName:
(NSMutableArray *) - getTractor:
(NSArray *) - getTractorByTypeName:
(NSMutableArray *) - getTractorsWithUserID:andVehicleName:
(NSMutableArray *) - getTractorsWithUserID:withColumnNameOrder:
(bool) - createMyVehiclesTable
(bool) - createDeletedVehiclesTable

Properties

JDDatabaseManagerdbManager
JDUserManageruserManager

Detailed Description

provides a manager for adding and removing tractor information


Member Function Documentation

- (bool) editVehicle: (unsigned long)  tractorID
intTable: (NSString *)  vehicleTable
withName: (NSString *)  vehicleName
withType: (NSString *)  vehicleType
withImage: (NSString *)  vehicleImage
andConnectionName: (NSString *)  connectionName
andUserID: (NSString *)  userID
andEnabled: (BOOL)  isEnabled 

This function will create the new vehicle in the database where appropriate

Parameters:
tractorID ID of the tractor to edit or 0 for a new tractor
vehicleName name of the user to create
vehicleType type of this vehicle
vehicleImage image to use for this vehicle
connectionName name of WiFi connection for this vehicle
userID ID of the user for this vehicle
isEnabled is this vehilce enabled?
Returns:
true on success false one failure
- (bool) editVehicle: (unsigned long)  tractorID
withName: (NSString *)  vehicleName
withType: (NSString *)  vehicleType
withImage: (NSString *)  vehicleImage
andConnectionName: (NSString *)  connectionName
andUserID: (NSString *)  userID
andEnabled: (BOOL)  isEnabled 

This function will create the new vehicle in the database where appropriate

Parameters:
tractorID ID of the tractor to edit or 0 for a new tractor
vehicleName name of the user to create
vehicleType type of this vehicle
vehicleImage image to use for this vehicle
connectionName name of WiFi connection for this vehicle
userID ID of the user for this vehicle
isEnabled is this vehilce enabled?
Returns:
true on success false one failure
- (NSMutableArray *) getTractor: (unsigned long)  tractorID  

Get a signel tractor from the database

Parameters:
tractorID Unsigned long id of the tractor to get from the databse
Returns:
A mutable array of all the fields of information on this tractor
- (NSArray *) getTractorByTypeName: (NSString *)  tractorTypeName  

Gets a tractor based on the tyope of tractor it is

Parameters:
tractorTypeName the name of the tractor type to look for. It should be one of the types defined in the tractors.xml file
Returns:
empty or NULL if no tractors found, an array of tractors otherwise
- (NSMutableArray *) getTractors  

Get all tractors in the database NOT USED. DO NOT ATTEMPT TO RUN

Returns:
all the tractors in a mutable array that are in the database
- (NSMutableArray *) getTractorsWithUserID: (unsigned long)  userID  

Gets all tractors associated with a given user id

Parameters:
userID unsigned long id ffor this user in the user table
Returns:
mutable array containing information an all users tractors
- (NSMutableArray *) getTractorsWithUserName: (NSString *)  userID  

Get all tractors in the database for username

Parameters:
userID the string name of the user i.e. username
Returns:
all the tractors in a mutable array that are in the database for that user or empty array otherwise
- (instancetype) init  

Initializes Tractor Manager and makes sure databases exists.

- (bool) newVehicle: (NSString *)  vehicleName
withType: (NSString *)  vehicleType
withImage: (NSString *)  vehicleImage
andConnectionName: (NSString *)  connectionName
andUserID: (NSString *)  userID
andEnabled: (BOOL)  isEnabled 

This function will edit a vehicle already in the database

Parameters:
vehicleName name of the user to create
vehicleType type of this vehicle
vehicleImage image to use for this vehicle
connectionName name of WiFi connection for this vehicle
userID ID of the user for this vehicle
isEnabled is this vehilce enabled?
Returns:
true on success false one failure

The documentation for this class was generated from the following files:
 All Classes Functions Properties

Generated on 27 Apr 2015 for My Project by  doxygen 1.6.1