Example #1
0
        public override decimal ToTimeVariable(TimeVariableType type)
        {
            switch (type)
            {
            case TimeVariableType.Year:
                return(DateTime.Now.AddDays(-1).Year);

            case TimeVariableType.Month:
                return(DateTime.Now.AddDays(-1).Month);

            case TimeVariableType.Day:
                return(DateTime.Now.AddDays(-1).Day);

            case TimeVariableType.WeekDay:
                return(DateExtractor.GetWeekDay(ToTime()));

            case TimeVariableType.Hour:
                return((int)arg0.ToNumber());

            case TimeVariableType.Minute:
                return((int)arg1.ToNumber());

            case TimeVariableType.Second:
                return((int)arg2.ToNumber());
            }
            return(0);
        }
Example #2
0
        public override decimal ToTimeVariable(TimeVariableType type)
        {
            switch (type)
            {
            case TimeVariableType.Year:
                return(arg0.ToNumber());

            case TimeVariableType.Month:
                return(1);

            case TimeVariableType.Day:
                return(1);

            case TimeVariableType.WeekDay:
                return(DateExtractor.GetWeekDay(ToTime()));

            case TimeVariableType.Hour:
                return(0);

            case TimeVariableType.Minute:
                return(0);

            case TimeVariableType.Second:
                return(0);
            }
            return(0);
        }
Example #3
0
        public override decimal ToTimeVariable(TimeVariableType type)
        {
            switch (type)
            {
            case TimeVariableType.Year:
                return(year.ToYear());

            case TimeVariableType.Month:
                return(month);

            case TimeVariableType.Day:
                return(day.ToDay());

            case TimeVariableType.WeekDay:
                return(DateExtractor.GetWeekDay(ToTime()));

            case TimeVariableType.Hour:
                return(clock.ToHour());

            case TimeVariableType.Minute:
                return(clock.ToMinute());

            case TimeVariableType.Second:
                return(clock.ToSecond());
            }
            return(0);
        }