protected virtual List <T> OnGetItems()
        {
            if (!Utils.AuthHelper.CheckAuthentication())
            {
                return(null);
            }

            string         address = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.BaseUri.LocalPath;
            ISearchManager sm      = new Feng.NH.SearchManager <S>();//ServiceHelper.GetSearchManagerFromAddress(address);

            if (sm == null)
            {
                return(null);
            }
            NameValueCollection nvc = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters;
            var         smParams    = Utils.WebHelper.GetSearchManagerParameters(sm, nvc);
            IEnumerable list        = sm.GetData(smParams.Item1, smParams.Item2);

            List <T> items = new List <T>();

            foreach (var i in list)
            {
                var item = Feng.Net.Utils.TypeHelper.ConvertTypeFromRealToWS <T>(i);
                items.Add(item);
            }

            //WindowTabInfo tabInfo = ADInfoBll.Instance.GetWindowTabInfo(ServiceHelper.GetWindowTabNameFromAddress(address));
            //using (GridDataConvert dp = new GridDataConvert())
            //{
            //    IList<Dictionary<string, object>> r = dp.Process(list, tabInfo.GridName);

            //    foreach (Dictionary<string, object> i in r)
            //    {
            //        T item = Feng.Utils.ReflectionHelper.CreateInstanceFromType(typeof(T)) as T;
            //        foreach (KeyValuePair<string, object> kvp in i)
            //        {
            //            EntityScript.SetPropertyValue(item, kvp.Key, kvp.Value);
            //        }
            //        items.Add(item);
            //    }
            //}

            return(items);
        }
        protected virtual int OnGetItemCount()
        {
            if (!Utils.AuthHelper.CheckAuthentication())
            {
                return(0);
            }

            string         address = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.BaseUri.LocalPath;
            ISearchManager sm      = new Feng.NH.SearchManager <S>();// ServiceHelper.GetSearchManagerFromAddress(address);

            if (sm == null)
            {
                return(0);
            }

            ISearchExpression   exp = null;
            NameValueCollection nvc = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters;

            if (!string.IsNullOrEmpty(nvc["exp"]))
            {
                exp = SearchExpression.Parse(System.Web.HttpUtility.UrlDecode(nvc["exp"]));
            }
            return(sm.GetCount(exp));
        }