本文整理汇总了C#中IDatabaseProvider.QueryGetData方法的典型用法代码示例。如果您正苦于以下问题:C# IDatabaseProvider.QueryGetData方法的具体用法?C# IDatabaseProvider.QueryGetData怎么用?C# IDatabaseProvider.QueryGetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDatabaseProvider
的用法示例。
在下文中一共展示了IDatabaseProvider.QueryGetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sGetAmountsByOrder
public static List<CMenuServiceOrderAmount> sGetAmountsByOrder(decimal Key, IDatabaseProvider Provider)
{
List<CMenuServiceOrderAmount> R = new List<CMenuServiceOrderAmount>();
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_ORDER_KEY, Key);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_ORDER_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_AMOUNT_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_AMOUNT;
SQL += " FROM " + CDBConst.CONST_TABLE_ORDERS_AMOUNTS;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_ORDER_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_ORDERS_AMOUNTS_ORDER_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return R;
for (int i = 0; i < T.Rows.Count; i++)
{
var Amount = new CMenuServiceOrderAmount();
Amount.OrderKey = T.Rows[i][0].PostProcessDatabaseValue<decimal>();
Amount.AmountKey = T.Rows[i][1].PostProcessDatabaseValue<decimal>();
Amount.Amount = T.Rows[i][2].PostProcessDatabaseValue<int>();
R.Add(Amount);
}
return R;
}
示例2: SessionGetByKey
public int SessionGetByKey(decimal Key, IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_SESSION_KEY, Key);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_SESSION_USER + ", " + CDBConst.CONST_TABLE_FIELD_SESSION_DEADLINE;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_SESSION_KEY + ", " + CDBConst.CONST_TABLE_FIELD_SESSION_ID + ", " + CDBConst.CONST_TABLE_FIELD_SESSION_STATUS + ", " + CDBConst.CONST_TABLE_FIELD_SESSION_VARIABLES;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_SESSION_TYPE;
SQL += " FROM " + CDBConst.CONST_TABLE_SESSION;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_SESSION_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_SESSION_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return CErrors.ERR_DB_GET_OBJECT;
this._userKey = T.Rows[0][0].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._deadLine = T.Rows[0][2].PostProcessDatabaseValue<DateTime>(DateTime.Now);
this._key = T.Rows[0][3].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._id = Guid.Parse(T.Rows[0][4].PostProcessDatabaseValue<string>(""));
this._status = T.Rows[0][5].PostProcessDatabaseValue<EnSessionStatus>(EnSessionStatus.EEnabled);
this._type = T.Rows[0][7].PostProcessDatabaseValue<EnSessionType>(EnSessionType.EWeb);
byte[] Data = T.Rows[0][6].PostProcessDatabaseValue<byte[]>(new byte[0]);
this._variables = Data.ToDataStream().DeserializeBinaryStream<Hashtable>();
return CErrors.ERR_SUC;
}
示例3: LinkGet
public int LinkGet(IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_KEY, this._sourceObjectKey);
Params.Add(CDBConst.CONST_TABLE_FIELD_LINK_OBJ_KEY, this._linkedObjectKey);
string SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_LINK_OBJ_KEY;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_LINK_OBJ_VALUE;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_LINK_OBJ_TYPE;
SQL += " FROM " + CDBConst.CONST_TABLE_OBJECTS_LINKS + " WHERE ";
SQL += CDBConst.CONST_TABLE_FIELD_LINK_OBJ_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_LINK_OBJ_KEY + " AND ";
SQL += CDBConst.CONST_TABLE_FIELD_OBJ_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return CErrors.ERR_DB_GET_OBJECT;
this._sourceObjectKey = T.Rows[0][0].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._linkedObjectKey = T.Rows[0][1].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._linkValue = T.Rows[0][2].PostProcessDatabaseValue<int>(-1);
this._linkType = T.Rows[0][3].PostProcessDatabaseValue<EnMetaobjectLinkType>();
return CErrors.ERR_SUC;
}
示例4: sGetVersionKey
public static decimal sGetVersionKey(IDatabaseProvider Provider)
{
decimal Key = -1;
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_SEQUENCE_VALUE, "1");
string SQL = "begin INSERT INTO " + CDBConst.CONST_TABLE_SEQUENCE_VERSIONS + " (" + CDBConst.CONST_TABLE_FIELD_SEQUENCE_VALUE + ") VALUES (@p" + CDBConst.CONST_TABLE_FIELD_SEQUENCE_VALUE + "); SELECT MAX(" + CDBConst.CONST_TABLE_FIELD_SEQUENCE_ID + ") FROM " + CDBConst.CONST_TABLE_SEQUENCE_VERSIONS + "; end;";
DataTable T = Provider.QueryGetData(SQL, true, Params);
Key = (T != null ? (decimal)T.Rows[0][0] : -1);
return Key;
}
示例5: LanguageGet
public int LanguageGet(IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_LANGUAGES_CODE, this._languageCode);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_LANGUAGES_CODE + ", " + CDBConst.CONST_TABLE_FIELD_LANGUAGES_NAME;
SQL += " FROM " + CDBConst.CONST_TABLE_LANGUAGES;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_LANGUAGES_CODE + " = @p" + CDBConst.CONST_TABLE_FIELD_LANGUAGES_CODE;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return CErrors.ERR_DB_GET_OBJECT;
this._languageName = T.Rows[0][1].PostProcessDatabaseValue<string>();
return CErrors.ERR_SUC;
}
示例6: OrderGetByKey
public int OrderGetByKey(IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_ORDERS_KEY, this._key);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_ORDERS_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_ID + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_SESSION_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT;
SQL += ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_DEADLINE;
SQL += " FROM " + CDBConst.CONST_TABLE_ORDERS;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_ORDERS_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_ORDERS_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return CErrors.ERR_DB_GET_OBJECT;
this._key = T.Rows[0][0].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._id = Guid.Parse(T.Rows[0][1].PostProcessDatabaseValue<string>(""));
this._sessionKey = T.Rows[0][2].PostProcessDatabaseValue<decimal>(CDBConst.CONST_OBJECT_EMPTY_KEY);
this._date = T.Rows[0][3].PostProcessDatabaseValue<DateTime>(DateTime.Now);
this._deadline = T.Rows[0][4].PostProcessDatabaseValue<DateTime>(DateTime.Now);
this._amounts = CMenuServiceOrderAmount.sGetAmountsByOrder(this._key, Provider);
return CErrors.ERR_SUC;
}
示例7: RecordGet
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;
}
示例8: sGetValuesByObject
public static List<CMetaobjectAttributeValue> sGetValuesByObject(decimal ObjectKey, IDatabaseProvider Provider)
{
List<CMetaobjectAttributeValue> R = new List<CMetaobjectAttributeValue>();
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_KEY, ObjectKey);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_LOCALE + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_VALUE;
SQL += " FROM " + CDBConst.CONST_TABLE_OBJECTS_ATTR;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_KEY;
SQL += " ORDER BY " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return R;
string PreviousID = "";
string CurrentID = "";
CMetaobjectAttributeValue Value = null;
for (int i = 0; i < T.Rows.Count; i++)
{
CurrentID = T.Rows[i][1].PostProcessDatabaseValue<string>("");
if (PreviousID != CurrentID)
{
if (Value != null)
R.Add(Value);
Value = new CMetaobjectAttributeValue(Provider);
Value.ObjectKey = T.Rows[i][0].PostProcessDatabaseValue<decimal>(-1);
Value.AttributeID = T.Rows[i][1].PostProcessDatabaseValue<string>("");
}
byte[] Data = T.Rows[i][3].PostProcessDatabaseValue<byte[]>(new byte[0]);
var Stream = Data.ToDataStream();
var Obj = Stream.DeserializeBinaryStream<object>();
Value.Values.Add(T.Rows[i][2].PostProcessDatabaseValue<int>(-1), Obj);
PreviousID = CurrentID;
}
return R;
}
示例9: sGetValue
public static CMetaobjectAttributeValue sGetValue(decimal ObjectKey, string AttributeID, IDatabaseProvider Provider)
{
CMetaobjectAttributeValue R = null;
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_KEY, ObjectKey);
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID, AttributeID);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_LOCALE + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_VALUE;
SQL += " FROM " + CDBConst.CONST_TABLE_OBJECTS_ATTR;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_KEY;
SQL += " AND " + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_ATTR_ID;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null || T.Rows.Count == 0)
return null;
R = new CMetaobjectAttributeValue(Provider);
R.ObjectKey = T.Rows[0][0].PostProcessDatabaseValue<decimal>(-1);
R.AttributeID = T.Rows[0][1].PostProcessDatabaseValue<string>("");
for (int i = 0; i < T.Rows.Count; i++)
{
byte[] Data = T.Rows[i][3].PostProcessDatabaseValue<byte[]>(new byte[0]);
var Stream = Data.ToDataStream();
var Obj = Stream.DeserializeBinaryStream<object>();
if (R.Values.ContainsKey(T.Rows[i][2].PostProcessDatabaseValue<int>(-1)))
continue;
R.Values.Add(T.Rows[i][2].PostProcessDatabaseValue<int>(-1), Obj);
}
return R;
}
示例10: sGetAllPolicies
public List<CSystemPolicy> sGetAllPolicies(IDatabaseProvider Provider)
{
List<CSystemPolicy> R = new List<CSystemPolicy>();
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_CLASS, EnMetaobjectClass.ESystemUser);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ID + ", ";
SQL += CDBConst.CONST_TABLE_FIELD_OBJ_PARENT + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_SYSTEM + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_MOD + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_STATUS;
SQL += " FROM " + CDBConst.CONST_TABLE_OBJECTS + " WHERE " + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null)
return R;
for (int i = 0; i < T.Rows.Count; i++)
{
var Policy = new CSystemPolicy(Provider);
Policy.Key = T.Rows[i][0].PostProcessDatabaseValue<decimal>();
Policy.ID = Guid.Parse(T.Rows[i][1].PostProcessDatabaseValue<string>());
Policy.Parent = T.Rows[i][2].PostProcessDatabaseValue<decimal>();
Policy.Class = T.Rows[i][3].PostProcessDatabaseValue<EnMetaobjectClass>();
Policy.System = ((T.Rows[i][4]).PostProcessDatabaseValue<int>() == 1);
Policy.ModificatonDate = T.Rows[0][5].PostProcessDatabaseValue<DateTime>();
Policy.Status = T.Rows[0][6].PostProcessDatabaseValue<EnMetaobjectStatus>();
Policy.Attributes.ObjectKey = Policy.Key;
R.Add(Policy);
}
return R;
}
示例11: sGetOrdersByDates
public static List<CMenuServiceOrder> sGetOrdersByDates(DateTime StartDate, DateTime EndDate, IDatabaseProvider Provider)
{
List<CMenuServiceOrder> R = new List<CMenuServiceOrder>();
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_ORDERS_DT + "_START", StartDate);
Params.Add(CDBConst.CONST_TABLE_FIELD_ORDERS_DT + "_END", EndDate);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_ORDERS_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_ID + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_SESSION_KEY + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT + ", " + CDBConst.CONST_TABLE_FIELD_ORDERS_DEADLINE;
SQL += " FROM " + CDBConst.CONST_TABLE_ORDERS;
SQL += " WHERE " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT + " >= " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT + "_START";
SQL += " AND " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT + " <= " + CDBConst.CONST_TABLE_FIELD_ORDERS_DT + "_END";
var T = Provider.QueryGetData(SQL, false, null);
for (int i = 0; i < T.Rows.Count; i++)
{
var Order = new CMenuServiceOrder();
Order.Key = T.Rows[i][0].PostProcessDatabaseValue<decimal>();
Order.ID = Guid.Parse(T.Rows[i][1].PostProcessDatabaseValue<string>());
Order.SessionKey = T.Rows[i][2].PostProcessDatabaseValue<decimal>();
Order.Date = T.Rows[i][3].PostProcessDatabaseValue<DateTime>();
Order.Deadline = T.Rows[i][4].PostProcessDatabaseValue<DateTime>();
R.Add(Order);
}
return R;
}
示例12: sElementsChildrenDelete
public static int sElementsChildrenDelete(decimal ElementKey, decimal DictionaryKey, IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT, ElementKey);
Params.Add(CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY, DictionaryKey);
var SQL = "DELETE FROM " + CDBConst.CONST_TABLE_RDS_ELEM_DATA + " WHERE " + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_VERSION + " IN (";
SQL += "SELECT " + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_VERSION + " FROM " + CDBConst.CONST_TABLE_RDS_ELEM + " WHERE ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " AND ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY;
SQL += ")";
var R = Provider.QueryExecute(SQL, false, Params);
if (!R)
return -3;
SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_KEY + " FROM " + CDBConst.CONST_TABLE_RDS_ELEM + " WHERE ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " AND ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null)
return -2;
for (int i = 0; i < T.Rows.Count; i++)
{
var Key = (decimal)T.Rows[i][0];
CRdsElement.sElementsChildrenDelete(Key, DictionaryKey, Provider);
}
SQL = "DELETE FROM " + CDBConst.CONST_TABLE_RDS_ELEM + " WHERE ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_PARENT + " AND ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_DICT_KEY;
R = Provider.QueryExecute(SQL, false, Params);
return (R ? -1 : -4);
}
示例13: ElementExists
public bool ElementExists(IDatabaseProvider Provider)
{
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_RDS_ELEM_VERSION, this._version);
Params.Add(CDBConst.CONST_TABLE_FIELD_RDS_ELEM_KEY, this._key);
var SQL = "SELECT Count(*) FROM " + CDBConst.CONST_TABLE_RDS_ELEM + " WHERE " + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_VERSION + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_VERSION + " AND ";
SQL += CDBConst.CONST_TABLE_FIELD_RDS_ELEM_KEY + " = @p" + CDBConst.CONST_TABLE_FIELD_RDS_ELEM_KEY;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null)
return false;
var RecordsCount = (int)T.Rows[0][0];
return (RecordsCount > 0);
}
示例14: sGetRecordsByUser
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;
}
示例15: sGetAllGroups
public static List<CSystemUserGroup> sGetAllGroups(IDatabaseProvider Provider)
{
List<CSystemUserGroup> R = new List<CSystemUserGroup>();
Hashtable Params = new Hashtable();
Params.Add(CDBConst.CONST_TABLE_FIELD_OBJ_CLASS, EnMetaobjectClass.ESystemUserGroup);
var SQL = "SELECT " + CDBConst.CONST_TABLE_FIELD_OBJ_KEY + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_ID + ", ";
SQL += CDBConst.CONST_TABLE_FIELD_OBJ_PARENT + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_SYSTEM + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_MOD + ", " + CDBConst.CONST_TABLE_FIELD_OBJ_STATUS;
SQL += " FROM " + CDBConst.CONST_TABLE_OBJECTS + " WHERE " + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS + " = @p" + CDBConst.CONST_TABLE_FIELD_OBJ_CLASS;
var T = Provider.QueryGetData(SQL, false, Params);
if (T == null)
return R;
for (int i = 0; i < T.Rows.Count; i++)
{
var Group = new CSystemUserGroup(Provider);
Group.Key = T.Rows[i][0].PostProcessDatabaseValue<decimal>();
Group.ID = Guid.Parse(T.Rows[i][1].PostProcessDatabaseValue<string>());
Group.Parent = T.Rows[i][2].PostProcessDatabaseValue<decimal>();
Group.Class = (EnMetaobjectClass)T.Rows[i][3].PostProcessDatabaseValue<int>();
Group.System = (T.Rows[i][4].PostProcessDatabaseValue<int>() == 1);
Group.ModificatonDate = T.Rows[0][5].PostProcessDatabaseValue<DateTime>();
Group.Status = (EnMetaobjectStatus)T.Rows[0][6].PostProcessDatabaseValue<int>();
Group.ExternalLinks = CMetaobjectLink.sGetExternalLinks(Group.Key, Provider);
Group.InternalLinks = CMetaobjectLink.sGetInternalLinks(Group.Key, Provider);
Group.Attributes.ObjectKey = Group.Key;
R.Add(Group);
}
return R;
}