示例#1
0
        public TimeDate ThisMonth(IDateTimeHelper _dateTimeHelper)
        {
            DateTime today   = _dateTimeHelper.GetDateTimeNow();
            TimeDate ausgabe = new TimeDate
            {
                StartDate = new DateTime(today.Year, today.Month, 1)
            };

            ausgabe.EndDate = ausgabe.StartDate.AddMonths(1).AddDays(-1);
            return(ausgabe);
        }
示例#2
0
        public override bool Equals(object value)
        {
            if (value == null)
            {
                return(false);
            }

            TimeDate date = value as TimeDate;

            return((date != null) &&
                   (StartDate == date.StartDate) &&
                   (EndDate == date.EndDate));
        }
示例#3
0
        public TimeDate ConvertTimeAreaWordToTimeArea(string timeAreaWord)
        {
            TimeDate timeArea = null;

            try
            {
                Type            dateType        = Type.GetType("TogglKonsolDate.ConvertTimeArea" + timeAreaWord);
                ConstructorInfo dateConstructor = dateType.GetConstructor(Type.EmptyTypes);
                object          dateClassObject = dateConstructor.Invoke(parameters: new object[] { });
                MethodInfo      dateMethod      = dateType.GetMethod(timeAreaWord);
                timeArea = (TimeDate)dateMethod.Invoke(dateClassObject, new object[] { _dateTimeHelper });
            }
            catch
            {
                timeArea = null;
            }

            return(timeArea);
        }