Show / Hide Table of Contents

Class PayrollValue

Payroll value

Inheritance
object
PayrollValue
CasePayrollValue
PeriodValue
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: PayrollEngine.Client.Scripting
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
[JsonConverter(typeof(PayrollValueConverter))]
public class PayrollValue

Constructors

PayrollValue()

Initializes a new instance of the PayrollValue class

Declaration
protected PayrollValue()

PayrollValue(PayrollValue)

Initializes a new instance of the PayrollValue class

Declaration
public PayrollValue(PayrollValue source)
Parameters
Type Name Description
PayrollValue source

The source payroll value

PayrollValue(object)

Initializes a new instance of the PayrollValue class

Declaration
public PayrollValue(object value)
Parameters
Type Name Description
object value

The value

Fields

Empty

New payroll value instance

Declaration
public static readonly PayrollValue Empty
Field Value
Type Description
PayrollValue

Properties

CurrentValue

The value query

Declaration
protected virtual object CurrentValue { get; }
Property Value
Type Description
object

HasValue

Test if the payroll value is defined

Declaration
[JsonIgnore]
public virtual bool HasValue { get; }
Property Value
Type Description
bool

IsNumeric

Test if the payroll value is numeric

Declaration
[JsonIgnore]
public bool IsNumeric { get; }
Property Value
Type Description
bool

Value

The original value

Declaration
public object Value { get; }
Property Value
Type Description
object

Methods

Equals(object)

Determines whether the specified object is equal to this instance

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current object

Returns
Type Description
bool

True if the specified object is equal to this instance

Overrides
object.Equals(object)

GetHashCode()

Returns a hash code for this instance

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table

Overrides
object.GetHashCode()
Remarks

Null-safe: returns 0 when Value is null to prevent NullReferenceException.

Round(int, MidpointRounding)

Returns the integral digits of the specified decimal, using a step size

Declaration
public decimal? Round(int decimals = 0, MidpointRounding mode = MidpointRounding.ToEven)
Parameters
Type Name Description
int decimals

The number of significant decimal places (precision) in the return value

MidpointRounding mode

A value that specifies how to round d if it is midway between two other numbers

Returns
Type Description
decimal?

RoundDown(decimal)

Rounds a decimal value down

Declaration
public decimal RoundDown(decimal stepSize)
Parameters
Type Name Description
decimal stepSize

The round step size

Returns
Type Description
decimal

The down-rounded value

RoundUp(decimal)

Rounds a decimal value up

Declaration
public decimal RoundUp(decimal stepSize = 1)
Parameters
Type Name Description
decimal stepSize

The round step size

Returns
Type Description
decimal

The up-rounded value

ToString()

Returns a string that represents this instance

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents this instance

Overrides
object.ToString()

Truncate(int)

Returns the integral digits of the specified decimal, using a step size

Declaration
public decimal? Truncate(int stepSize = 1)
Parameters
Type Name Description
int stepSize

The step size used to truncate

Returns
Type Description
decimal?

Operators

operator +(PayrollValue, PayrollValue)

Addition of two payroll values (decimal, int, string)

Declaration
public static PayrollValue operator +(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator &(PayrollValue, PayrollValue)

Test if two payroll values are true (bool)

Declaration
public static PayrollValue operator &(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator |(PayrollValue, PayrollValue)

Test if any payroll value is true (bool)

Declaration
public static PayrollValue operator |(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator /(PayrollValue, PayrollValue)

Division of two payroll values (decimal, int)

Declaration
public static PayrollValue operator /(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator ==(PayrollValue, PayrollValue)

Compare two payroll values for equality

Declaration
public static bool operator ==(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
bool

operator false(PayrollValue)

Test if payroll value is false

Declaration
public static bool operator false(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
bool

operator >(PayrollValue, PayrollValue)

Compare if a payroll value is greater than another payroll value (decimal, int)

Declaration
public static PayrollValue operator >(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator >=(PayrollValue, PayrollValue)

Compare if a payroll value is greater or equals than another payroll value (decimal, int)

Declaration
public static PayrollValue operator >=(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

implicit operator bool(PayrollValue)

Convert payroll value to bool

Declaration
public static implicit operator bool(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
bool

implicit operator DateTime(PayrollValue)

Convert payroll value to DateTime

Declaration
public static implicit operator DateTime(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
DateTime

implicit operator decimal(PayrollValue)

Convert payroll value to decimal

Declaration
public static implicit operator decimal(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
decimal

implicit operator int(PayrollValue)

Convert payroll value to int/>

Declaration
public static implicit operator int(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
int

implicit operator bool?(PayrollValue)

Convert payroll value to nullable bool

Declaration
public static implicit operator bool?(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
bool?

implicit operator DateTime?(PayrollValue)

Convert payroll value to nullable DateTime

Declaration
public static implicit operator DateTime?(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
DateTime?

implicit operator decimal?(PayrollValue)

Convert payroll value to nullable decimal

Declaration
public static implicit operator decimal?(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
decimal?

implicit operator int?(PayrollValue)

Convert payroll value to nullable int

Declaration
public static implicit operator int?(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
int?

implicit operator string(PayrollValue)

Convert payroll value to string/>

Declaration
public static implicit operator string(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
string

operator !=(PayrollValue, PayrollValue)

Compare two payroll values for difference

Declaration
public static bool operator !=(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
bool

operator <(PayrollValue, PayrollValue)

Compare if a payroll value is less than another payroll value (decimal, int)

Declaration
public static PayrollValue operator <(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator <=(PayrollValue, PayrollValue)

Compare if a payroll value is less or equals than another payroll value (decimal, int)

Declaration
public static PayrollValue operator <=(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator !(PayrollValue)

Logical negation of a payroll value (bool)

Declaration
public static PayrollValue operator !(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
PayrollValue

operator %(PayrollValue, PayrollValue)

Remainder of two payroll values (decimal, int)

Declaration
public static PayrollValue operator %(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator *(PayrollValue, PayrollValue)

Multiplication of two payroll values (decimal, int)

Declaration
public static PayrollValue operator *(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator -(PayrollValue, PayrollValue)

Subtraction of two payroll values (decimal, int)

Declaration
public static PayrollValue operator -(PayrollValue left, PayrollValue right)
Parameters
Type Name Description
PayrollValue left
PayrollValue right
Returns
Type Description
PayrollValue

operator true(PayrollValue)

Test if payroll value is true

Declaration
public static bool operator true(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
bool

operator -(PayrollValue)

Unary minus of a payroll value (decimal, int)

Declaration
public static PayrollValue operator -(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
PayrollValue

operator +(PayrollValue)

Unary plus of a payroll value (decimal, int)

Declaration
public static PayrollValue operator +(PayrollValue value)
Parameters
Type Name Description
PayrollValue value
Returns
Type Description
PayrollValue

Extension Methods

PayrollValueExtensions.Convert(PayrollValue, Type, object)
PayrollValueExtensions.ToBoolean(PayrollValue)
PayrollValueExtensions.ToDateTime(PayrollValue)
PayrollValueExtensions.ToDecimal(PayrollValue)
PayrollValueExtensions.ToDecimal(PayrollValue, DecimalRounding)
PayrollValueExtensions.ToInt(PayrollValue)
PayrollValueExtensions.ToNullableBoolean(PayrollValue)
PayrollValueExtensions.ToNullableDateTime(PayrollValue)
PayrollValueExtensions.ToNullableDecimal(PayrollValue)
PayrollValueExtensions.ToNullableDecimal(PayrollValue, DecimalRounding)
PayrollValueExtensions.ToNullableInt(PayrollValue)
PayrollValueExtensions.ToString(PayrollValue)
PayrollValueExtensions.ValueAs<T>(PayrollValue, T)
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)
☀
☾
Back to top Generated by DocFX