Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }