Show / Hide Table of Contents

Class RuntimeBase

Runtime for the function

Inheritance
object
RuntimeBase
PayrollRuntime
ReportRuntime
Implements
IRuntime
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: PayrollEngine.Client.Scripting.Runtime.Api
Assembly: PayrollEngine.Client.Services.dll
Syntax
public abstract class RuntimeBase : IRuntime

Constructors

View Source

RuntimeBase(PayrollHttpClient, int, int)

Initializes a new instance of the RuntimeBase class

Declaration
protected RuntimeBase(PayrollHttpClient httpClient, int tenantId, int userId)
Parameters
Type Name Description
PayrollHttpClient httpClient

The Payroll http client

int tenantId

The tenant id

int userId

The user id

Properties

View Source

HttpClient

The Payroll http client

Declaration
public PayrollHttpClient HttpClient { get; }
Property Value
Type Description
PayrollHttpClient
View Source

LogOwner

The log owner, the source identifier

Declaration
protected abstract string LogOwner { get; }
Property Value
Type Description
string
View Source

LogOwnerType

The log owner type

Declaration
protected abstract string LogOwnerType { get; }
Property Value
Type Description
string
View Source

Tenant

The tenant

Declaration
public Tenant Tenant { get; }
Property Value
Type Description
Tenant
View Source

TenantCulture

The tenant culture

Declaration
public CultureInfo TenantCulture { get; }
Property Value
Type Description
CultureInfo
View Source

TenantId

The tenant id

Declaration
public int TenantId { get; }
Property Value
Type Description
int
View Source

TenantIdentifier

The tenant identifier

Declaration
public string TenantIdentifier { get; }
Property Value
Type Description
string
View Source

TenantService

The tenant service

Declaration
protected ITenantService TenantService { get; }
Property Value
Type Description
ITenantService
View Source

User

The user

Declaration
public User User { get; }
Property Value
Type Description
User
View Source

UserCulture

The user culture

Declaration
public virtual string UserCulture { get; }
Property Value
Type Description
string
View Source

UserId

The user id

Declaration
public int UserId { get; }
Property Value
Type Description
int
View Source

UserIdentifier

The user identifier

Declaration
public string UserIdentifier { get; }
Property Value
Type Description
string
View Source

UserService

The user service

Declaration
protected IUserService UserService { get; }
Property Value
Type Description
IUserService
View Source

UserType

The user type

Declaration
public int UserType { get; }
Property Value
Type Description
int

Methods

View Source

AddLog(int, string, string, string)

Add a log

Declaration
public void AddLog(int level, string message, string error = null, string comment = null)
Parameters
Type Name Description
int level

The log level

string message

The log message

string error

The log error

string comment

The log comment

View Source

AddTask(string, string, DateTime, string, Dictionary<string, object>)

Add task

Declaration
public void AddTask(string name, string instruction, DateTime scheduleDate, string category, Dictionary<string, object> attributes = null)
Parameters
Type Name Description
string name

The task name

string instruction

The task instruction

DateTime scheduleDate

The task schedule date

string category

The task category

Dictionary<string, object> attributes

The task attributes

View Source

GetCalendarDayCount(string, DateTime, DateTime, string)

Count the calendar days from a date period

Declaration
public int GetCalendarDayCount(string calendarName, DateTime start, DateTime end, string culture)
Parameters
Type Name Description
string calendarName

The calendar name

DateTime start

The period start date

DateTime end

The period end date

string culture

The calendar culture

Returns
Type Description
int
View Source

GetCalendarPeriod(string, DateTime, int, string)

Gets the calendar period

Declaration
public Tuple<DateTime, DateTime> GetCalendarPeriod(string calendarName, DateTime moment, int offset, string culture)
Parameters
Type Name Description
string calendarName

The calendar name

DateTime moment

Moment within the period

int offset

The period offset

string culture

The calendar culture

Returns
Type Description
Tuple<DateTime, DateTime>
View Source

GetDerivedCalendar(int, int)

Gets the derived calendar name by priority: - employee (optional) - division (optional) - tenant (fallback)

Declaration
public string GetDerivedCalendar(int divisionId, int employeeId)
Parameters
Type Name Description
int divisionId

The division id, use 0 to ignore the division calendar

int employeeId

The employee id, use 0 to ignore the employee calendar

Returns
Type Description
string

The most derived calendar name

View Source

GetDerivedCulture(int, int)

Gets the derived culture name by priority: - employee (optional) - division (optional) - tenant (fallback)

Declaration
public string GetDerivedCulture(int divisionId, int employeeId)
Parameters
Type Name Description
int divisionId

The division id, use 0 to ignore the division culture (mandatory with employee id)

int employeeId

The employee id, use 0 to ignore the employee culture

Returns
Type Description
string

The most derived culture name

View Source

GetNextWorkDays(string, DateTime)

Get next working days

Declaration
public List<DateTime> GetNextWorkDays(string calendarName, DateTime moment)
Parameters
Type Name Description
string calendarName

The calendar name

DateTime moment

The start moment (not included in results)

Returns
Type Description
List<DateTime>

Returns true for valid time units

View Source

GetPreviousWorkDays(string, DateTime)

Get previous working days

Declaration
public List<DateTime> GetPreviousWorkDays(string calendarName, DateTime moment)
Parameters
Type Name Description
string calendarName

The calendar name

DateTime moment

The start moment (not included in results)

Returns
Type Description
List<DateTime>
View Source

GetTenantAttribute(string)

Get tenant attribute value

Declaration
public object GetTenantAttribute(string attributeName)
Parameters
Type Name Description
string attributeName

Name of the attribute

Returns
Type Description
object

The tenant attribute value

View Source

GetUserAttribute(string)

Get user attribute value

Declaration
public object GetUserAttribute(string attributeName)
Parameters
Type Name Description
string attributeName

Name of the attribute

Returns
Type Description
object

The user attribute value

View Source

InvokeWebhook(string, string)

Invoke case relation webhook and receive the response JSON data

Declaration
public string InvokeWebhook(string requestOperation, string requestMessage = null)
Parameters
Type Name Description
string requestOperation

The request operation

string requestMessage

The JSON request message

Returns
Type Description
string

The webhook response object as JSON

View Source

IsCalendarWorkDay(string, DateTime)

Test for calendar working day

Declaration
public bool IsCalendarWorkDay(string calendarName, DateTime moment)
Parameters
Type Name Description
string calendarName

The calendar name

DateTime moment

Test day

Returns
Type Description
bool

Implements

IRuntime

Extension Methods

ConsoleExtensions.WriteProperties(object, bool)
ValueTypeExtensions.GetValueType(object)
ObjectInfo.GetPropertyValue(object, string)
ObjectInfo.GetPropertyValue<T>(object, string, T)
ObjectInfo.ResolvePropertyValue(object, string)
ObjectInfo.SetPropertyValue(object, string, object)
  • View Source
☀
☾
Back to top Generated by DocFX