public int RecordGet(IDatabaseProvider Provider, decimal UserKey, decimal MetaobjectKey)
        {
            CMetaobjectSecurityRecord R = new CMetaobjectSecurityRecord();

            Hashtable Params = new Hashtable();
            Params.Add(CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY, UserKey);
            Params.Add(CDBConst.CONST_TABLE_FIELD_METAOBJSEC_METAOBJECT_KEY, MetaobjectKey);

            var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_RIGHTS + " FROM " + CDBConst.CONST_TABLE_METAOBJECT_SECURITY;
            SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY + "= @p" + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY;
            SQL += " AND " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_METAOBJECT_KEY + "= @p" + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_METAOBJECT_KEY;

            var T = Provider.QueryGetData(SQL, false, Params);
            if (T == null || T.Rows.Count == 0)
                return CErrors.ERR_DB_GET_OBJECT;

            this.MetaobjectKey = MetaobjectKey;
            this.UserKey = UserKey;
            this.Rights = T.Rows[0][0].PostProcessDatabaseValue<int>(-3);

            return CErrors.ERR_SUC;

        }
        public static List<CMetaobjectSecurityRecord> sGetRecordsByUser(decimal UserKey, IDatabaseProvider Provider)
        {
            List<CMetaobjectSecurityRecord> R = new List<CMetaobjectSecurityRecord>();

            Hashtable Params = new Hashtable();
            Params.Add(CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY, UserKey);

            var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_METAOBJECT_KEY + ", " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY + ", " + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_RIGHTS;
            SQL += " FROM " + CDBConst.CONST_TABLE_METAOBJECT_SECURITY + " WHERE ";
            SQL += CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_METAOBJSEC_USER_KEY;

            var T = Provider.QueryGetData(SQL, false, Params);
            if (T != null)
                for (int i = 0; i < T.Rows.Count; i++)
                {
                    var Record = new CMetaobjectSecurityRecord();
                    Record.MetaobjectKey = T.Rows[i][0].PostProcessDatabaseValue<decimal>();
                    Record.UserKey = T.Rows[i][1].PostProcessDatabaseValue<decimal>();
                    Record.Rights = T.Rows[i][2].PostProcessDatabaseValue<int>();
                    R.Add(Record);
                }

            return R;
        }