Class VehicleManager
Contains the simplic logistics vehicle manager to work with simplic vehicle
Inheritance
Inherited Members
Namespace: Simplic.PlugIn.Logistics
Assembly: Simplic.PlugIn.Logistics.dll
Syntax
public class VehicleManager
Properties
| Improve this Doc View SourceSingleton
Gets the singleton access to the vehicle manager
Declaration
public static VehicleManager Singleton { get; }
Property Value
Type | Description |
---|---|
VehicleManager |
VehicleTypes
Gets the list of registered vehicle types
Declaration
public IReadOnlyDictionary<Guid, Type> VehicleTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.Guid, System.Type> |
Methods
| Improve this Doc View SourceChangeVehicleType(Guid, Guid)
Change the type of an vehicle
Declaration
public void ChangeVehicleType(Guid vehicleId, Guid newTypeId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId | Unique vehicle id |
System.Guid | newTypeId | New type id |
CheckLoadDataOptions(VehicleLoadOption, VehicleLoadOption)
Check whether a vehicle option should be loaded
Declaration
public static bool CheckLoadDataOptions(VehicleLoadOption option, VehicleLoadOption toCheck)
Parameters
Type | Name | Description |
---|---|---|
VehicleLoadOption | option | Current option |
VehicleLoadOption | toCheck | Option to load |
Returns
Type | Description |
---|---|
System.Boolean | True if the options should be loaded |
Delete(Vehicle)
Remove a vehicle from the database (soft)
Declaration
public void Delete(Vehicle vehicle)
Parameters
Type | Name | Description |
---|---|---|
Vehicle | vehicle | Remove vehicle |
DeleteInsuranceType(InsuranceType)
Declaration
public void DeleteInsuranceType(InsuranceType obj)
Parameters
Type | Name | Description |
---|---|---|
InsuranceType | obj |
DeleteInsuranceType(Guid)
Declaration
public void DeleteInsuranceType(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | guid |
DeleteRegistrationDocumentLocation(RegistrationDocumentLocation)
Remove a RegistrationDocumentLocation
Declaration
public void DeleteRegistrationDocumentLocation(RegistrationDocumentLocation obj)
Parameters
Type | Name | Description |
---|---|---|
RegistrationDocumentLocation | obj | Object to delete |
DeleteRegistrationDocumentLocation(Guid)
Remove a RegistrationDocumentLocation
Declaration
public void DeleteRegistrationDocumentLocation(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Id value |
DeleteVehicleTelematic(VehicleTelematic)
Deletes a telematic from a vehicle
Declaration
public void DeleteVehicleTelematic(VehicleTelematic vt)
Parameters
Type | Name | Description |
---|---|---|
VehicleTelematic | vt |
Get(Guid, VehicleLoadOption)
Get vehicle from the database
Declaration
public Vehicle Get(Guid vehicleId, VehicleLoadOption option = VehicleLoadOption.All)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId | Unique id of a vehicle |
VehicleLoadOption | option |
Returns
Type | Description |
---|---|
Vehicle | If the vehicle was found, an instance of Vehicle will be returned, else null |
Get(String, VehicleLoadOption)
Get vehicle from the database
Declaration
public Vehicle Get(string vehicleName, VehicleLoadOption option = VehicleLoadOption.All)
Parameters
Type | Name | Description |
---|---|---|
System.String | vehicleName | matchcode of a vehicle |
VehicleLoadOption | option | load option |
Returns
Type | Description |
---|---|
Vehicle | If the vehicle was found, an instance of Vehicle will be returned, else null |
GetAllInsuranceType()
Get all InsuranceType
Declaration
public IEnumerable<InsuranceType> GetAllInsuranceType()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<InsuranceType> | IEnumerable of InsuranceType |
GetAllRegistrationDocumentLocation()
Get all RegistrationDocumentLocation
Declaration
public IEnumerable<RegistrationDocumentLocation> GetAllRegistrationDocumentLocation()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<RegistrationDocumentLocation> | IEnumerable of RegistrationDocumentLocation |
GetAppointments(Guid)
Gets all appointments of a given vehicle
Declaration
public IList<Appointment> GetAppointments(Guid vehicleGuid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleGuid | unique identifier of the vehicle |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Appointment> | The list of appointments of the vehicle with the given id |
GetAppointments(Guid, SAConnection)
Gets all appointments of a given vehicle
Declaration
public IList<Appointment> GetAppointments(Guid vehicleGuid, SAConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleGuid | unique identifier of the vehicle |
SAConnection | connection | connection to use for communication with the database |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Appointment> | The list of appointments of the vehicle with the given id |
GetEquipment(Guid)
Gets all equipment of a given vehicle
Declaration
public IList<Appointment> GetEquipment(Guid vehicleGuid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleGuid | unique identifier of the vehicle |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Appointment> | The list of appointments of the vehicle with the given id |
GetEquipment(Guid, SAConnection)
Gets all equipment of a given vehicle
Declaration
public IList<VehicleEquipmentItem> GetEquipment(Guid vehicleGuid, SAConnection connection)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleGuid | unique identifier of the vehicle |
SAConnection | connection | connection to use for communication with the database |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<VehicleEquipmentItem> | The list of appointments of the vehicle with the given id |
GetInsuranceType(Guid)
Get a single InsuranceType
Declaration
public InsuranceType GetInsuranceType(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | guid |
Returns
Type | Description |
---|---|
InsuranceType | InsuranceType instance, else null |
GetNew(Guid)
Get new vehicle of specific type
Declaration
public Vehicle GetNew(Guid typeGuid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | typeGuid | The guid of the vehicle type |
Returns
Type | Description |
---|---|
Vehicle | A new instance of the specified vehicle type |
GetRegistrationDocumentLocation(Guid)
Declaration
public RegistrationDocumentLocation GetRegistrationDocumentLocation(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id |
Returns
Type | Description |
---|---|
RegistrationDocumentLocation |
GetTelematicsByVehicleId(Guid)
Gets the telematics of a vehicle by the vehicle Id
Declaration
public IEnumerable<VehicleTelematic> GetTelematicsByVehicleId(Guid vehicleId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<VehicleTelematic> |
GetVehiclesOfGroup(Guid, VehicleLoadOption, String, String)
Get a list of vehicles by a specific type group
Declaration
public IList<Vehicle> GetVehiclesOfGroup(Guid groupId, VehicleLoadOption option, string additionalWhereCondition = null, string orderBy = "ORDER BY v.IsSystemVehicle DESC, VisualIdentifier")
Parameters
Type | Name | Description |
---|---|---|
System.Guid | groupId | Unique type group |
VehicleLoadOption | option | |
System.String | additionalWhereCondition | Additional where condition, has to start with AND ... |
System.String | orderBy |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Vehicle> | A list of vehicles / awaitable |
GetVehiclesOfGroupAsync(Guid, VehicleLoadOption, String, String)
Get a list of vehicles by a specific type group
Declaration
public async Task<IList<Vehicle>> GetVehiclesOfGroupAsync(Guid groupId, VehicleLoadOption option, string additionalWhereCondition = null, string orderBy = "ORDER BY v.IsSystemVehicle DESC, VisualIdentifier")
Parameters
Type | Name | Description |
---|---|---|
System.Guid | groupId | Unique type group |
VehicleLoadOption | option | |
System.String | additionalWhereCondition | Additional where condition, has to start with AND ... |
System.String | orderBy |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<Vehicle>> | A list of vehicles / awaitable |
GetVehiclesOfTypeAsync(Guid, VehicleLoadOption, String)
Get a list of vehicles by a specific type
Declaration
public async Task<IList<Vehicle>> GetVehiclesOfTypeAsync(Guid typeId, VehicleLoadOption option, string additionalWhereCondition = null)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | typeId | Unique type id |
VehicleLoadOption | option | |
System.String | additionalWhereCondition | Additional where condition, has to start with AND ... |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<Vehicle>> | A list of vehicles / awaitable |
GetVehicleType(Guid)
Gets the VehicleType with the given id
Declaration
public VehicleType GetVehicleType(Guid typeId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | typeId | The id of the wanted VehicleType |
Returns
Type | Description |
---|---|
VehicleType | The VehicleType with the given id |
GetVehicleTypes()
Gets all VehicleType
Declaration
public IEnumerable<VehicleType> GetVehicleTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<VehicleType> | All VehicleType |
GetVehicleTypesByGroup(Guid)
Gets all VehicleType of a specific Group
Declaration
public IEnumerable<VehicleType> GetVehicleTypesByGroup(Guid groupId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | groupId |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<VehicleType> | All VehicleType |
RegisterVehicleType<T>(Guid)
Register a type of vehicle
Declaration
public void RegisterVehicleType<T>(Guid typeId)
where T : Vehicle
Parameters
Type | Name | Description |
---|---|---|
System.Guid | typeId | Unique type id, which will be stored in the database |
Type Parameters
Name | Description |
---|---|
T | Vehicle type |
Restore(Guid)
Restores a deleted vehicle from database
Declaration
public void Restore(Guid vehicleId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId |
Save(Vehicle, Boolean)
Create or save a vehicle in the database
Declaration
public void Save(Vehicle vehicle, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
Vehicle | vehicle | Vehicle instance |
System.Boolean | uploadCloud |
SaveInsuranceType(InsuranceType)
Declaration
public void SaveInsuranceType(InsuranceType obj)
Parameters
Type | Name | Description |
---|---|---|
InsuranceType | obj |
SaveRegistrationDocumentLocation(RegistrationDocumentLocation)
Save a RegistrationDocumentLocation
Declaration
public void SaveRegistrationDocumentLocation(RegistrationDocumentLocation obj)
Parameters
Type | Name | Description |
---|---|---|
RegistrationDocumentLocation | obj | Object to save |
SaveVehicleTelematic(VehicleTelematic)
Saves a telematic to a vehicle
Declaration
public void SaveVehicleTelematic(VehicleTelematic vt)
Parameters
Type | Name | Description |
---|---|---|
VehicleTelematic | vt |
SetTractorUnitTrailer(Guid, IList<Guid>)
Set the currently active attached trailer and detach all trailer, that are not part of the trailers list
Declaration
public void SetTractorUnitTrailer(Guid vehicleId, IList<Guid> trailers)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId | Unique vehicle id |
System.Collections.Generic.IList<System.Guid> | trailers | List of attached trailer |
SetVehicleDepartment(Guid, Nullable<Guid>)
Attach department with vehicle
Declaration
public void SetVehicleDepartment(Guid vehicleId, Guid? departmentId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId | Vehicle guid |
System.Nullable<System.Guid> | departmentId | Department id |
SetVehicleDriver(Guid, IList<Guid>)
Set the currently attached driver and detach all driver, that are not aprt of the drivers list
Declaration
public void SetVehicleDriver(Guid vehicleId, IList<Guid> drivers)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | vehicleId | Unique vehicle id |
System.Collections.Generic.IList<System.Guid> | drivers | Active driver list |