136 lines
4.1 KiB
C#
136 lines
4.1 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using Ease.CoreV35;
|
|||
|
using Ease.CoreV35.Model;
|
|||
|
using Ease.CoreV35.Caching;
|
|||
|
using System.Data.Linq.Mapping;
|
|||
|
|
|||
|
namespace Payroll.BO
|
|||
|
{
|
|||
|
public enum EnumSalaryComponent
|
|||
|
{
|
|||
|
Basic = -101,
|
|||
|
Allowance = 2,
|
|||
|
Bonus=3
|
|||
|
}
|
|||
|
[Serializable]
|
|||
|
public class SalaryComponent : BasicBaseObject
|
|||
|
{
|
|||
|
private string _description = string.Empty;
|
|||
|
private ID _internalID = null;
|
|||
|
private EnumSalaryComponent _Type = EnumSalaryComponent.Basic;
|
|||
|
private static ObjectsTemplate<SalaryComponent> _Components = null;
|
|||
|
private static ObjectsTemplate<SalaryComponent> _Benefits = null;
|
|||
|
|
|||
|
public SalaryComponent()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public ID ObjectID
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return _internalID;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
_internalID = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public string Description
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return _description;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
_description = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public EnumSalaryComponent Type
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return _Type;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
_Type = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public static ObjectsTemplate<SalaryComponent> Benefits()
|
|||
|
{
|
|||
|
SalaryComponent component = null;
|
|||
|
ObjectsTemplate<AllowanceDeduction> _Allowances = null;
|
|||
|
|
|||
|
if (_Benefits == null || _Benefits.Count == 0)
|
|||
|
{
|
|||
|
_Benefits = new ObjectsTemplate<SalaryComponent>();
|
|||
|
|
|||
|
component = new SalaryComponent();
|
|||
|
component.ObjectID = ID.FromInteger(-101);
|
|||
|
component.Description = "Basic Salary";
|
|||
|
component.Type = EnumSalaryComponent.Basic;
|
|||
|
_Benefits.Add(component);
|
|||
|
|
|||
|
_Allowances = AllowanceDeduction.GetAllowance(EnumStatus.Active);
|
|||
|
foreach (AllowanceDeduction allowance in _Allowances)
|
|||
|
{
|
|||
|
component = new SalaryComponent();
|
|||
|
component.ObjectID = allowance.ID;
|
|||
|
component.Description = allowance.Name;
|
|||
|
component.Type = EnumSalaryComponent.Allowance;
|
|||
|
_Benefits.Add(component);
|
|||
|
}
|
|||
|
}
|
|||
|
return _Benefits;
|
|||
|
}
|
|||
|
|
|||
|
public static ObjectsTemplate<SalaryComponent> Components()
|
|||
|
{
|
|||
|
SalaryComponent component = null;
|
|||
|
ObjectsTemplate<AllowanceDeduction> _Allowances = null;
|
|||
|
ObjectsTemplate<AllowanceDeduction> _Deductions = null;
|
|||
|
|
|||
|
if(_Components==null || _Components.Count==0)
|
|||
|
{
|
|||
|
_Components = new ObjectsTemplate<SalaryComponent>();
|
|||
|
|
|||
|
component = new SalaryComponent();
|
|||
|
component.ObjectID = ID.FromInteger(-101);
|
|||
|
component.Description = "Basic Salary";
|
|||
|
component.Type = EnumSalaryComponent.Basic;
|
|||
|
_Components.Add(component);
|
|||
|
|
|||
|
_Allowances = AllowanceDeduction.GetAllowance(EnumStatus.Active);
|
|||
|
foreach (AllowanceDeduction allowance in _Allowances)
|
|||
|
{
|
|||
|
component = new SalaryComponent();
|
|||
|
component.ObjectID = allowance.ID;
|
|||
|
component.Description = allowance.Name;
|
|||
|
component.Type = EnumSalaryComponent.Allowance;
|
|||
|
_Components.Add(component);
|
|||
|
}
|
|||
|
|
|||
|
_Deductions = AllowanceDeduction.GetDeduction(EnumStatus.Active);
|
|||
|
foreach (AllowanceDeduction deduction in _Deductions)
|
|||
|
{
|
|||
|
component = new SalaryComponent();
|
|||
|
component.ObjectID = deduction.ID;
|
|||
|
component.Description = deduction.Name;
|
|||
|
//component.Type = EnumSalaryComponent.Deduction;
|
|||
|
_Components.Add(component);
|
|||
|
}
|
|||
|
}
|
|||
|
return _Components;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|