コード例 #1
0
        public void TestSearchReferences()
        {
            int id = Create();

            Console.WriteLine("Reference: {0}", id);
            TransitReferenceQueryOptions options = new TransitReferenceQueryOptions();

            options.SearchQuery = mReference.Word;
            int count = Blog.SearchReferencesCount(Ticket, options);

            Console.WriteLine("Count: {0}", count);
            Assert.IsTrue(count > 0, "Invalid count, no references returned.");
            TransitReference[] refs = Blog.SearchReferences(Ticket, options);
            Assert.IsNotNull(refs, "Invalid references returned.");
            Assert.AreEqual(refs.Length, count);
            Delete();
        }
コード例 #2
0
    void grid_OnGetDataSource(object sender, EventArgs e)
    {
        TransitReferenceQueryOptions options = new TransitReferenceQueryOptions(inputSearch.Text, grid.PageSize, grid.CurrentPageIndex);

        options.SortExpression = "Id";
        options.SortDirection  = WebServiceQuerySortDirection.Descending;
        if (!string.IsNullOrEmpty(inputSearch.Text))
        {
            grid.DataSource = SessionManager.GetCachedCollection <TransitReference>(
                "SearchReferences", SessionManager.Ticket, options);
        }
        else
        {
            grid.DataSource = SessionManager.GetCachedCollection <TransitReference>(
                "GetReferences", SessionManager.Ticket, options);
        }
    }