using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using PayRollDAL.CustomeCode.Applicant; using PayRollDAL.DTO.Applicant; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace PayRollBLL.Applicant { public class ApplicantBLL : IApplicantBLL { private readonly IApplicantDAL _ApplicantDAL; public ApplicantBLL(IApplicantDAL ApplicantDAL) { _ApplicantDAL = ApplicantDAL; } public async Task> GetSelectListApplicant( int firstNumber, int maxResult, int type, CriteriaDTO criteriaDTO, LoginDTO loginDTO, bool isCount = false) { try { if (type != -1 && type != 0) throw new ArgumentException("Type must be -1 (master) or 0 (transaction)", nameof(type)); if (firstNumber == 0 && maxResult == 0) { firstNumber = 0; maxResult = 10; } var result = await _ApplicantDAL.GetSelectListApplicant(firstNumber, maxResult, type, criteriaDTO, loginDTO, isCount); return result?.ToList() ?? new List(); } catch (Exception) { throw; } } } }