public static string GetValue(EFrequencyType type)
 {
     if (type == EFrequencyType.Month)
     {
         return("Month");
     }
     if (type == EFrequencyType.Week)
     {
         return("Week");
     }
     if (type == EFrequencyType.Day)
     {
         return("Day");
     }
     if (type == EFrequencyType.Hour)
     {
         return("Hour");
     }
     if (type == EFrequencyType.Period)
     {
         return("Period");
     }
     if (type == EFrequencyType.JustInTime)
     {
         return("JustInTime");
     }
     if (type == EFrequencyType.OnlyOnce)
     {
         return("OnlyOnce");
     }
     throw new Exception();
 }
 public static string GetText(EFrequencyType type)
 {
     if (type == EFrequencyType.Month)
     {
         return("每月一次");
     }
     if (type == EFrequencyType.Week)
     {
         return("每周一次");
     }
     if (type == EFrequencyType.Day)
     {
         return("每天一次");
     }
     if (type == EFrequencyType.Hour)
     {
         return("每小时一次");
     }
     if (type == EFrequencyType.Period)
     {
         return("每周期一次");
     }
     if (type == EFrequencyType.JustInTime)
     {
         return("实时监控");
     }
     if (type == EFrequencyType.OnlyOnce)
     {
         return("只执行一次");
     }
     throw new Exception();
 }
        public static ListItem GetListItem(EFrequencyType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
 public static bool Equals(EFrequencyType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Exemple #5
0
 public TaskInfo(int taskID, string taskName, bool isSystemTask, int publishmentSystemID, EServiceType serviceType, string serviceParameters, EFrequencyType frequencyType, int periodIntervalMinute, int startDay, int startWeekday, int startHour, bool isEnabled, DateTime addDate, DateTime lastExecuteDate, string description)
 {
     this.taskID               = taskID;
     this.taskName             = taskName;
     this.isSystemTask         = isSystemTask;
     this.publishmentSystemID  = publishmentSystemID;
     this.serviceType          = serviceType;
     this.serviceParameters    = serviceParameters;
     this.frequencyType        = frequencyType;
     this.periodIntervalMinute = periodIntervalMinute;
     this.startDay             = startDay;
     this.startWeekday         = startWeekday;
     this.startHour            = startHour;
     this.isEnabled            = isEnabled;
     this.addDate              = addDate;
     this.lastExecuteDate      = lastExecuteDate;
     this.description          = description;
 }
Exemple #6
0
 public TaskInfo()
 {
     taskID               = 0;
     taskName             = string.Empty;
     isSystemTask         = false;
     publishmentSystemID  = 0;
     serviceType          = EServiceType.Backup;
     serviceParameters    = string.Empty;
     frequencyType        = EFrequencyType.Week;
     periodIntervalMinute = 0;
     startDay             = 0;
     startWeekday         = 0;
     startHour            = 0;
     isEnabled            = false;
     addDate              = DateTime.Now;
     lastExecuteDate      = DateTime.Now;
     description          = string.Empty;
 }
 public static bool Equals(string typeStr, EFrequencyType type)
 {
     return(Equals(type, typeStr));
 }