Table of Contents

Class EventOccurrence

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

false A particular occurrence of an MaintenanceSchedule.

[ReportClass]
public class EventOccurrence : Entity, IEntity, IComparable, IIdentifiable, IDeviceProvider, IDefaultable
Inheritance
EventOccurrence
Implements
Inherited Members

Constructors

EventOccurrence()

Initializes a new instance of the EventOccurrence class.Initializes a new instance of the EventOccurrence class.

public EventOccurrence()

EventOccurrence(Id)

Initializes a new instance of the EventOccurrence class.Initializes a new instance of the EventOccurrence class.

public EventOccurrence(Id id)

Parameters

id Id

The id of the event occurrence entity.

EventOccurrence(Id?, Device?, MaintenanceSchedule?, DateTime?, long?, long?, TimeSpan?, TimeSpan?, bool?, string?, string?, decimal?, decimal?, decimal?, decimal?, Currency?, bool?, bool?)

Initializes a new instance of the EventOccurrence class.Initializes a new instance of the EventOccurrence class.

[Obsolete("Avoid using big ugly constructors like this in practice. It makes for harder refactoring later.", false)]
public EventOccurrence(Id? id, Device? device, MaintenanceSchedule? maintenanceSchedule, DateTime? eventDate, long? currentOdometer, long? adjustedOdometer, TimeSpan? currentEngineHours, TimeSpan? adjustedEngineHours, bool? active, string? comment, string? reference, decimal? laborCost, decimal? partsCost, decimal? taxCost, decimal? totalCost, Currency? costCurrency, bool? skipped, bool? snoozed)

Parameters

id Id

The Id.

device Device

The device.

maintenanceSchedule MaintenanceSchedule

The event rule.

eventDate DateTime?

The event date.

currentOdometer long?

The current odometer.

adjustedOdometer long?

The adjusted odometer.

currentEngineHours TimeSpan?

The current engine hours.

adjustedEngineHours TimeSpan?

The adjusted engine hours.

active bool?

If set to true [active].

comment string

The comment.

reference string

The reference or work order number.

laborCost decimal?

The cost paid for labor.

partsCost decimal?

The cost paid for parts.

taxCost decimal?

The cost paid in taxes.

totalCost decimal?

The total cost paid for the work.

costCurrency Currency?

The Currency in which the cost values are recorded.

skipped bool?

The current event has been canceled or not

snoozed bool?

The current event has been delayed or not

Properties

Active

Gets or sets a value indicating whether this EventOccurrence is active.

public bool? Active { get; set; }

Property Value

bool?

<c>true</c> if active; otherwise, <c>false</c>.

AdjustedEngineHours

Gets or sets the adjusted engine hours.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceAdjustedEngineHours })]
public TimeSpan? AdjustedEngineHours { get; set; }

Property Value

TimeSpan?

The adjusted engine hours.

AdjustedOdometer

Gets or sets the adjusted odometer.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceAdjustedOdometer }, IsSpeedOrDistance = true)]
public long? AdjustedOdometer { get; set; }

Property Value

long?

The adjusted odometer.

Comment

Gets or sets free text field where any user information can be stored and referenced for this entity.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceComment })]
public string? Comment { get; set; }

Property Value

string

The comment.

CostCurrency

Gets or sets the currency in which costs were entered.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceCostCurrencyInput })]
public Currency? CostCurrency { get; set; }

Property Value

Currency?

A member of the Currency enum indicating which currency the cost values are stored in.

CostCurrencyCode

Gets the code for CostCurrency

public string? CostCurrencyCode { get; }

Property Value

string

String value of currency code

CostCurrencyConverted

Gets or sets the currency in which costs will be displayed.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceCostCurrencyConverted })]
public Currency? CostCurrencyConverted { get; set; }

Property Value

Currency?

A member of the Currency enum Currency picked by the user in UI settings

CostCurrencyConvertedCode

Gets the code for CostCurrencyConverted

public string? CostCurrencyConvertedCode { get; }

Property Value

string

String value of currency code

CurrencyConversionFailed

Gets or sets a value indicating whether the currency conversionfailed

public bool CurrencyConversionFailed { get; set; }

Property Value

bool

True/False

CurrentEngineHours

Gets or sets the current engine hours.

public TimeSpan? CurrentEngineHours { get; set; }

Property Value

TimeSpan?

The current engine hours.

CurrentEngineHoursInHours

Gets the current engine hours in hours as an integer.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceCurrentEngineHours })]
public int? CurrentEngineHoursInHours { get; }

Property Value

int?

The current engine hours in hours as an integer.

CurrentOdometer

Gets or sets the current odometer.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceCurrentOdometer }, IsSpeedOrDistance = true)]
public long? CurrentOdometer { get; set; }

Property Value

long?

The current odometer.

Device

Gets or sets gets the Device.

public Device? Device { get; set; }

Property Value

Device

The <see cref="Device"/>.

EventDate

Gets or sets the event date.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccuranceEventDate })]
public DateTime? EventDate { get; set; }

Property Value

DateTime?

The event date.

EventRule

Gets or sets the event rule.

[Obsolete("Please use MaintenanceSchedule instead of EventRule", false)]
public EventRule? EventRule { get; set; }

Property Value

EventRule

The event rule.

EventType

Gets or sets the event type. Should only be set if EventRule is null

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceEventType }, IsEventTypeName = true)]
public EventType? EventType { get; set; }

Property Value

EventType

The event type.

LaborCost

Gets or sets the amount paid for labor.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceLaborCostInput })]
public decimal? LaborCost { get; set; }

Property Value

decimal?

The amount.

LaborCostConverted

Gets or sets the amount paid for labor converted to UI Settings Currency.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceLaborCostConverted })]
public decimal? LaborCostConverted { get; set; }

Property Value

decimal?

The amount converted to user settings currency.

MaintenanceSchedule

Gets or sets the maintenance schedule.

public MaintenanceSchedule? MaintenanceSchedule { get; set; }

Property Value

MaintenanceSchedule

The maintenance Schedule.

MediaFiles

Gets or sets the list of MediaFile for a event.

public List<MediaFile> MediaFiles { get; set; }

Property Value

List<MediaFile>

MediaFile

PartsCost

Gets or sets the amount paid for parts.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrencePartsCostInput })]
public decimal? PartsCost { get; set; }

Property Value

decimal?

The amount.

PartsCostConverted

Gets or sets the amount paid for Parts cost converted to UI Settings Currency.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrencePartsCostConverted })]
public decimal? PartsCostConverted { get; set; }

Property Value

decimal?

The amount converted to user settings currency.

Reference

Gets or sets the reference or work order number for the event.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceReference })]
public string? Reference { get; set; }

Property Value

string

The Reference or Work order number.

Skipped

Gets or sets a value indicating whether the event isn't being completed

public bool? Skipped { get; set; }

Property Value

bool?

True/False

Snoozed

Gets or sets a value indicating whether the event has been delayed

public bool? Snoozed { get; set; }

Property Value

bool?

True/False

TaxCost

Gets or sets the amount paid in taxes.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceTaxInput })]
public decimal? TaxCost { get; set; }

Property Value

decimal?

The amount.

TaxCostConverted

Gets or sets the amount paid in taxes converted to UI Settings Currency.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceTaxConverted })]
public decimal? TaxCostConverted { get; set; }

Property Value

decimal?

The amount converted to UI Settings Currency.

TotalCost

Gets or sets the amount paid in taxes.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceTotalCostInput })]
public decimal? TotalCost { get; set; }

Property Value

decimal?

The amount.

TotalCostConverted

Gets or sets the amount paid in taxes.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.EventOccurrenceTotalCostConverted })]
public decimal? TotalCostConverted { get; set; }

Property Value

decimal?

Gets the total cost converted to UI Settings Currency.

Methods

Clone()

Creates a new object that is a copy of the current instance.

public override IEntity Clone()

Returns

IEntity

A new object that is a copy of this instance.

ConvertCostToPreferredCurrency(decimal)

Convert cost to User's preffered currency

public void ConvertCostToPreferredCurrency(decimal exchangeRate)

Parameters

exchangeRate decimal

The exchangeRate.

HasCostValues()

Checks if User has entered Cost related values

public bool HasCostValues()

Returns

bool

True/False

PopulateDefaults()

Populate non-required empty (null) properties with default values.

public void PopulateDefaults()