本文整理汇总了C#中QueryBuilder.Columns方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.Columns方法的具体用法?C# QueryBuilder.Columns怎么用?C# QueryBuilder.Columns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.Columns方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: List
public static List<RangePriceGroup> List(Range Range)
{
List<RangePriceGroup> result = new List<RangePriceGroup> ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns ("id");
qb.AddWhere ("rangeid", "=", Range.Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
while (query.NextRow ())
{
try
{
result.Add (Load (query.GetGuid (qb.ColumnPos ("id"))));
}
catch
{}
}
}
query.Dispose ();
query = null;
qb = null;
return result;
}
示例2: Load
public static RangePriceGroup Load(Guid Id)
{
bool success = false;
RangePriceGroup result = new RangePriceGroup ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns (
"id",
"createtimestamp",
"updatetimestamp",
"validfromtimestamp",
"validtotimestamp",
"name",
"rangepriceids"
);
qb.AddWhere ("id", "=", Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
if (query.NextRow ())
{
result._id = query.GetGuid (qb.ColumnPos ("id"));
result._createtimestamp = query.GetInt (qb.ColumnPos ("createtimestamp"));
result._updatetimestamp = query.GetInt (qb.ColumnPos ("updatetimestamp"));
result._validfromtimestamp = query.GetInt (qb.ColumnPos ("validfromtimestamp"));
result._validtotimestamp = query.GetInt (qb.ColumnPos ("validtotimestamp"));
result._name = query.GetString (qb.ColumnPos ("name"));
result._rangepriceidsasstring = query.GetString (qb.ColumnPos ("rangepricegroupids"));
success = true;
}
}
query.Dispose ();
query = null;
qb = null;
if (!success)
{
throw new Exception (string.Format (Strings.Exception.RangePriceGroupLoad, Id));
}
return result;
}
示例3: Load
public static CountryCode Load(Guid Id)
{
bool success = false;
CountryCode result = new CountryCode ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns (
"id",
"createtimestamp",
"updatetimestamp",
"name",
"alternativnames",
"dialcodes"
);
qb.AddWhere ("id", "=", Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
if (query.NextRow ())
{
result._id = query.GetGuid (qb.ColumnPos ("id"));
result._createtimestamp = query.GetInt (qb.ColumnPos ("createtimestamp"));
result._updatetimestamp = query.GetInt (qb.ColumnPos ("updatetimestamp"));
result._name = query.GetString (qb.ColumnPos ("name"));
result._alternativnamesasstring = query.GetString (qb.ColumnPos ("alternativnames"));
result._dialcodesasstring = query.GetString (qb.ColumnPos ("dialcodes"));
success = true;
}
}
query.Dispose ();
query = null;
qb = null;
if (!success)
{
throw new Exception (string.Format (Strings.Exception.CountryCodeLoad, Id));
}
return result;
}
示例4: Load
public static Usage Load(Guid Id)
{
bool success = false;
Usage result = new Usage ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns (
"id",
"createtimestamp",
"updatetimestamp",
"subscriptionid",
"begintimestamp",
"duration",
"anumber",
"bnumber",
"direction"
);
qb.AddWhere ("id", "=", Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
if (query.NextRow ())
{
result._id = query.GetGuid (qb.ColumnPos ("id"));
result._createtimestamp = query.GetInt (qb.ColumnPos ("createtimestamp"));
result._updatetimestamp = query.GetInt (qb.ColumnPos ("updatetimestamp"));
result._subscriptionid = query.GetGuid (qb.ColumnPos ("subscriptionid"));
result._begintimestamp = query.GetInt (qb.ColumnPos ("begintimestamp"));
result._duration = query.GetInt (qb.ColumnPos ("duration"));
result._anumber = query.GetString (qb.ColumnPos ("anumber"));
result._bnumber = query.GetString (qb.ColumnPos ("anumber"));
result._direction = query.GetEnum<Enums.UsageDirection> (qb.ColumnPos ("direction"));
success = true;
}
}
query.Dispose ();
query = null;
qb = null;
if (!success)
{
throw new Exception (string.Format (Strings.Exception.UsageLoad, Id));
}
return result;
}
示例5: List
public static List<CountryCode> List()
{
List<CountryCode> result = new List<CountryCode> ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns ("id");
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
while (query.NextRow ())
{
try
{
result.Add (Load (query.GetGuid (qb.ColumnPos ("id"))));
}
catch
{}
}
}
query.Dispose ();
query = null;
qb = null;
return result;
}
示例6: Load
public static RangePrice Load(Guid Id)
{
bool success = false;
RangePrice result = new RangePrice ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns (
"id",
"createtimestamp",
"updatetimestamp",
"price",
"hourspanbegin",
"hourspanend",
"weekdays"
);
qb.AddWhere ("id", "=", Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
if (query.NextRow ())
{
result._id = query.GetGuid (qb.ColumnPos ("id"));
result._createtimestamp = query.GetInt (qb.ColumnPos ("createtimestamp"));
result._updatetimestamp = query.GetInt (qb.ColumnPos ("updatetimestamp"));
result._price = query.GetDecimal (qb.ColumnPos ("price"));
result._hourspanbegin = query.GetString (qb.ColumnPos ("hourspanbegin"));
result._hourspanend = query.GetString (qb.ColumnPos ("hourspanend"));
result._weekdays = query.GetEnum<Enums.Weekday> (qb.ColumnPos ("weekdays"));
success = true;
}
}
query.Dispose ();
query = null;
qb = null;
if (!success)
{
throw new Exception (string.Format (Strings.Exception.RangePriceLoad, Id));
}
return result;
}
示例7: Load
/// <summary>
/// Load a <see cref="CDRLib.Subscription"/> instance from database using a <see cref="System.Guid"/> identifier.
/// </summary>
public static Subscription Load(Guid Id)
{
bool success = false;
Subscription result = new Subscription ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns ("id",
"createtimestamp",
"updatetimestamp");
qb.AddWhere ("id", "=", Id);
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
if (query.NextRow ())
{
result._id = query.GetGuid (qb.ColumnPos ("id"));
result._createtimestamp = query.GetInt (qb.ColumnPos ("createtimestamp"));
result._updatetimestamp = query.GetInt (qb.ColumnPos ("updatetimestamp"));
success = true;
}
}
query.Dispose ();
query = null;
qb = null;
if (!success)
{
throw new Exception (string.Format (Strings.Exception.SubscriptionLoad, Id));
}
return result;
}
示例8: List
/// <summary>
/// Returns a list of all <see cref="CDRLib.SIPAccount"/> instances in the database, belonging to a <see cref="CDRLib.Subscription"/> instance.
/// </summary>
internal static List<SIPAccount> List(Subscription Subscription)
{
List<SIPAccount> result = new List<SIPAccount> ();
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns ("id");
if (Subscription != null)
{
qb.AddWhere ("subscriptionid", "=", Subscription.Id);
}
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
while (query.NextRow ())
{
try
{
result.Add (Load (query.GetGuid (qb.ColumnPos ("id"))));
}
catch
{}
}
}
query.Dispose ();
query = null;
qb = null;
return result;
}
示例9: FindByNumber
public static SIPAccount FindByNumber(string Number)
{
SIPAccount result = null;
QueryBuilder qb = new QueryBuilder (QueryBuilderType.Select);
qb.Table (DatabaseTableName);
qb.Columns ("id");
qb.AddWhere ("numbers", "like", "%"+ Number +";%");
Query query = Runtime.DBConnection.Query (qb.QueryString);
if (query.Success)
{
while (query.NextRow ())
{
try
{
// result = Load (query.GetGuid (qb.ColumnPos ("id")));
}
catch
{}
}
}
query.Dispose ();
query = null;
qb = null;
return result;
}