Class TourManager
Tour-manager to work with the simplic disposition module
Inheritance
Inherited Members
Namespace: Simplic.PlugIn.Logistics.Disposition
Assembly: Simplic.PlugIn.Logistics.dll
Syntax
public class TourManager
Properties
| Improve this Doc View SourceSingleton
Singleton TourManager instance access
Declaration
public static TourManager Singleton { get; }
Property Value
Type | Description |
---|---|
TourManager |
Methods
| Improve this Doc View SourceCanDelete(Tour)
Checks wheter the tour can be deleted
Declaration
public bool CanDelete(Tour tour)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | The Tour to check |
Returns
Type | Description |
---|---|
System.Boolean | Whether the Tour can be deleted |
CheckForTourAtDay(Guid, DateTime)
Checks whether the tractorUnit already haves a tour for the day
Declaration
public Guid? CheckForTourAtDay(Guid tractorUnitId, DateTime startDate)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | tractorUnitId | |
System.DateTime | startDate |
Returns
Type | Description |
---|---|
System.Nullable<System.Guid> |
CreateTourFromShipments(IList<Shipment>)
Create a tour from a list of shipments
Declaration
public Tour CreateTourFromShipments(IList<Shipment> shipments)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Shipment> | shipments | List of shipments |
Returns
Type | Description |
---|---|
Tour | Returns a new tour (unsaved) connected with the given list of shipments |
Delete(Tour, Boolean, Boolean)
Remove a tour by its instance
Declaration
public void Delete(Tour tour, bool isSoftDelete = true, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
System.Boolean | isSoftDelete | Defines whether to do a soft delete or not |
System.Boolean | uploadCloud |
Delete(Guid, Boolean, Boolean)
Remove a tour by its id
Declaration
public void Delete(Guid id, bool isSoftDelete = true, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tour id |
System.Boolean | isSoftDelete | Defines whether to do a soft delete or not |
System.Boolean | uploadCloud |
DeleteAsync(Tour, Boolean, Boolean)
Remove a tour by its instance
Declaration
public async Task DeleteAsync(Tour tour, bool isSoftDelete = true, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
System.Boolean | isSoftDelete | Defines whether to do a soft delete or not |
System.Boolean | uploadCloud |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
DeleteAsync(Guid, Boolean, Boolean)
Remove a tour by its id
Declaration
public async Task DeleteAsync(Guid id, bool isSoftDelete = true, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tour id |
System.Boolean | isSoftDelete | Defines whether to do a soft delete or not |
System.Boolean | uploadCloud |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Get(Guid)
Get a single tour from the simplic datbase by its id
Declaration
public Tour Get(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tour id/guid |
Returns
Type | Description |
---|---|
Tour |
GetAsync(Guid)
Get a single tour from the simplic datbase by its id
Declaration
public async Task<Tour> GetAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique tour id/guid |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Tour> |
GetByShipment(Guid, Boolean)
Gets an enumerable of tours
Declaration
public IEnumerable<Tour> GetByShipment(Guid id, bool includeDeleted = false)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | Unique id |
System.Boolean | includeDeleted | Decides whether to include deleted tours or not |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Tour> | Enuerable/list of tour data |
GetRange(DateTime, DateTime, Guid, Boolean)
Get a list of tours which appears in a range of dates (between)
Declaration
public IList<Tour> GetRange(DateTime start, DateTime end, Guid tractorUnitId = default(Guid), bool excludeDeleted = true)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | start | Start-Date |
System.DateTime | end | End-Date |
System.Guid | tractorUnitId | Unique vehicle id |
System.Boolean | excludeDeleted | Decides whether to exclude deleted tours or not |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<Tour> | List of tours |
GetRangeAsync(DateTime, DateTime, Boolean)
Get a list of tours which appears in a range of dates (between)
Declaration
public async Task<IList<Tour>> GetRangeAsync(DateTime start, DateTime end, bool excludeDeleted = true)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | start | Start-Date |
System.DateTime | end | End-Date |
System.Boolean | excludeDeleted | Decides whether to exclude deleted tours or not |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<Tour>> | List of tours |
GetStatusList()
Get all available status values
Declaration
public IList<TourStatus> GetStatusList()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<TourStatus> | Ordered list of status values |
GetStatusListAsync()
Get all available status values
Declaration
public async Task<IList<TourStatus>> GetStatusListAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IList<TourStatus>> | Ordered list of status values |
GetUserUISettings(Int32)
Get the settings for a given user
Declaration
public string GetUserUISettings(int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Settings as json |
Returns
Type | Description |
---|---|
System.String | String containing the settings or null |
RestoreTour(Guid)
Restores a deleted tour
Declaration
public bool RestoreTour(Guid tourId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | tourId | Slected tour id |
Returns
Type | Description |
---|---|
System.Boolean |
Save(Tour, Boolean)
Save single tour information into the database
Declaration
public void Save(Tour tour, bool uploadCloud = true)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
System.Boolean | uploadCloud |
SaveUserUISettings(Int32, String)
Save ui settings in the database
Declaration
public void SaveUserUISettings(int userId, string settings)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | User id to save the settings for |
System.String | settings | Settings as string |
SetHasBillableShipmentCarrier(Guid, Boolean)
Sets the HasBillableShipmentCarrier flag state
Declaration
public void SetHasBillableShipmentCarrier(Guid tourId, bool state)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | tourId | |
System.Boolean | state |
SetStartEndAdressByTourId(IList<Guid>)
Sets the start and end address ids for the given tour ids.
Declaration
public void SetStartEndAdressByTourId(IList<Guid> tourIds)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.Guid> | tourIds |
SetTourAsFinished(Tour, DateTime, TimeSpan)
Set the current tour as finished
Declaration
public void SetTourAsFinished(Tour tour, DateTime actualEndDate, TimeSpan actualEndTime)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
System.DateTime | actualEndDate | |
System.TimeSpan | actualEndTime |
SetTourAsNotStarted(Tour)
Set the current tour as not started
Declaration
public void SetTourAsNotStarted(Tour tour)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
SetTourAsStarted(Tour, DateTime, TimeSpan)
Set the current tour as started
Declaration
public void SetTourAsStarted(Tour tour, DateTime actualStartDate, TimeSpan actualStartTime)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
System.DateTime | actualStartDate | Actual tour start date |
System.TimeSpan | actualStartTime |
SetTourAsUnfinished(Tour)
Set the current tour as not finished
Declaration
public void SetTourAsUnfinished(Tour tour)
Parameters
Type | Name | Description |
---|---|---|
Tour | tour | Tour instance |
TourExists(Guid)
Gets whether a tour is already existing
Declaration
public bool TourExists(Guid tourId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | tourId | Unique tour id |
Returns
Type | Description |
---|---|
System.Boolean | True if the tour is existing, else false |