zoukankan      html  css  js  c++  java
  • C#时间判断的循环刻度判断

    //查询当天之前的时间
                            if (SelectTime.Date < DateTime.Now.Date)
                            {
                                if (startTime < SetStartTime)
                                {
                                    jslist.Add(new Class技术员状态(color延迟出发, SetStartTime, SetEndTime));
                                }
                                if (startTime > SetStartTime)
                                {
                                    jslist.Add(new Class技术员状态(color延迟出发, startTime, SetEndTime));
                                }
                            }
                            //查询当天的时间
                            if (SelectTime.Date == DateTime.Now.Date)
                            {
                                //预计开始时间在之前,预计结束时间在当天
                                if (startTime.Date < SetStartTime.Date && endTime.Date == SetStartTime.Date)
                                {
                                    //还没到预计结束时间
                                    if (SelectTime <= endTime)
                                    {
                                        jslist.Add(new Class技术员状态(color排班, SetStartTime, SelectTime));
                                        jslist.Add(new Class技术员状态(color延迟出发, SelectTime, endTime));
                                    }
                                    //预计时间已过
                                    if (SelectTime > endTime)
                                    {
                                        jslist.Add(new Class技术员状态(color延迟出发, SetStartTime, SelectTime));
                                    }
                                }
                                //预计开始和预计结束时间在当天
                                if (startTime.Date == SelectTime.Date && endTime.Date == SelectTime.Date)
                                {
                                    if (SelectTime < startTime)
                                    {
                                        jslist.Add(new Class技术员状态(color排班, startTime, endTime));
                                    }
                                    if (SelectTime > startTime && SelectTime <= endTime)
                                    {
                                        jslist.Add(new Class技术员状态(color延迟出发, startTime, SelectTime));
                                        jslist.Add(new Class技术员状态(color排班, SelectTime, endTime));
                                    }
                                    if (SelectTime > endTime)
                                    {
                                        jslist.Add(new Class技术员状态(color延迟出发, startTime, SelectTime));
                                    }
                                }
                                //预计开始时间在当天,预计结束时间在之后
                                if (startTime.Date == SetStartTime.Date && endTime.Date > SetStartTime.Date)
                                {
                                    if (DateTime.Now < startTime)
                                    {
                                        jslist.Add(new Class技术员状态(color延迟出发, startTime, SetEndTime));
                                    }
                                    if (DateTime.Now > startTime)
                                    {
                                        jslist.Add(new Class技术员状态(color延迟出发, startTime, DateTime.Now));
                                        jslist.Add(new Class技术员状态(color排班, DateTime.Now, SetEndTime));
                                    }
                                }
                                jslist.Add(new Class技术员状态(color延迟出发, startTime, endTime));
                            }
                            //查询当天之后的时间
                            if (SelectTime.Date > DateTime.Now.Date)
                            {
                                if (startTime < SetStartTime && endTime < SetEndTime)
                                {
                                    jslist.Add(new Class技术员状态(color排班, SetStartTime, endTime));
                                }
                                if (startTime > SetStartTime && endTime < SetEndTime)
                                {
                                    jslist.Add(new Class技术员状态(color排班, startTime, endTime));
                                }
                                if (startTime > SetStartTime && endTime > SetEndTime)
                                {
                                    jslist.Add(new Class技术员状态(color排班, startTime, SetEndTime));
                                }
                            }

  • 相关阅读:
    解决一切日期问题的日期类
    汉诺塔类型问题解析
    窗口滑动
    大暑假集训总结(反思)
    找硬币题解
    Fiolki题解
    大逃亡题解
    Luogu6080 [USACO05DEC]Cow Patterns G
    Luogu3193 HNOI2008 GT考试
    Codeforces1355F Guess Divisors Count
  • 原文地址:https://www.cnblogs.com/qq1206583608/p/5165527.html
Copyright © 2011-2022 走看看