示例#1
0
 public double Calculation(Employee entity, DateTime period)
 {
     if (GetTypeEntity(entity) == SuccessorType())
     {
         return(CalculationSuccessor(entity, period));
     }
     if (_successor != null)
     {
         return(_successor.Calculation(entity, period));
     }
     throw new NotImplementedException(entity.Name + " not found calculation method");
 }
示例#2
0
        public Tuple <double, string> Calculation(Salary entity)
        {
            Tuple <double, string> answer;

            var employee = _unitOfWork.Employees.Find(entity.EmployeeID);

            try
            {
                CheckCalculationSalary(employee, entity);
                answer = new Tuple <double, string>(Calculations.Calculation(employee, entity.Date), "");
            }
            catch (Exception ex)
            {
                answer = new Tuple <double, string>(-1, ex.Message);
            }
            return(answer);
        }