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 Benefits(int payrolltypeid) { List _Benefits = new List(); SalaryComponent component = null; List _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 Components(int payrolltypeid) { List _Components = new List(); AllowanceDeductionService oallowceService = new AllowanceDeductionService(); SalaryComponent component = null; List _Allowances = null; List _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; } } }