Class Year
Work year settings
Inheritance
↳ object
↳ Year
Inherited Members
Equals(object, object)
GetType()
MemberwiseClone()
ReferenceEquals(object, object)
ToString()
Namespace: OptimaJet.Workflow.Core.Runtime.Calendars
Assembly: OptimaJet.Workflow.Core.dll
Syntaxpublic class Year
Properties
YearNumber
Year number, for example 2023
Declarationpublic int YearNumber { get; }
Type | Description |
---|---|
int |
Holidays
Holidays
Declarationpublic List<MonthDay> Holidays { get; }
Type | Description |
---|---|
List<MonthDay> |
Workdays
Setting up individual days
Declarationpublic List<Workday> Workdays { get; }
Type | Description |
---|---|
List<Workday> |
Methods
IsWorkday(DateTime, bool)
Checking whether the day is a workday
Declarationpublic bool IsWorkday(DateTime day, bool weekend)
Type | Name | Description |
---|---|---|
DateTime | day | Day instance |
bool | weekend | Flag whether the day is a weekend according to the calendar |
Type | Description |
---|---|
bool | true if day is workday, false otherwise |
GetDayTime(DateTime)
Get all working hours on the day
Declarationpublic TimeSpan? GetDayTime(DateTime day)
Type | Name | Description |
---|---|---|
DateTime | day | Day instance |
Type | Description |
---|---|
TimeSpan? | working hours or null if the year has no data |
Create(int)
Create instance of the year
Declarationpublic static Year Create(int year)
Type | Name | Description |
---|---|---|
int | year | Number of the year |
Type | Description |
---|---|
Year | Year instance |
SetHolidays(params MonthDay[])
Set holidays in this year
Declarationpublic Year SetHolidays(params MonthDay[] holidays)
Type | Name | Description |
---|---|---|
OptimaJet.Workflow.Core.Runtime.Calendars.MonthDay[] | holidays | Array of the holidays |
Type | Description |
---|---|
Year | Year instance |
SetHoliday(Months, int)
Set holiday in this year
Declarationpublic Year SetHoliday(Months month, int day)
Type | Name | Description |
---|---|---|
Months | month | Month |
int | day | Day number |
Type | Description |
---|---|
Year | Year instance |
SetWorkdays(params Workday[])
Set workdays
Declarationpublic Year SetWorkdays(params Workday[] workdays)
Type | Name | Description |
---|---|---|
OptimaJet.Workflow.Core.Runtime.Calendars.Workday[] | workdays | Array of the Workday |
Type | Description |
---|---|
Year | Year instance |
SetWorkday(Months, int, TimeSpan, TimeSpan)
Set workday
Declarationpublic Year SetWorkday(Months month, int day, TimeSpan startTimeOfDay, TimeSpan workingHours)
Type | Name | Description |
---|---|---|
Months | month | Month |
int | day | Day number |
TimeSpan | startTimeOfDay | The beginning of the working day |
TimeSpan | workingHours | Working hours |
Type | Description |
---|---|
Year | Year instance |
Equals(object)
Declarationpublic override bool Equals(object obj)
Type | Name | Description |
---|---|---|
object | obj |
Type | Description |
---|---|
bool |
GetHashCode()
Declarationpublic override int GetHashCode()
Type | Description |
---|---|
int |