示例#1
0
        private void BindGrid1()
        {
            BusinessFilter filter = this.ucQueryProvider.GetBusinessFilter();

            filter.AddFilter(this.BusinessObjectView.InitialFilter, AndOr.AND);

            this.BusinessObjectView.CurrentFilter = filter;
            this.ucCustomPaging.TotalRecords      = this.BusinessObjectView.LoadData(1, 100000000);


            DataTable dt = this.BusinessObjectView.tblSchema;

            if (dt.Rows.Count != 0)
            {
                for (int i = 0; i < this.BusinessObjectView.tblSchema.Rows.Count; i++)
                {
                    strValues += dt.Rows[i]["PKID"].ToString() + ",";
                    strTexts  += dt.Rows[i][this.BusinessObjectView.DisplayField.FieldName].ToString() + ",";
                }

                if (strValues.IndexOf(",") != -1)
                {
                    strValues = strValues.Substring(0, strValues.Length - 1);
                }
                if (strTexts.IndexOf(",") != -1)
                {
                    strTexts = strTexts.Substring(0, strTexts.Length - 1);
                }
            }
        }
示例#2
0
        /// <summary>
        /// 选出所有城市
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="obType"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public DataTable GetCityList(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("Dictionary");

            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilterItem("Level", SystemManage.Level.City, Operation.Equal, FilterType.NumberType, AndOr.AND);

            flt.AddFilter(filter, AndOr.AND);

            // Add Data Permission
            //			flt.AddFilter(GetAuthorizedCityFilter(GlobalFacade.SystemContext.GetContext().UserID), AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("Dictionary");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#3
0
        private void LoadData(int pageNumber, int pageSize)
        {
            BusinessFilter filter = this.ucQueryProvider.GetBusinessFilter();

            filter.AddFilter(this.BusinessObjectView.InitialFilter, AndOr.AND);

            this.BusinessObjectView.CurrentFilter = filter;
            this.ucCustomPaging.TotalRecords      = this.BusinessObjectView.LoadData(pageNumber, pageSize);
            this.BindGrid();
        }
示例#4
0
        /// <summary>
        /// 获取用户组列表
        /// </summary>
        /// <param name="totalCount">记录总数</param>
        /// <param name="pageSize">页大小(一次取出的记录数)</param>
        /// <param name="pageIndex">页码(1开始)</param>
        /// <param name="obType">排续类型</param>
        /// <param name="subfilter">筛选条件对象</param>
        /// <returns>结果集</returns>
        public DataTable GetRoleList(out int totalCount, int pageSize, int pageIndex,
                                     Common.OrderByType obType, BusinessFilter subfilter)
        {
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("Role");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("Role");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }

            filter.AddFilter(filter, AndOr.AND);
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.DESC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#5
0
        /// <summary>
        /// 导出独生子女统计列表
        /// </summary>
        /// <param name="pageSize">页大小(一次取出的记录数)</param>
        /// <param name="pageIndex">页码(1开始)</param>
        /// <param name="subfilter">筛选条件对象</param>
        /// <returns>结果集</returns>
        public DataTable GetCWOneChildListForExport(int pageSize, int pageIndex, BusinessFilter subfilter)
        {
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("CWOneChild");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("CWOneChild");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            return(boc.GetDataTable());
        }
示例#6
0
        public DataTable GetRegionList(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter subfilter, string Parent)
        {
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("Dictionary");
            BusinessFilter            filter  = new BusinessFilter("Dictionary");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);

            if (Parent == SystemManage.Level.Top)
            {
                BusinessMapping.Dictionary TopParent = new BusinessMapping.Dictionary();
                TopParent.SessionInstance = session;
                BusinessFilter searchparent = new BusinessFilter("Dictionary");
                searchparent.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
                searchparent.AddFilterItem("Type", ((int)SystemManage.DictionaryType.Region).ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
                searchparent.AddFilterItem("Parent", SystemManage.Level.Top, Operation.Equal, FilterType.NumberType, AndOr.AND);
                TopParent.AddFilter(searchparent);
                TopParent.Load();
                if (TopParent.HaveRecord)
                {
                    Parent = TopParent.PKID.Value.ToString();
                }
            }

            if (!(Parent == null || Parent.Equals(string.Empty)))
            {
                filter.AddFilterItem("Parent", Parent.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            }

            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.SessionInstance = session;
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#7
0
        //Qick 获取城市列表 2009-02-06
        public DataTable GetCityListNew(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("DictionaryAD");

            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);

            flt.AddCustomerFilter("(DictionaryAD.Level =1 OR DictionaryAD.Level =0)", AndOr.AND);
            flt.AddFilter(filter, AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("DictionaryAD");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#8
0
        /// <summary>
        /// 获取行政区列表
        /// </summary>
        /// <param name="totalCount">记录总数</param>
        /// <param name="pageSize">页大小(一次取出的记录数)</param>
        /// <param name="pageIndex">页码(1开始)</param>
        /// <param name="obType">排续类型</param>
        /// <param name="subfilter">筛选条件对象</param>
        /// <returns>结果集</returns>
        public DataTable GetDistrictList(out int totalCount, int pageSize, int pageIndex,
                                         Common.OrderByType obType, BusinessFilter subfilter)
        {
            BusinessRule.BaseData.Region rule = new Region();

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("District");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("District");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddCustomerFilter("District.FK_Dictionary IN (" + rule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);

            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#9
0
        /// <summary>
        /// Generate filter according to each query item(along with filter description)
        /// </summary>
        public BusinessFilter GetBusinessFilter(out string filterDescription)
        {
            BusinessFilter queryFilter    = new BusinessFilter(this.BusinessObjectView.BusinessObjectName);
            HtmlTable      queryTable     = this.queryHolder.FindControl("__queryTable") as HtmlTable;
            AndOr          filterJunction = GetFilterJunction(queryTable);
            StringBuilder  queryDesc      = new StringBuilder();

            // queryTable的最后一行是queryType(满足全部、满足任一)
            for (int i = 0; i < queryTable.Rows.Count - 1; i++)
            {
                HtmlTableRow      queryItem = queryTable.FindControl("__queryitem_" + i.ToString()) as HtmlTableRow;
                HtmlInputCheckBox checkbox  = queryTable.FindControl("__checkbox_" + i.ToString()) as HtmlInputCheckBox;

                if (checkbox.Checked)
                {
                    LiteralControl      desc     = queryTable.FindControl("__desc_" + i.ToString()) as LiteralControl;
                    ViewItemDisplayType itemType = (ViewItemDisplayType)int.Parse(queryItem.Attributes["displayType"]);

                    if (itemType == ViewItemDisplayType.CheckBox)
                    {
                        // Filter
                        HtmlInputCheckBox boolCtl = queryTable.FindControl("__bool_" + i.ToString()) as HtmlInputCheckBox;

                        if (queryItem.Attributes["isVirtual"] != "true")
                        {
                            queryFilter.AddFilterItem(queryItem.Attributes["fieldName"],
                                                      Convert.ToInt32(boolCtl.Checked).ToString(), Operation.Equal, FilterType.NumberType, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                        }
                        else
                        {
                            queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + "=" + Convert.ToInt32(boolCtl.Checked).ToString(), queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                        }

                        // Desc
                        queryDesc.AppendFormat("{0}:{1}.", desc.Text, boolCtl.Checked);
                    }
                    else if (itemType == ViewItemDisplayType.Literal)
                    {
                        // Filter
                        HtmlInputText textbox = queryTable.FindControl("__textbox_" + i.ToString()) as HtmlInputText;
                        if (textbox.Value != string.Empty)
                        {
                            GlobalFacade.PageContext pgCtx = GlobalFacade.SystemContext.GetContext().GetPageContext(this.openerId);
                            pgCtx.Parms.Clear();
                            RadioButtonList FuzzyEnquiry = queryTable.FindControl("__Fuzzytxt_" + i.ToString()) as RadioButtonList;
                            if (queryItem.Attributes["isVirtual"] != "true")
                            {
                                if (FuzzyEnquiry != null)
                                {
                                    if (FuzzyEnquiry.SelectedIndex == 0)
                                    {
                                        queryFilter.AddFilterItem(queryItem.Attributes["fieldName"], textbox.Value.Replace("'", "''"), Operation.Like, FilterType.StringType, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                    }
                                    else
                                    {
                                        queryFilter.AddFilterItem(queryItem.Attributes["fieldName"], textbox.Value.Replace("'", "''"), Operation.Equal, FilterType.StringType, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                    }
                                }
                                else
                                {
                                    queryFilter.AddFilterItem(queryItem.Attributes["fieldName"], textbox.Value.Replace("'", "''"), Operation.Like, FilterType.StringType, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                }
                            }
                            else
                            {
                                if (FuzzyEnquiry != null)
                                {
                                    if (FuzzyEnquiry.SelectedIndex == 0)
                                    {
                                        queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " LIKE '%" + textbox.Value.Replace("'", "''") + "%'", queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                    }
                                    else
                                    {
                                        queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " = '" + textbox.Value.Replace("'", "''") + "'", queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                    }
                                }
                                else
                                {
                                    queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " LIKE '%" + textbox.Value.Replace("'", "''") + "%'", queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                                }
                            }

                            //							if(queryItem.Attributes["isVirtual"] != "true")
                            //								queryFilter.AddFilterItem(queryItem.Attributes["fieldName"],
                            //									textbox.Value.Replace("'", "''"), Operation.Like, FilterType.StringType, filterJunction);	// 2007-4-5, Tony, 将单引号替换成两个单引号,避免查询时报错
                            //							else
                            //							{
                            //								/* Andy Modify 2008-07-30 只有Client的Mobile、TelePhone、ChineseName、EnglishName用前匹配模糊查询 */
                            //								if(this.BusinessObjectView.BusinessObjectName.ToLower() == "client")
                            //								{
                            //									if( queryItem.Attributes["fieldName"].ToLower().Trim().IndexOf("mobile") == -1 &&
                            //										queryItem.Attributes["fieldName"].ToLower().Trim().IndexOf("telephone") == -1 &&
                            //										queryItem.Attributes["fieldName"].ToLower().Trim().IndexOf("chinesename") == -1 &&
                            //										queryItem.Attributes["fieldName"].ToLower().Trim().IndexOf("englishname") == -1)
                            //									{
                            //										queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " LIKE '%" + textbox.Value.Replace("'", "''") + "%'", filterJunction);// 2007-4-5, Tony, 将单引号替换成两个单引号,避免查询时报错
                            //									}
                            //									else
                            //										queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " LIKE '" + textbox.Value.Replace("'", "''") + "%'", filterJunction);
                            //								}
                            //								else
                            //									queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " LIKE '%" + textbox.Value.Replace("'", "''") + "%'", filterJunction);// 2007-4-5, Tony, 将单引号替换成两个单引号,避免查询时报错
                            //							}

                            // Desc
                            queryDesc.AppendFormat("{0}:{1}.", desc.Text, textbox.Value);
                        }
                    }
                    else if (itemType == ViewItemDisplayType.DateTime)
                    {
                        // Filter
                        HtmlInputText  beginTime = queryTable.FindControl("__beginTime_" + i.ToString()) as HtmlInputText;
                        HtmlInputText  endTime   = queryTable.FindControl("__endTime_" + i.ToString()) as HtmlInputText;
                        BusinessFilter subFilter = new BusinessFilter(this.BusinessObjectView.BusinessObjectName);

                        if (queryItem.Attributes["isVirtual"] != "true")
                        {
                            if (beginTime.Value != string.Empty)
                            {
                                subFilter.AddFilterItem(queryItem.Attributes["fieldName"],
                                                        beginTime.Value, Operation.NotSmaller, FilterType.StringType, AndOr.AND);
                            }


                            if (endTime.Value != string.Empty)
                            {
                                subFilter.AddFilterItem(queryItem.Attributes["fieldName"],
                                                        endTime.Value, Operation.Smaller, FilterType.StringType, AndOr.AND);
                            }
                            //endTime.Value, Operation.NotLarger, FilterType.StringType, AndOr.AND);
                        }
                        else
                        {
                            if (beginTime.Value != string.Empty)
                            {
                                subFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + ">= '" + beginTime.Value + "'", AndOr.AND);
                            }

                            if (endTime.Value != string.Empty)
                            {
                                subFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + "< '" + endTime.Value + "'", AndOr.AND);
                            }
                            //subFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + "<= '" + endTime.Value + "'", AndOr.AND);
                        }
                        queryFilter.AddFilter(subFilter, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);

                        if (beginTime.Value != string.Empty || endTime.Value != string.Empty)
                        {
                            // Desc
                            queryDesc.AppendFormat("{0}:从{1}至{2}.", desc.Text, beginTime.Value, endTime.Value);
                        }
                    }
                    else if (itemType == ViewItemDisplayType.SingleObject)
                    {
                        // Filter
                        GridPicker ucGridPicker = queryTable.FindControl("__ucGridPicker_" + i.ToString()) as GridPicker;
                        if (ucGridPicker.SelectedValue != string.Empty)
                        {
                            if (queryItem.Attributes["isVirtual"] != "true")
                            {
                                queryFilter.AddFilterItem(queryItem.Attributes["fieldName"], ucGridPicker.SelectedValue, Operation.Equal, FilterType.NumberType, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                            }
                            else
                            {
                                queryFilter.AddCustomerFilter(queryItem.Attributes["fieldName"] + " = " + ucGridPicker.SelectedValue, queryFilter.Filter != string.Empty ? filterJunction : AndOr.AND);
                            }
                            // Desc
                            queryDesc.AppendFormat("{0}:{1}.", desc.Text, ucGridPicker.SelectedText);
                        }
                    }
                }
            }

            if (queryDesc.Length != 0)
            {
                filterDescription = queryDesc.AppendFormat("({0})", (filterJunction == AndOr.AND) ? "满足全部条件" : "满足任一条件").ToString();
            }
            else
            {
                filterDescription = string.Empty;
            }

            BusinessFilter parentQueryFilter = new BusinessFilter(this.BusinessObjectView.BusinessObjectName);

            parentQueryFilter.AddCustomerFilter("1=1", AndOr.AND);
            parentQueryFilter.AddFilter(queryFilter, AndOr.AND);

            this.SaveQueryStatus();
            return(parentQueryFilter);
        }
示例#10
0
        //Qick新加方法
        public DataTable GetCityListAD(out int totalCount, int pageSize, int pageIndex, Common.OrderByType obType, BusinessFilter filter)
        {
            //获取没有中心的城市
            string sql = "select pkid from dictionaryAd where pkid in (select pkid from dictionaryAd where [name] not in (select [name] from dictionary where isvalid =1 and ([level]=1 or [level]=0)) and isvalid = 1 and ([level]=1 or [level]=0)) and ([level]=1 or [level]=0)";

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            DataTable dt      = session.SqlHelper.ExcuteDataTable(null, sql, CommandType.Text);
            string    NOPKIDs = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                NOPKIDs += "," + dt.Rows[i][0];
            }
            //获取登陆用户拥有权限的城市
            /* Andy Modify 2009-12-17 用DictionaryAD表的PKID和FK_Dictionary过滤不同值 */
            BusinessRule.BaseData.Region regionRule = new BusinessRule.BaseData.Region();
            string cityPKIDs = regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString();

            if (cityPKIDs.IndexOf("2,") != -1)
            {
                cityPKIDs += ",1";
            }
            if (NOPKIDs != string.Empty)
            {
                NOPKIDs = NOPKIDs.Substring(1, NOPKIDs.Length - 1);
            }
            //			string cityPKIDs = ","+regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString()+",";
            //			if(cityPKIDs.IndexOf(",2,")!=-1)
            //			{
            //				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
            //				cityPKIDs+=",1";
            //				if(NOPKIDs!=null&&NOPKIDs!=""&&NOPKIDs!=string.Empty)
            //				{
            //					cityPKIDs+=NOPKIDs;
            //				}
            //			}
            //			else
            //			{
            //				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
            //			}

            Common commonRule = new Common();

            BusinessFilter flt = new BusinessFilter("DictionaryAD");

            flt.AddCustomerFilter("(DictionaryAD.PKID IN(" + NOPKIDs + ") OR DictionaryAD.FK_Dictionary IN (" + cityPKIDs + "))", AndOr.AND);
            //			flt.AddCustomerFilter("(DictionaryAD.PKID IN(" + cityPKIDs + ") OR DictionaryAD.PKID IN (" + cityPKIDs + "))", AndOr.AND);
            flt.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            flt.AddFilter(filter, AndOr.AND);

            // Add Data Permission
            //			flt.AddFilter(GetAuthorizedCityFilter(GlobalFacade.SystemContext.GetContext().UserID), AndOr.AND);

            BusinessObjectCollection boc = new BusinessObjectCollection("DictionaryAD");

            boc.SessionInstance = new Session();
            boc.AddFilter(flt);

            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC) ? true : false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }
示例#11
0
        public DataTable GetDictionaryList(out int totalCount, int pageSize, int pageIndex,
                                           Common.OrderByType obType, BusinessFilter subfilter)
        {
//			//找出没有中心的城市PKID
//			string sql="select pkid from dictionaryAd where pkid in (select pkid from dictionaryAd where [name] not in (select [name] from dictionary where isvalid =1 and ([level]=1 or [level]=0)) and isvalid = 1 and ([level]=1 or [level]=0)) and ([level]=1 or [level]=0)";
//			Wicresoft.Session.Session session = new Wicresoft.Session.Session();
//			DataTable dt = session.SqlHelper.ExcuteDataTable(null,sql,CommandType.Text);
//			string NOPKIDs="";
//			for(int i=0;i<dt.Rows.Count;i++)
//			{
//				NOPKIDs+=","+dt.Rows[i][0];
//			}
//
//			//找出当前用户所拥有权限的城市PKID
//			BusinessRule.BaseData.Region regionRule = new BusinessRule.BaseData.Region();
//
//			string cityPKIDs = ","+regionRule.GetAuthorizedCitiesPKID(GlobalFacade.SystemContext.GetContext().UserID).ToString()+",";
//
//			BusinessObjectCollection boc = new BusinessObjectCollection("ADClient");
//			boc.SessionInstance = session;
//			BusinessFilter filter = new BusinessFilter("ADClient");
//
//			//找出是总部发布的PKID
//			string sqlADInfomation="select PKID from ADInfomation where FK_Center =1 and isvalid=1";
//			Wicresoft.Session.Session sessionADInfomation = new Wicresoft.Session.Session();
//			DataTable dtADInfomation=sessionADInfomation.SqlHelper.ExcuteDataTable(null,sqlADInfomation,CommandType.Text);
//			string ADInfomationPKID =  string.Empty;
//			if(dtADInfomation.Rows.Count>0)
//			{
//				for(int j=0;j<dtADInfomation.Rows.Count;j++)
//				{
//					ADInfomationPKID+=dtADInfomation.Rows[j][0]+",";
//				}
//				ADInfomationPKID=ADInfomationPKID.Substring(0,ADInfomationPKID.Length-1);
//			}
//			//防止ADInfomationPKID为空
//			if(ADInfomationPKID ==  string.Empty)
//			{
//				ADInfomationPKID = "0";
//			}
//			//有总部权限的
//			if(cityPKIDs.IndexOf(",2,")!=-1)
//			{
//				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
//				cityPKIDs+=",1";
//				if(NOPKIDs!=null&&NOPKIDs!=""&&NOPKIDs!=string.Empty)
//				{
//					cityPKIDs+=NOPKIDs;
//				}
//				//如果该用户是总部的 就能看到
//							/* Andy Modify 2009-03-08 */
//				filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") OR ADClient.FK_ADInfomation IN (" + ADInfomationPKID + ")) AND ADClient.FK_ADInfomation IN (" + regionRule.GetAuthorizedADInfomationPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);
//			}
//			else
//			{
//				cityPKIDs=cityPKIDs.Substring(1,cityPKIDs.Length-2);
//				//如果该用户不是总部的 无法看到
//				/* Andy Modify 2009-03-08 */
//				filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") AND ADClient.FK_ADInfomation not IN (" + ADInfomationPKID + ")) AND ADClient.FK_ADInfomation IN (" + regionRule.GetAuthorizedADInfomationPKID(GlobalFacade.SystemContext.GetContext().UserID) + ")", AndOr.AND);
//			}
//						//过滤城市
//			//filter.AddCustomerFilter("(ADClient.FK_City IN(" + cityPKIDs + ") OR ADClient.FK_City IN (" + cityPKIDs + "))", AndOr.AND);
//			filter.AddFilterItem("IsValid","1",Operation.Equal,FilterType.NumberType,AndOr.AND);
//
//			if (subfilter != null)
//				filter.AddFilter(subfilter,AndOr.AND);
//			boc.AddFilter(filter);
//			DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);
//
//			totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
//			return ds.Tables[1];
            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessObjectCollection  boc     = new BusinessObjectCollection("Dictionary");

            boc.SessionInstance = session;
            BusinessFilter filter = new BusinessFilter("Dictionary");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("Level", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            if (subfilter != null)
            {
                filter.AddFilter(subfilter, AndOr.AND);
            }
            boc.AddFilter(filter);
            DataSet ds = boc.GetPagedRecords(pageIndex, pageSize, "PKID", (obType == Common.OrderByType.ASC)?true:false);

            totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
            return(ds.Tables[1]);
        }