0

在我正在申请的网络服务方面

     StoreRequestParameters parameters = new StoreRequestParameters(this.Context);
      string  condition= parameters.GridFilters.ToString();
//I ma sending this to the methot "List<Ks> Get(....)"

获取gridfilter参数。

在另一个方法中,试图像这样获取选定的网格过滤器值。

    public List<Ks> Get(int start, int limit, string sort, string terssiralama, string condition, out int totalrow)
    {
         FilterConditions fc = new FilterConditions(condition);


                        foreach (FilterCondition cnd in fc.Conditions)
                        {
                            Comparison comparison = cnd.Comparison;
                            string fi = cnd.Field;
                            FilterType type = cnd.Type;

                            switch (cnd.Type)
                            {
                                case FilterType.Date:
                                    switch (comparison)
                                    {
                                        case Comparison.Eq:
                                            field1 = cnd.Field;
                                            cmp1 = "=";
                                            value1 = cnd.Value<string>();
...........
..........
}

但我没有得到这样的值

 FilterConditions fc = new FilterConditions(condition);

我无法传递字符串值。我应该先序列化还是反序列化?

4

1 回答 1

0
 StoreRequestParameters parameters = new StoreRequestParameters(this.Context);
 instead of using  this, string  condition= parameters.GridFilters.ToString();
 I use this 
 string  obj = this.Context.Request["filter"]; 
 and pass it to the 

FilterConditions fc = new FilterConditions(obj);
It can be reach all filter condition in fc filtercondition variable.
于 2013-09-03T12:16:42.603 回答