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


C# QueryBuilder.getSourceList方法代码示例

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


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

示例1: selectQueryHandler


//.........这里部分代码省略.........
                string tableAlias = ""; string tablename = "";
                string[] fieldList;
                switch (comString)
                {
                    case "select":
                        string[] fieldnames = paramString.Split(',');
                        string realname = "";
                        string agg;
                        ABSTRACTAGGREGATE aggMode = ABSTRACTAGGREGATE.None;
                        foreach (string field in fieldnames)
                        {
                            realname = field;
                            if (field.IndexOf(")") > 0)
                            {
                                realname = field.Substring(field.IndexOf("(") + 1, field.IndexOf(")") - field.IndexOf("(") - 1);
                                realname = realname.Trim();
                                agg = field.Substring(0, field.IndexOf("(") - 1);
                                switch (agg)
                                {
                                    case "count":
                                        aggMode = ABSTRACTAGGREGATE.Count;
                                        break;
                                    case "max":
                                        aggMode = ABSTRACTAGGREGATE.Max;
                                        break;
                                    case "min":
                                        aggMode = ABSTRACTAGGREGATE.Min;
                                        break;
                                }
                            }
                            if (realname.IndexOf(".") > 0)
                                newQuery.addField(new AField(realname.Substring(realname.IndexOf(".") + 1), null, realname.Substring(0, realname.IndexOf("."))));
                            else
                                newQuery.addField(new AField(realname, null, (ATable)((QueryBuilder.SOURCEBINDING)newQuery.getSourceList()[0]).sourceObject));

                            if (realname.IndexOf(".") > 0)
                                newQuery.getField(realname.Substring(realname.IndexOf(".") + 1), realname.Substring(0, realname.IndexOf("."))).function = aggMode;
                            else
                                newQuery.getField(realname).function = aggMode;
                        }

                        break;
                    case "from":

                        if (paramString.IndexOf(' ') != -1) {
                            tableAlias = paramString.Substring(paramString.IndexOf(' ') + 1);
                            tablename = paramString.Substring(0, paramString.IndexOf(' '));
                        }
                        else
                            tablename = paramString.Trim();
                        newQuery.addSource(new ATable(tablename, tableAlias));
                        break;
                    case "inner join":
                        System.Collections.ArrayList joinList = new System.Collections.ArrayList();
                        paramString = "inner join " + paramString;
                        if (paramString.ToLower().IndexOf("inner join", "inner join".Length + 1) >= 2)
                        {
                        while (paramString.Length >= 0)
                        {
                            string tmp2 = paramString;
                            if (paramString.ToLower().IndexOf("inner join", "inner join".Length + 1) >= 2)
                                tmp2 = paramString.ToLower().Substring(0, paramString.ToLower().IndexOf("inner join", "inner join".Length + 2)).Trim();
                            else
                            {
                                joinList.Add(tmp2);
                                break;
开发者ID:andrewjc,项目名称:sqlconsole,代码行数:67,代码来源:ProviderQueryConverters.cs


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