EchoTex_Payroll/HRM.DA/Service/Basic/SalaryComponentService.cs
2024-10-14 10:01:49 +06:00

80 lines
2.9 KiB
C#

using HRM.BO;
using HRM.DA;
using Ease.Core.DataAccess;
using Ease.Core.Model;
using Ease.Core.Utility;
using System;
using System.Collections.Generic;
namespace HRM.DA
{
public class SalaryComponentService : ISalaryComponent
{
public List<SalaryComponent> Benefits(int payrolltypeid)
{
List<SalaryComponent> _Benefits = new List<SalaryComponent>();
SalaryComponent component = null;
List<AllowanceDeduction> _Allowances = null;
AllowanceDeductionService oallowceService = new AllowanceDeductionService();
component = new SalaryComponent();
component.ObjectID = -101;
component.Description = "Basic Salary";
component.Type = EnumSalaryComponent.Basic;
_Benefits.Add(component);
_Allowances = oallowceService.Get(EnumStatus.Regardless, EnumAllowOrDeduct.Allowance, payrolltypeid);
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 List<SalaryComponent> Components(int payrolltypeid)
{
List<SalaryComponent> _Components = new List<SalaryComponent>();
AllowanceDeductionService oallowceService = new AllowanceDeductionService();
SalaryComponent component = null;
List<AllowanceDeduction> _Allowances = null;
List<AllowanceDeduction> _Deductions = null;
component = new SalaryComponent();
component.ObjectID = -101;
component.Description = "Basic Salary";
component.Type = EnumSalaryComponent.Basic;
_Components.Add(component);
_Allowances = oallowceService.Get(EnumStatus.Active, EnumAllowOrDeduct.Allowance, payrolltypeid);
foreach (AllowanceDeduction allowance in _Allowances)
{
component = new SalaryComponent();
component.ObjectID = allowance.ID;
component.Description = allowance.Name;
component.Type = EnumSalaryComponent.Allowance;
_Components.Add(component);
}
_Deductions = oallowceService.GetDeduction(EnumStatus.Active, payrolltypeid);
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;
}
}
}