Exemplo n.º 1
0
        /// <summary>
        /// 多日代换班
        /// </summary>
        public void SwapingForMultiDay(Pair <Guid> agentPair, DateRange dateRange, bool isLaborRule)
        {
            ReSet();
            _attendanceRepository.Clear();
            Applier.SwapingDate = Replier.SwapingDate = dateRange;
            Initialize(agentPair, isLaborRule);

            Applier.InitializeSwapingForMultiDay();
            Replier.InitializeSwapingForMultiDay();
            //是否存在TimeOff
            ValidateHasTimeOff();
            //是否存在AbsentEvent
            ValidateHasAbsentEvent();
            //是否存在锁
            ValidateHasLocked();
            //删除班表
            DeleteTerms(new Pair <IList <Term> >(Applier.CurrentTerms, Replier.CurrentTerms));
            //删除DayOff
            DeleteTerms(new Pair <IList <Term> >(Applier.DayOffs, Replier.DayOffs));
            //交换班表
            SwapTerms(new Pair <IList <Term> >(Applier.CurrentTerms, Replier.CurrentTerms));
            SwapTerms(new Pair <IList <Term> >(Applier.LevelOnes, Replier.LevelOnes));
            SwapTerms(new Pair <IList <Term> >(Applier.LevelTwos, Replier.LevelTwos));
            SwapTerms(new Pair <IList <Term> >(Applier.LevelThrees, Replier.LevelThrees));
            //验证交换信息
            VaildateSwapMessage();
        }