示例#1
0
        /// <summary>
        /// 离线代换班
        /// </summary>
        public void SwapingForSubEvent(Pair <Guid> agentPair, Pair <long> assignmentPair)
        {
            _attendanceRepository.Clear();
            Applier.Term = _attendanceRepository.Get <Term>(assignmentPair.Applier);
            Replier.Term = _attendanceRepository.Get <Term>(assignmentPair.Replier);
            var dateA = new DateRange(Applier.Term.Start, Applier.Term.End);
            var dateB = new DateRange(Replier.Term.Start, Replier.Term.End);

            _attendanceRepository.Clear();
            //初始化班表信息
            Applier.InitializeTimeBox(agentPair.Applier, dateA);
            Replier.InitializeTimeBox(agentPair.Replier, dateB);
            Applier.InitializeSwapingForSubEvent(new Pair <DateRange>(dateA, dateB), assignmentPair.Applier);
            Replier.InitializeSwapingForSubEvent(new Pair <DateRange>(dateB, dateA), assignmentPair.Replier);
            //验证
            ValidateTermGapHasMatched();
            //保存日志
            SaveLog();
            //删除班
            DeleteTerm();
            //交换班表
            SwapSpecificTermIsNeedSeat();
            //验证交换信息
            VaildateSwapMessage();
        }
示例#2
0
        /// <summary>
        /// 离线代换班验证
        /// </summary>
        public Dictionary <Guid, Dictionary <string, bool> > SwapingForSubEventValidate(Pair <Guid> agentPair, Pair <long> subEventPair)
        {
            _attendanceRepository.Clear();
            Applier.Term = _attendanceRepository.Get <Term>(subEventPair.Applier);
            Replier.Term = _attendanceRepository.Get <Term>(subEventPair.Replier);
            var dateA = new DateRange(Applier.Term.Start, Applier.Term.End);
            var dateB = new DateRange(Replier.Term.Start, Replier.Term.End);

            _attendanceRepository.Clear();
            //初始化班表信息
            Applier.InitializeTimeBox(agentPair.Applier, dateA);
            Replier.InitializeTimeBox(agentPair.Replier, dateB);
            Applier.InitializeSwapingForSubEvent(new Pair <DateRange>(dateA, dateB), subEventPair.Applier);
            Replier.InitializeSwapingForSubEvent(new Pair <DateRange>(dateB, dateA), subEventPair.Replier);
            Applier.IsNeedSeat = Replier.IsNeedSeat = Applier.Term.IsNeedSeat != Replier.Term.IsNeedSeat;
            return(SetValidates());
        }