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


C# QueryInfo类代码示例

本文整理汇总了C#中QueryInfo的典型用法代码示例。如果您正苦于以下问题:C# QueryInfo类的具体用法?C# QueryInfo怎么用?C# QueryInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ExecuteQuerySimple

		/// <summary>
		/// The execute query simple.
		/// </summary>
		/// <param name="query">The query.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <param name="version">The version.</param>
		/// <param name="progress">The progress.</param>
		/// <param name="groups">The groups.</param>
		/// <returns>
		/// The <see cref="QueryInstanceResultInfo" />.
		/// </returns>
		public QueryInstanceResultInfo ExecuteQuerySimple(
			QueryInfo                query,
			QueryExecutionParams     parameters,
			InstanceVersion          version,
			ProgressItem             progress,
			params GroupDefinition[] groups
		)
		{
			// Log.InfoFormat("73:query:'{0}'",
			// 	query
			// );

			QueryInstanceResultInfo result = new QueryInstanceResultInfo(this.Instance);
			QueryItemInfo queryItem        = query.Items.GetQueryItemForVersion(version);

			this.PrepareProgress(progress, groups);

			this.ExecuteQuery(
				query,
				parameters,
				progress,
				groups,
				result,
				queryItem
			);

			return result;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:39,代码来源:BaseQueryExecutor.cs

示例2: GetStatementTest

        public void GetStatementTest()
        {
            var inf = new QueryInfo();
            var input1 = "select * from A";
            (inf.AsDynamic().GetStatement(input1) as string[]).IsStructuralEqual(new[] { "select * from A" });

            var input2 = "select * from A;";
            (inf.AsDynamic().GetStatement(input2) as string[]).IsStructuralEqual(new[] { "select * from A" });

            var input3 = "select * from A; select * from B";
            (inf.AsDynamic().GetStatement(input3) as string[]).IsStructuralEqual(new[] { "select * from A", "select * from B" });

            var input4 = @"" + Environment.NewLine +
                      @" create trigger set_foo_primary for foo" + Environment.NewLine +
                      @"before insert" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"as begin" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"new.a = gen_id(gen_foo, 1);" + Environment.NewLine +
                      @"end" + Environment.NewLine +
                      @";" + Environment.NewLine +
                      @"  select* from A;" + Environment.NewLine +
                      @" create table V(a integer, b nvarchar(5))";
            (inf.AsDynamic().GetStatement(input4) as string[]).IsStructuralEqual(new[] {
                  @"create trigger set_foo_primary for foo" + Environment.NewLine +
                      @"before insert" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"as begin" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"new.a = gen_id(gen_foo, 1);" + Environment.NewLine +
                      @"end" ,
                "select* from A", "create table V(a integer, b nvarchar(5))" });
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:33,代码来源:QueryInfoTests.cs

示例3: Load

        /// <summary>
        /// Load the artist search.
        /// </summary>
        public override void Load(XmlDocument doc, QueryInfo query)
        {
            last_query = query;

            foreach (Widget widget in album_box.Children)
                album_box.Remove (widget);

            XmlNodeList list = doc.GetElementsByTagName ("getArtistResponse");
            if (list.Count == 0)
                return;

            string artist = null;
            XmlNodeList albums_node = null;

            //look for artist name
            foreach (XmlNode node in list[0].ChildNodes)
            {
                if (node.Name == "artist")
                {
                    artist = node.InnerText;
                    search_title.Markup = "<b><big><big>" + Utils.ParseMarkup (artist) + "</big></big></b>\n";
                }
                else if (node.Name == "albums")
                    albums_node = node.ChildNodes;
            }

            if (albums_node == null || albums_node.Count == 0)
                return;

            string name = null;
            string year = null;

            album_box.PackStart (new HSeparator (), false, false, 2);

            foreach (XmlNode node in albums_node)
            {
                switch (node.Name)
                {
                    case "album":
                        name = node.InnerText;
                        break;

                    case "year":
                        if (node.InnerText != "0")
                            year = node.InnerText;
                        break;

                    case "songs":
                        Album album = new Album (artist, name, year, node.ChildNodes);

                        album_box.PackStart (new AlbumBox (album, main), false ,false, 0);
                        album_box.PackStart (new HSeparator (), false, false, 2);

                        name = null;
                        year = null;
                        break;
                }
            }
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:62,代码来源:SearchArtist.cs

示例4: GetModel

 public static Word GetModel(QueryInfo queryInfo)
 {
     List<Word> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:WordsBase.gen.cs

示例5: GetModel

 public static SmallClass GetModel(QueryInfo queryInfo)
 {
     List<SmallClass> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:SmallClasssBase.gen.cs

示例6: GetModel

 public static ItemInCustomSmallType GetModel(QueryInfo queryInfo)
 {
     List<ItemInCustomSmallType> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:ItemInCustomSmallTypesBase.gen.cs

示例7: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Username))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/user/{0}/topartists.xml";
            return ParseQuery (url, query.Username);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:TopArtists.cs

示例8: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist, QueryField.Title))
                return null;

            string url = "http://lyricwiki.org/api.php?artist={0}&song={1}&fmt=xml";
            return ParseQuery (url, query.Artist, query.Title);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:SongLyrics.cs

示例9: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist, QueryField.Album))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/album/{0}/{1}/info.xml";
            return ParseQuery (url, query.Artist, query.Album);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:AlbumDetails.cs

示例10: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/artist/{0}/toptracks.xml";
            return ParseQuery (url, query.Artist);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:TopTracks.cs

示例11: GetModel

 public static CustomBigType GetModel(QueryInfo queryInfo)
 {
     List<CustomBigType> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:CustomBigTypesBase.gen.cs

示例12: GetQueryForGroups

        /// <inheritdoc />
        protected override QueryItemInfo GetQueryForGroups(QueryInfo query, InstanceVersion version)
        {
            if (query.GroupSelect != null && query.GroupSelect.Count > 0)
            {
                return query.GroupSelect.GetQueryItemForVersion(version);
            }

            return query.DatabaseSelect.GetQueryItemForVersion(version);
        }
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:10,代码来源:DatabaseGroupsResolver.cs

示例13: GetGroups

		/// <summary>
		/// The get groups.
		/// </summary>
		/// <param name="query">
		/// The query information.
		/// </param>
		/// <param name="parameterValues">
		/// The parameter values.
		/// </param>
		/// <param name="version">
		/// The version.
		/// </param>
		/// <returns>
		/// The <see cref="Dictionary{TKey,TValue}"/>.
		/// </returns>
		public virtual ICollection<GroupDefinition> GetGroups(
			QueryInfo                   query,
			IEnumerable<ParameterValue> parameterValues,
			InstanceVersion             version
		)
		{
			var groups = new List<GroupDefinition>();

			// TODO: Create GroupDefinition with childrens
			QueryItemInfo selectGroupsSql = this.GetQueryForGroups(query, version);

			if (selectGroupsSql != null)
			{
				try
				{
					var paramsArray = parameterValues as ParameterValue[] ?? parameterValues.ToArray();

					DataTable[] groupsTabels = this.ExecuteSqlFunction(
						this.Instance,
						selectGroupsSql,
						null,
						query.Parameters,
						paramsArray,
						null,
						true
					);

					foreach (DataTable groupTable in groupsTabels)
					{
						this.AddGroupsFromTable(groupTable, groups);
					}

					if (selectGroupsSql.ChildGroups.IsNullOrEmpty())
					{
						return groups;
					}

					foreach (GroupDefinition groupDefinition in groups)
					{
						this.GetChildGroupsDefinitions(selectGroupsSql, groupDefinition, paramsArray, version);
					}
				}
				catch (OperationCanceledException ex)
				{
					log.Error(ex);
					throw;
				}
				catch (Exception ex)
				{
					log.Error("instance=" + this.Instance.Name + " query=" + query, ex);
				}
			}

			return groups;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:70,代码来源:BaseGroupResolver.cs

示例14: ExecuteQueryTest

        public void ExecuteQueryTest()
        {
            SetupTestDbFb2();
            var inf = new QueryInfo();
            inf.ExecuteQuery(GetFb2ConnectionString(), "select * from test").ToList()[0].View.Rows.Count.Is(0);

            var result = inf.ExecuteQuery(GetFb2ConnectionString(), "insert into test(int_test, char_test) values (1, 'aaaaaaaaaa');update test set varchar_test = 'testtesttesttest' where int_test = 1;select * from test").ToList();
            result[0].View.Rows[0].Is(x => ((string)x[0]).Contains("実行しました。"));
            result[1].View.Rows[0].Is(x => ((string)x[0]).Contains("更新しました。"));
            result[2].View.Rows.Count.Is(1);
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:11,代码来源:ConnectionTestFb2.cs

示例15: ExecuteQueryTestFb3

        public void ExecuteQueryTestFb3()
        {
            SetupTestDbFb3();
            var inf = new QueryInfo();
            var conStr = GetFb3ConnectionString();
            inf.ExecuteQuery(conStr, "select * from test").ToList()[0].View.Rows.Count.Is(0);

            var result = inf.ExecuteQuery(conStr, "insert into test values (1, 123456789000, null, '12asd', '2016-07-24', 50000, 2.5, 2.5555, 4500, 10, '10:00:00', current_timestamp, 'asdfghjk', true);update test set varchar_test = 'testtesttesttest' where int_test = 1;select * from test").ToList();
            result[0].View.Rows[0].Is(x => ((string)x[0]).Contains("実行しました。"));
            result[1].View.Rows[0].Is(x => ((string)x[0]).Contains("更新しました。"));
            result[2].View.Rows.Count.Is(1);
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:12,代码来源:ConnectionTestFb3.cs


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