コード例 #1
0
ファイル: grpcProxy.cs プロジェクト: SAVeGH/MAKLAK
        public void Search(Maklak.Client.DataSets.FilterItemsDS filterData)
        {
            SearchRequest request = new SearchRequest();

            //Dictionary<string, string> inputData = filterData.SearchInput.ToDictionary(keyField => keyField.InputName, valueField => valueField.InputValue);
            request.SerchInput.AddRange(filterData.Input.Select(r => new SearchRequest.Types.InputData()
            {
                InputType = r.InputName, InputValue = r.InputValue
            }));
            SearchResponse response = client.Search(request);

            filterData.Items.Clear();

            foreach (SearchResponse.Types.OutputData item in response.Items)
            {
                FilterItemsDS.ItemsRow row = filterData.Items.NewItemsRow();

                row.ItemId    = item.ItemId;
                row.ItemValue = item.ItemValue;
                //row.Name = item.Name;

                filterData.Items.AddItemsRow(row);
            }
            //return filterData;
        }
コード例 #2
0
        protected override void OnInitialized()
        {
            base.OnInitialized();

            //SearchList = new List<string>() {"1","2","3" };
            //FilterItemsDS.ItemsRow row = Items.NewItemsRow();
            //row.ItemId = 1;
            //row.ItemValue = "1" + this.ItemsFilterType;
            ////row.Name = this.ItemsFilterType;
            //Items.AddItemsRow(row);

            //row = Items.NewItemsRow();
            //row.ItemId = 2;
            //row.ItemValue = "2" + this.ItemsFilterType;
            ////row.Name = this.ItemsFilterType;
            //Items.AddItemsRow(row);

            FilterItemsDS.ItemsRow row = null;

            for (int i = 0; i < 20; i++)
            {
                row           = Items.NewItemsRow();
                row.ItemId    = 1 + i;
                row.ItemValue = i.ToString() + " " + this.ItemsFilterType;
                //row.Name = this.ItemsFilterType;
                Items.AddItemsRow(row);
            }
        }