当前位置: 首页>>代码示例>>C#>>正文


C# QueryBuilder.ColumnPos方法代码示例

本文整理汇总了C#中QueryBuilder.ColumnPos方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.ColumnPos方法的具体用法?C# QueryBuilder.ColumnPos怎么用?C# QueryBuilder.ColumnPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueryBuilder的用法示例。


在下文中一共展示了QueryBuilder.ColumnPos方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:48,代码来源:RangePriceGroup.cs

示例2: 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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:51,代码来源:Usage.cs

示例3: 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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:29,代码来源:RangePriceGroup.cs

示例4: 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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:46,代码来源:CountryCode.cs

示例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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:28,代码来源:CountryCode.cs

示例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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:48,代码来源:RangePrice.cs

示例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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:41,代码来源:Subscription.cs

示例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;
        }
开发者ID:sundowndk,项目名称:CDRLib,代码行数:36,代码来源:SIPAccount.cs


注:本文中的QueryBuilder.ColumnPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。