Beispiel #1
0
        public JobPosition(Period period, SharedJobPosition sharedJobPosition, JobPosition parent, Job job, Unit unit)
        {
            if (period == null || period.Id == null)
            {
                throw new ArgumentNullException("period");
            }
            period.CheckAssigningJobPosition();
            if (sharedJobPosition == null || sharedJobPosition.Id == null)
            {
                throw new ArgumentNullException("sharedJobPosition");
            }
            if (job == null || job.Id == null)
            {
                throw new ArgumentNullException("job");
            }
            if (unit == null || unit.Id == null)
            {
                throw new ArgumentNullException("unit");
            }


            if (!period.Id.Equals(job.Id.PeriodId))
            {
                throw new JobPositionCompareException("JobPosition", "Job", "Period");
            }

            if (!period.Id.Equals(unit.Id.PeriodId))
            {
                throw new JobPositionCompareException("JobPosition", "Unit", "Period");
            }

            id = new JobPositionId(period.Id, sharedJobPosition.Id);
            this.sharedJobPosition = sharedJobPosition;
            this.parent            = parent;
            unitId = unit.Id;
            jobId  = job.Id;
        }