示例#1
0
文件: WorkDay.cs 项目: vipwolf/moni
        private DayType calculateDayType(DateTime dt, DayOfWeek dayOfWeek, GermanSpecialDays specialDays, out GermanSpecialDay foundSpecialDay)
        {
            foundSpecialDay = null;
              if (specialDays != null) {
            specialDays.TryGetValue(dt, out foundSpecialDay);
              }
              if (foundSpecialDay != null) {
            return DayType.Holiday;
              }

              DayType ret = DayType.Unknown;
              switch (dayOfWeek) {
            case DayOfWeek.Monday:
            case DayOfWeek.Tuesday:
            case DayOfWeek.Wednesday:
            case DayOfWeek.Thursday:
            case DayOfWeek.Friday:
              ret = DayType.Working;
              break;
            case DayOfWeek.Saturday:
            case DayOfWeek.Sunday:
              ret = DayType.Weekend;
              break;
              }

              // TODO: more calculations required...
              return ret;
        }
示例#2
0
        private DayType calculateDayType(DateTime dt, DayOfWeek dayOfWeek, GermanSpecialDays specialDays, out GermanSpecialDay foundSpecialDay)
        {
            foundSpecialDay = null;
            if (specialDays != null)
            {
                specialDays.TryGetValue(dt, out foundSpecialDay);
            }
            if (foundSpecialDay != null)
            {
                return(DayType.Holiday);
            }

            DayType ret = DayType.Unknown;

            switch (dayOfWeek)
            {
            case DayOfWeek.Monday:
            case DayOfWeek.Tuesday:
            case DayOfWeek.Wednesday:
            case DayOfWeek.Thursday:
            case DayOfWeek.Friday:
                ret = DayType.Working;
                break;

            case DayOfWeek.Saturday:
            case DayOfWeek.Sunday:
                ret = DayType.Weekend;
                break;
            }

            // TODO: more calculations required...
            return(ret);
        }
示例#3
0
            /* Compare-Methode für das Sortieren */
            public int CompareTo(object o)
            {
                GermanSpecialDay gsd = (GermanSpecialDay)o;

                return(this.Date.CompareTo(gsd.Date));
            }