private TimeEntry CreateTimeEntry(DateTime fromDate, DateTime throughDate, TimeFrequency frequency, WorkEffort workEffort) => new TimeEntryBuilder(this.Session) .WithRateType(new RateTypes(this.Session).StandardRate) .WithFromDate(fromDate) .WithThroughDate(throughDate) .WithTimeFrequency(frequency) .WithWorkEffort(workEffort) .Build();
public decimal?ConvertToFrequency(decimal value, TimeFrequency timeFrequency) { var conversion = this.GetConvertToFactor(timeFrequency); if (conversion != null) { return(value * (decimal)conversion); } return(null); }
private UnitOfMeasureConversion NewFrequencyConversion(TimeFrequency toFrequency, decimal conversionFactor) => new UnitOfMeasureConversionBuilder(this.Session) .WithToUnitOfMeasure(toFrequency) .WithConversionFactor(conversionFactor) .Build();
public decimal?GetConvertToFactor(TimeFrequency timeFrquency) => this.UnitOfMeasureConversions?.FirstOrDefault(c => c.ToUnitOfMeasure.Equals(timeFrquency)).ConversionFactor;