Esempio n. 1
0
 /// <summary>
 /// Get Duration CalendarField
 /// </summary>
 /// <returns>Calendar.MINUTE, etc.</returns>
 public int GetDurationCalendarField()
 {
     if (GetDurationUnit() == null)
     {
         return(GlobalVariable.Minute);
     }
     else if (DURATIONUNIT_Second.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.Second);
     }
     else if (DURATIONUNIT_Minute.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.Minute);
     }
     else if (DURATIONUNIT_Hour.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.Hour);
     }
     else if (DURATIONUNIT_Day.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.DayOfYear);
     }
     else if (DURATIONUNIT_Month.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.Month);
     }
     else if (DURATIONUNIT_Year.Equals(GetDurationUnit()))
     {
         return(GlobalVariable.Year);
     }
     return(GlobalVariable.Month);
 }
Esempio n. 2
0
 /// <summary>
 /// Get Duration Base in Seconds
 /// </summary>
 /// <returns>duration unit in seconds</returns>
 public long GetDurationBaseSec()
 {
     if (GetDurationUnit() == null)
     {
         return(0);
     }
     else if (DURATIONUNIT_Second.Equals(GetDurationUnit()))
     {
         return(1);
     }
     else if (DURATIONUNIT_Minute.Equals(GetDurationUnit()))
     {
         return(60);
     }
     else if (DURATIONUNIT_Hour.Equals(GetDurationUnit()))
     {
         return(3600);
     }
     else if (DURATIONUNIT_Day.Equals(GetDurationUnit()))
     {
         return(86400);
     }
     else if (DURATIONUNIT_Month.Equals(GetDurationUnit()))
     {
         return(2592000);
     }
     else if (DURATIONUNIT_Year.Equals(GetDurationUnit()))
     {
         return(31536000);
     }
     return(0);
 }