/// <summary>
        /// Builds the DbCommand to get a list of a task's dependencies
        /// </summary>
        /// <param name="daMgr">DataAccessMgr object</param>
        /// <returns>DbCommand Object with DbNull Parameter values</returns>
        static DbCommand BuildCmdGetTaskDependencies(DataAccessMgr daMgr)
        {
            DbTableDmlMgr dmlSelectMgr = daMgr.DbCatalogGetTableDmlMgr(DataAccess.Constants.SCHEMA_CORE
                                                                       , Constants.TaskDependencies);
            string jointable = dmlSelectMgr.AddJoin(DataAccess.Constants.SCHEMA_CORE
                                                    , Constants.TaskProcessingQueue
                                                    , DbTableJoinType.Inner
                                                    , j => j.AliasedColumn(Constants.WaitTaskQueueCode)
                                                    == j.JoinAliasedColumn(Constants.TaskQueueCode)
                                                    , Constants.TaskId);

            dmlSelectMgr.SetWhereCondition(w => w.Column(Constants.TaskQueueCode) == w.Parameter(Constants.TaskQueueCode));
            dmlSelectMgr.AddOrderByColumnAscending(Constants.TaskQueueCode);
            dmlSelectMgr.AddOrderByColumnAscending(DataAccess.Constants.SCHEMA_CORE, Constants.TaskProcessingQueue, Constants.TaskId);
            return(daMgr.BuildSelectDbCommand(dmlSelectMgr, null));
        }
        /// <summary>
        /// Builds the DbCommand to get a list of task processing queue records
        /// sorted by StatusDateTime.
        /// </summary>
        /// <param name="daMgr">DataAccessMgr object</param>
        /// <returns>DbCommand Object with DbNull Parameter values</returns>
        static DbCommand BuildCmdGetTPQListByStatusDateTime(DataAccessMgr daMgr)
        {
            DbTableDmlMgr dmlSelectMgr = daMgr.DbCatalogGetTableDmlMgr(DataAccess.Constants.SCHEMA_CORE
                                                                       , Constants.TaskProcessingQueue);
            string joinTable = dmlSelectMgr.AddJoin(DataAccess.Constants.SCHEMA_CORE
                                                    , Constants.TaskStatusCodes
                                                    , DbTableJoinType.Inner
                                                    , j => j.AliasedColumn(Constants.StatusCode)
                                                    == j.JoinAliasedColumn(Constants.StatusCode)
                                                    , Constants.StatusName);

            dmlSelectMgr.SetWhereCondition(w => w.AliasedColumn(Constants.StatusCode)
                                           == w.Parameter(Constants.StatusCode));
            dmlSelectMgr.AddOrderByColumnAscending(Constants.StatusCode);
            dmlSelectMgr.AddOrderByColumnDescending(Constants.StatusDateTime);
            dmlSelectMgr.AddOrderByColumnAscending(Constants.TaskQueueCode);
            return(daMgr.BuildSelectDbCommand(dmlSelectMgr, null));
        }