/// <summary> /// 时段代换班 /// </summary> public void SwapingForDateRange(Pair <Guid> agentPair, Pair <DateRange> dateRange, bool isLaborRule) { ReSet(); _attendanceRepository.Clear(); Applier.SwapingDate = Replier.SwapingDate = dateRange.Applier.GetSwapingDate(dateRange.Applier, dateRange.Replier); Initialize(agentPair, isLaborRule); Applier.InitializeSwapingForDateRange(Applier.SwapingDate); Replier.InitializeSwapingForDateRange(Replier.SwapingDate); //删除请假 DeleteTerms(new Pair <IList <Term> >(Applier.AbsentEvents, Replier.AbsentEvents)); //删除班表 DeleteTerms(new Pair <IList <Term> >(Applier.TempTerms, Replier.TempTerms)); if (dateRange.Applier == dateRange.Replier) { Applier.DealWithDateRange(Replier, dateRange.Applier); Replier.DealWithDateRange(Applier, dateRange.Replier); } else { Applier.DealWithDateRange(Replier, dateRange); Replier.DealWithDateRange(Applier, new Pair <DateRange>(dateRange.Replier, dateRange.Applier)); } //验证交换信息 VaildateSwapMessage(); }