Exemplo n.º 1
0
 /// <summary>
 /// Gets the name of the reward by.
 /// </summary>
 /// <param name="deductionName">Name of the deduction.</param>
 /// <returns></returns>
 /// <exception cref="ArgumentNullException">Get Deduction By Name</exception>
 public IDeduction GetDeductionByName(string deductionName)
 {
     try
     {
         using (
             var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
         {
             var deductionInfo = DeductionQueries.getDeductionByName(dbContext, deductionName);
             return(deductionInfo);
         }
     }
     catch (Exception e)
     {
         throw new ArgumentNullException("Get Deduction By Name", e);
     }
 }
Exemplo n.º 2
0
        public IList <IDeduction> GetDeductionByEmployeeId(int employeeId)
        {
            if (employeeId <= 0)
            {
                throw new ArgumentNullException(nameof(employeeId));
            }

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var result = DeductionQueries.getDeductionByEmployeeId(dbContext, employeeId).ToList();

                    return(result);
                }
            }
            catch (Exception e)
            {
                throw new ArgumentNullException("Get Deduction By EmployeeId", e);
            }
        }