Esempio n. 1
0
        public Calculation(CalculationId calculationId,
                           Period period,
                           Policy policy,
                           string name,
                           DateTime creationDate,
                           string employeeIdList)
            : this()
        {
            if (calculationId == null)
            {
                throw new ArgumentNullException("calculationId");
            }
            if (period == null)
            {
                throw new ArgumentNullException("period");
            }
            period.CheckCreatingCalculation();
            if (policy == null)
            {
                throw new ArgumentNullException("policy");
            }

            this.id           = calculationId;
            this.periodId     = period.Id;
            this.policyId     = policy.Id;
            this.creationDate = creationDate;

            if (string.IsNullOrWhiteSpace(name))
            {
                throw new CalculationArgumentException("Calculation", "Name");
            }
            this.name = name;
            this.employeeIdDelimetedList = employeeIdList;
            state           = new CalculationInitState();
            isDeterministic = false;
        }