static DbCommand BuildCmdDelInActiveUserSessionsList(DataAccessMgr daMgr) { DbTableDmlMgr dmlDeleteMgr = daMgr.DbCatalogGetTableDmlMgr(DataAccess.Constants.SCHEMA_CORE , Constants.UserSessions); string joinTable = dmlDeleteMgr.AddJoin(DataAccess.Constants.SCHEMA_CORE , Constants.SignonControl, DbTableJoinType.Cross, null); string dateAdd = daMgr.FormatDateMathSql(EnumDateDiffInterval.Second , dmlDeleteMgr.AliasedColumn(joinTable, Constants.StatusSeconds), dmlDeleteMgr.Column(Constants.SessionDateTime)); dmlDeleteMgr.SetWhereCondition(j => j.Function(dateAdd) < j.Function(daMgr.GetDbTimeAs(EnumDateTimeLocale.UTC, null))); return(daMgr.BuildDeleteDbCommand(dmlDeleteMgr)); }
/// <summary> /// Builds the DbCommand to get a list of task processing queue records /// sorted by taskId. /// </summary> /// <param name="daMgr">DataAccessMgr object</param> /// <returns>DbCommand Object with DbNull Parameter values</returns> static DbCommand BuildCmdGetTPQListByTaskId(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.AddOrderByColumnAscending(Constants.TaskId); return(daMgr.BuildSelectDbCommand(dmlSelectMgr, null)); }
/// <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)); }
static DbCommand BuildCmdGetAccessControlRulesList(DataAccessMgr daMgr) { DbTableDmlMgr dmlSelectMgr = daMgr.DbCatalogGetTableDmlMgr(DataAccess.Constants.SCHEMA_CORE , Constants.AccessControlGroups); string joinTable = dmlSelectMgr.AddJoin(DataAccess.Constants.SCHEMA_CORE , Constants.AccessControlGroupRules , DbTableJoinType.Inner , j => j.Column(Constants.AccessControlGroupCode) == dmlSelectMgr.Column(Constants.AccessControlGroupCode) , Constants.UIControlCode , Constants.AccessDenied); dmlSelectMgr.SetWhereCondition(j => j.Column(Constants.AccessControlGroupCode) == j.Parameter(Constants.AccessControlGroups, Constants.AccessControlGroupCode , daMgr.BuildParamName(Constants.AccessControlGroupCode))); return(daMgr.BuildSelectDbCommand(dmlSelectMgr, null)); }