Example #1
0
        public virtual void Update(Period period, Job job, Unit unit, JobPosition parent)
        {
            if (period == null || period.Id == null)
            {
                throw new ArgumentNullException("period");
            }
            period.CheckModifyingJobPosition();

            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");
            }

            this.parent = parent;
            unitId      = unit.Id;
            jobId       = job.Id;
        }