Class PayrollValue
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
[JsonConverter(typeof(PayrollValueConverter))]
public class PayrollValue
Constructors
PayrollValue()
Declaration
PayrollValue(PayrollValue)
Declaration
public PayrollValue(PayrollValue source)
Parameters
| Type |
Name |
Description |
| PayrollValue |
source |
The source payroll value
|
PayrollValue(object)
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
Properties
CurrentValue
Declaration
protected virtual object CurrentValue { get; }
Property Value
HasValue
Test if the payroll value is defined
Declaration
[JsonIgnore]
public virtual bool HasValue { get; }
Property Value
IsNumeric
Test if the payroll value is numeric
Declaration
[JsonIgnore]
public bool IsNumeric { get; }
Property Value
Value
Declaration
public object Value { get; }
Property Value
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
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
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
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
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
Operators
operator +(PayrollValue, PayrollValue)
Addition of two payroll values (decimal, int, string)
Declaration
public static PayrollValue operator +(PayrollValue left, PayrollValue right)
Parameters
Returns
operator &(PayrollValue, PayrollValue)
Test if two payroll values are true (bool)
Declaration
public static PayrollValue operator &(PayrollValue left, PayrollValue right)
Parameters
Returns
operator |(PayrollValue, PayrollValue)
Test if any payroll value is true (bool)
Declaration
public static PayrollValue operator |(PayrollValue left, PayrollValue right)
Parameters
Returns
operator /(PayrollValue, PayrollValue)
Division of two payroll values (decimal, int)
Declaration
public static PayrollValue operator /(PayrollValue left, PayrollValue right)
Parameters
Returns
operator ==(PayrollValue, PayrollValue)
Compare two payroll values for equality
Declaration
public static bool operator ==(PayrollValue left, PayrollValue right)
Parameters
Returns
operator false(PayrollValue)
Test if payroll value is false
Declaration
public static bool operator false(PayrollValue value)
Parameters
Returns
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
Returns
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
Returns
implicit operator bool(PayrollValue)
Convert payroll value to bool
Declaration
public static implicit operator bool(PayrollValue value)
Parameters
Returns
implicit operator DateTime(PayrollValue)
Convert payroll value to DateTime
Declaration
public static implicit operator DateTime(PayrollValue value)
Parameters
Returns
implicit operator decimal(PayrollValue)
Convert payroll value to decimal
Declaration
public static implicit operator decimal(PayrollValue value)
Parameters
Returns
implicit operator int(PayrollValue)
Convert payroll value to int/>
Declaration
public static implicit operator int(PayrollValue value)
Parameters
Returns
implicit operator bool?(PayrollValue)
Convert payroll value to nullable bool
Declaration
public static implicit operator bool?(PayrollValue value)
Parameters
Returns
implicit operator DateTime?(PayrollValue)
Convert payroll value to nullable DateTime
Declaration
public static implicit operator DateTime?(PayrollValue value)
Parameters
Returns
implicit operator decimal?(PayrollValue)
Convert payroll value to nullable decimal
Declaration
public static implicit operator decimal?(PayrollValue value)
Parameters
Returns
implicit operator int?(PayrollValue)
Convert payroll value to nullable int
Declaration
public static implicit operator int?(PayrollValue value)
Parameters
Returns
implicit operator string(PayrollValue)
Convert payroll value to string/>
Declaration
public static implicit operator string(PayrollValue value)
Parameters
Returns
operator !=(PayrollValue, PayrollValue)
Compare two payroll values for difference
Declaration
public static bool operator !=(PayrollValue left, PayrollValue right)
Parameters
Returns
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
Returns
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
Returns
operator !(PayrollValue)
Logical negation of a payroll value (bool)
Declaration
public static PayrollValue operator !(PayrollValue value)
Parameters
Returns
operator %(PayrollValue, PayrollValue)
Remainder of two payroll values (decimal, int)
Declaration
public static PayrollValue operator %(PayrollValue left, PayrollValue right)
Parameters
Returns
operator *(PayrollValue, PayrollValue)
Multiplication of two payroll values (decimal, int)
Declaration
public static PayrollValue operator *(PayrollValue left, PayrollValue right)
Parameters
Returns
operator -(PayrollValue, PayrollValue)
Subtraction of two payroll values (decimal, int)
Declaration
public static PayrollValue operator -(PayrollValue left, PayrollValue right)
Parameters
Returns
operator true(PayrollValue)
Test if payroll value is true
Declaration
public static bool operator true(PayrollValue value)
Parameters
Returns
operator -(PayrollValue)
Unary minus of a payroll value (decimal, int)
Declaration
public static PayrollValue operator -(PayrollValue value)
Parameters
Returns
operator +(PayrollValue)
Unary plus of a payroll value (decimal, int)
Declaration
public static PayrollValue operator +(PayrollValue value)
Parameters
Returns
Extension Methods