当前位置: 首页>>代码示例>>C#>>正文


C# JobStatus.ToString方法代码示例

本文整理汇总了C#中JobStatus.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# JobStatus.ToString方法的具体用法?C# JobStatus.ToString怎么用?C# JobStatus.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JobStatus的用法示例。


在下文中一共展示了JobStatus.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateSelectCommand

        /// <summary>
        /// Creates a select command.
        /// </summary>
        /// <param name="connection">The connection to create the command with.</param>
        /// <param name="status">The job status to filter results on.</param>
        /// <param name="count">The maximum number of results to select.</param>
        /// <param name="before">The queued-after date to filter on.</param>
        /// <returns>A select command.</returns>
        protected override DbCommand CreateSelectCommand(DbConnection connection, JobStatus status, int count, DateTime before)
        {
            const string SqlStart = "SELECT{0} * FROM {1} WHERE {2} = {3} AND {4} < {5} ORDER BY {4};";

            DbCommand command = connection.CreateCommand();
            command.CommandType = CommandType.Text;
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Status"), status.ToString()));
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Before"), before));

            string countString = String.Empty;

            if (count > 0)
            {
                countString = String.Format(CultureInfo.InvariantCulture, " TOP ({0})", this.ParameterName("Count"));
                command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Count"), count));
            }

            command.CommandText = String.Format(
                CultureInfo.InvariantCulture,
                SqlStart,
                countString,
                this.TableName,
                this.ColumnName("Status"),
                this.ParameterName("Status"),
                this.ColumnName("QueueDate"),
                this.ParameterName("Before"));

            return command;
        }
开发者ID:ChadBurggraf,项目名称:blue-collar-old,代码行数:37,代码来源:SqlServerJobStore.cs

示例2: GetStatusOption

 public static StatusOption GetStatusOption(JobStatus status, DataAccessDataContext context)
 {
     return StatusService.GetStatuses(context)[StatusType.JobStatus].Where(s => s.SystemName == status.ToString()).SingleOrDefault();
 }
开发者ID:psychotiic,项目名称:speedyspots,代码行数:4,代码来源:JobsService.cs

示例3: LoadBy

 public IEnumerable<Job> LoadBy(JobStatus status)
 {
     return
         _connection.Query(
             string.Format(
                 "select {0} from DependableJobs " +
                 "where Status = @Status and Suspended = 0 and InstanceName = @InstanceName",
                 Columns),
             new {Status = status.ToString(), InstanceName = _instanceName})
             .Select(Deserialize)
             .ToArray();
 }
开发者ID:inprotech-dev,项目名称:dependable,代码行数:12,代码来源:SqlPersistenceStore.cs

示例4: GetJobStatusID

        public int GetJobStatusID(JobStatus oJobStatus)
        {
            var iJobStatusID = 0;
             var sCacheItemKey = "JobStatus-" + oJobStatus.ToString();

             if (HttpContext.Current.Cache[sCacheItemKey] == null)
             {
            iJobStatusID = GetJobStatusFromDB(oJobStatus).IAJobStatusID;
            HttpContext.Current.Cache.Add(sCacheItemKey, iJobStatusID, null, DateTime.Now.AddSeconds(3600), TimeSpan.Zero, CacheItemPriority.Normal, null);
             }
             else
             {
            iJobStatusID = (int) HttpContext.Current.Cache[sCacheItemKey];
             }

             return iJobStatusID;
        }
开发者ID:psychotiic,项目名称:speedyspots,代码行数:17,代码来源:ApplicationContext.cs

示例5: GetJobStatusFromDB

        /// <summary>
        /// Retreives the apporpirate JobStatus object from the DB based on the enum value passed in
        /// </summary>
        /// <param name="oJobStatus"></param>
        /// <returns></returns>
        private IAJobStatus GetJobStatusFromDB(JobStatus oJobStatus)
        {
            IAJobStatus oIAJobStatus = null;
             switch (oJobStatus)
             {
            case JobStatus.Incomplete:
               oIAJobStatus = DataAccess.IAJobStatus.SingleOrDefault(row => row.Name == "Incomplete");
               break;
            case JobStatus.CompleteNeedsProduction:
               oIAJobStatus = DataAccess.IAJobStatus.SingleOrDefault(row => row.Name == "Complete - Needs Production");
               break;
            case JobStatus.Complete:
               oIAJobStatus = DataAccess.IAJobStatus.SingleOrDefault(row => row.Name == "Complete");
               break;
            case JobStatus.ReCutRequested:
               oIAJobStatus = DataAccess.IAJobStatus.SingleOrDefault(row => row.Name == "Re-Cut Requested");
               break;
            default:
               throw new ApplicationException(string.Format("Job status is undefined or doesn't exist: {0}", oJobStatus.ToString()));
             }

             return oIAJobStatus;
        }
开发者ID:psychotiic,项目名称:speedyspots,代码行数:28,代码来源:ApplicationContext.cs

示例6: CreateSelectCommand

        /// <summary>
        /// Creates a select command.
        /// </summary>
        /// <param name="connection">The connection to create the command with.</param>
        /// <param name="status">The job status to filter results on.</param>
        /// <param name="count">The maximum number of results to select.</param>
        /// <param name="before">The queued-after date to filter on.</param>
        /// <returns>A select command.</returns>
        protected virtual DbCommand CreateSelectCommand(DbConnection connection, JobStatus status, int count, DateTime before)
        {
            const string SqlStart = "SELECT * FROM {0} WHERE {1} = {2} AND {3} < {4} ORDER BY {3}";
            const string SqlEnd = " LIMIT {0}";

            DbCommand command = connection.CreateCommand();
            command.CommandType = CommandType.Text;
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Status"), status.ToString()));
            command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Before"), before));

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat(
                CultureInfo.InvariantCulture,
                SqlStart,
                this.TableName,
                this.ColumnName("Status"),
                this.ParameterName("Status"),
                this.ColumnName("QueueDate"),
                this.ParameterName("Before"));

            if (count > 0)
            {
                command.Parameters.Add(this.ParameterWithValue(this.ParameterName("Count"), count));
                sb.AppendFormat(CultureInfo.InvariantCulture, SqlEnd, this.ParameterName("Count"));
            }

            sb.Append(";");
            command.CommandText = sb.ToString();

            return command;
        }
开发者ID:ChadBurggraf,项目名称:blue-collar-old,代码行数:39,代码来源:SqlJobStore.cs


注:本文中的JobStatus.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。