Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class Year

OptimaJet.Workflow.Core.Runtime.Calendars.Year

Work year settings

public class Year

Inheritance

  • System.Object

Properties

Name
Type
YearNumber #
Int32
Year number, for example 2023
Holidays #
List<MonthDay>
Holidays
Workdays #
List<Workday>
Setting up individual days

Methods

public bool IsWorkday(DateTime day, bool weekend) #
Checking whether the day is a workday

Parameters

Name
Type
Description
day
DateTime
Day instance
weekend
Boolean
Flag whether the day is a weekend according to the calendar

Returns

Type
Description
Boolean
true if day is workday, false otherwise
public TimeSpan? GetDayTime(DateTime day) #
Get all working hours on the day

Parameters

Name
Type
Description
day
DateTime
Day instance

Returns

Type
Description
Nullable<TimeSpan>
working hours or null if the year has no data
public static Year Create(int year) #
Create instance of the year

Parameters

Name
Type
Description
year
Int32
Number of the year

Returns

Type
Description
Year
Year instance
public Year SetHolidays(params MonthDay[] holidays) #
Set holidays in this year

Parameters

Name
Type
Description
holidays
MonthDay[]
Array of the holidays

Returns

Type
Description
Year
Year instance
public Year SetHoliday(Months month, int day) #
Set holiday in this year

Parameters

Name
Type
Description
month
Months
Month
day
Int32
Day number

Returns

Type
Description
Year
Year instance
public Year SetWorkdays(params Workday[] workdays) #
Set workdays

Parameters

Name
Type
Description
workdays
Workday[]
Array of the Workday

Returns

Type
Description
Year
Year instance
public Year SetWorkday(Months month, int day, TimeSpan startTimeOfDay, TimeSpan workingHours) #
Set workday

Parameters

Name
Type
Description
month
Months
Month
day
Int32
Day number
startTimeOfDay
TimeSpan
The beginning of the working day
workingHours
TimeSpan
Working hours

Returns

Type
Description
Year
Year instance
public override bool Equals(object obj) #

Parameters

Name
Type
Description
obj
Object

Returns

Type
Description
Boolean
public override int GetHashCode() #

Returns

Type
Description
Int32