Esempio n. 1
0
        public BoxPairSwapModel(ITimeBoxRepository timeBoxRepository, IAttendanceRepository attendanceRepository,
                                ILaborHoursCountingModel laborHoursCountingModel, IEmployeeRepository employeeRepository)
        {
            _attendanceRepository = attendanceRepository;
            _employeeRepository   = employeeRepository;

            Applier = new BoxSwapModel(timeBoxRepository, attendanceRepository, laborHoursCountingModel);
            Replier = new BoxSwapModel(timeBoxRepository, attendanceRepository, laborHoursCountingModel);
        }
Esempio n. 2
0
        public BoxPairSwapModel(ITimeBoxRepository timeBoxRepository, IAttendanceRepository attendanceRepository,
            ILaborHoursCountingModel laborHoursCountingModel, IEmployeeRepository employeeRepository)
        {
            _attendanceRepository = attendanceRepository;
            _employeeRepository = employeeRepository;

            Applier = new BoxSwapModel(timeBoxRepository, attendanceRepository, laborHoursCountingModel);
            Replier = new BoxSwapModel(timeBoxRepository, attendanceRepository, laborHoursCountingModel);
        }
Esempio n. 3
0
        public void DealWithDateRange(BoxSwapModel opp, DateRange dateRange)
        {
            List <Term> inside, outside;

            Term.SliceTerm(CurrentTerms, dateRange.Start, dateRange.End, out outside, out inside);
            var day = TempTerms.HasDayTerms();

            //不符合的不创建了。
            var gaporun = inside.ConvertToCell(dateRange, 5, t => t.IsNot <UnlaboredSubEvent>()).Contains(true);

            if (gaporun)
            {
                DealWithTerms(inside, day);
                inside.ForEach(opp.TimeBoxCreateTerm);
            }
            //自己创建之外的班
            DealWithTerms(outside, day);
            outside.ForEach(TimeBoxCreateTerm);
        }
Esempio n. 4
0
 public void DealWithDateRange(BoxSwapModel opp, Pair<DateRange> dateRange)
 {
     List<Term> frontTerms, insideTerms, backTerms;
     Term.SliceTerm(CurrentTerms, dateRange.Applier.Start, dateRange.Applier.End, out insideTerms, out frontTerms,
                    out backTerms);
     var day = TempTerms.HasDayTerms();
     DealWithTerms(insideTerms, day);
     insideTerms.ForEach(opp.TimeBoxCreateTerm);
     //获取切割时间
     var cutDateRange = DateRange.Cut(dateRange.Applier, dateRange.Replier);
     var replierRegion = cutDateRange.Where(t => t.Item2 == RegionType.Replier).Select(o => o.Item1);
     List<Term> outside = null;
     List<Term> outside2 = null;
     if (replierRegion.Count() == 1)
     {
         var range = replierRegion.FirstOrDefault();
         List<Term> inside;
         //右边
         if (range.Start >= dateRange.Applier.End)
         {
             Term.SliceTerm(backTerms, range.Start, range.End, out outside, out inside);
             DealWithTerms(frontTerms, day);
             frontTerms.ForEach(TimeBoxCreateTerm);
         }
         //左边
         if (range.End <= dateRange.Applier.Start)
         {
             Term.SliceTerm(frontTerms, range.Start, range.End, out outside, out inside);
             DealWithTerms(backTerms, day);
             backTerms.ForEach(TimeBoxCreateTerm);
         }
     }
     if (replierRegion.Count() > 1)
     {
         foreach (var range in replierRegion)
         {
             List<Term> inside;
             //右边
             if (range.Start >= dateRange.Applier.End)
             {
                 Term.SliceTerm(backTerms, range.Start, range.End, out outside, out inside);
             }
             //左边
             if (range.End <= dateRange.Applier.Start)
             {
                 Term.SliceTerm(frontTerms, range.Start, range.End, out outside2, out inside);
             }
         }
     }
     if (outside2 != null)
     {
         DealWithTerms(outside2, day);
         outside2.ForEach(TimeBoxCreateTerm);
     }
     if (outside != null)
     {
         DealWithTerms(outside, day);
         outside.ForEach(TimeBoxCreateTerm);
     }
     else
     {
         DealWithTerms(frontTerms, day);
         DealWithTerms(backTerms, day);
         frontTerms.ForEach(TimeBoxCreateTerm);
         backTerms.ForEach(TimeBoxCreateTerm);
     }
 }
Esempio n. 5
0
        public void DealWithDateRange(BoxSwapModel opp, DateRange dateRange)
        {
            List<Term> inside, outside;
            Term.SliceTerm(CurrentTerms, dateRange.Start, dateRange.End, out outside, out inside);
            var day = TempTerms.HasDayTerms();

            //不符合的不创建了。
            var gaporun = inside.ConvertToCell(dateRange, 5, t => t.IsNot<UnlaboredSubEvent>()).Contains(true);
            if (gaporun)
            {
                DealWithTerms(inside, day);
                inside.ForEach(opp.TimeBoxCreateTerm);
            }
            //自己创建之外的班
            DealWithTerms(outside, day);
            outside.ForEach(TimeBoxCreateTerm);
        }
Esempio n. 6
0
        public void DealWithDateRange(BoxSwapModel opp, Pair <DateRange> dateRange)
        {
            List <Term> frontTerms, insideTerms, backTerms;

            Term.SliceTerm(CurrentTerms, dateRange.Applier.Start, dateRange.Applier.End, out insideTerms, out frontTerms,
                           out backTerms);
            var day = TempTerms.HasDayTerms();

            DealWithTerms(insideTerms, day);
            insideTerms.ForEach(opp.TimeBoxCreateTerm);
            //获取切割时间
            var         cutDateRange  = DateRange.Cut(dateRange.Applier, dateRange.Replier);
            var         replierRegion = cutDateRange.Where(t => t.Item2 == RegionType.Replier).Select(o => o.Item1);
            List <Term> outside       = null;
            List <Term> outside2      = null;

            if (replierRegion.Count() == 1)
            {
                var         range = replierRegion.FirstOrDefault();
                List <Term> inside;
                //右边
                if (range.Start >= dateRange.Applier.End)
                {
                    Term.SliceTerm(backTerms, range.Start, range.End, out outside, out inside);
                    DealWithTerms(frontTerms, day);
                    frontTerms.ForEach(TimeBoxCreateTerm);
                }
                //左边
                if (range.End <= dateRange.Applier.Start)
                {
                    Term.SliceTerm(frontTerms, range.Start, range.End, out outside, out inside);
                    DealWithTerms(backTerms, day);
                    backTerms.ForEach(TimeBoxCreateTerm);
                }
            }
            if (replierRegion.Count() > 1)
            {
                foreach (var range in replierRegion)
                {
                    List <Term> inside;
                    //右边
                    if (range.Start >= dateRange.Applier.End)
                    {
                        Term.SliceTerm(backTerms, range.Start, range.End, out outside, out inside);
                    }
                    //左边
                    if (range.End <= dateRange.Applier.Start)
                    {
                        Term.SliceTerm(frontTerms, range.Start, range.End, out outside2, out inside);
                    }
                }
            }
            if (outside2 != null)
            {
                DealWithTerms(outside2, day);
                outside2.ForEach(TimeBoxCreateTerm);
            }
            if (outside != null)
            {
                DealWithTerms(outside, day);
                outside.ForEach(TimeBoxCreateTerm);
            }
            else
            {
                DealWithTerms(frontTerms, day);
                DealWithTerms(backTerms, day);
                frontTerms.ForEach(TimeBoxCreateTerm);
                backTerms.ForEach(TimeBoxCreateTerm);
            }
        }