Пример #1
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]);
        }
Пример #2
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 GetCWOneChildList(out int totalCount, int pageSize, int pageIndex,
                                           Common.OrderByType obType, 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);
            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]);
        }
Пример #3
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]);
        }
Пример #4
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]);
        }
Пример #5
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]);
        }
Пример #6
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]);
        }
Пример #7
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]);
        }