Example #1
0
        public IQueryable <PrePlanFS> GetByKeyWord(string keyWord)
        {
            var eps = DynamicLinqExpressions.False <PrePlanFS>();

            eps = eps.Or(this.GetExpressionByUnifiedId(keyWord))
                  .Or(this.GetExpressionByName(keyWord));
            IQueryable <PrePlanFS> preplans = this.ExecuteConditions(eps);

            return(preplans);
        }
        public IQueryable <Comprehensive> GetByKeyWord(string keyWord)
        {
            var eps = DynamicLinqExpressions.False <Comprehensive>();

            eps = eps.Or(this.GetExpressionByUnifiedId(keyWord))
                  .Or(this.GetExpressionByName(keyWord))
                  .Or(this.GetExpressionByLocation(keyWord));
            IQueryable <Comprehensive> comprehensives = this.ExecuteConditions(eps);

            return(comprehensives);
        }
        public IQueryable <MassPre> GetByKeyWord(string keyWord)
        {
            var eps     = DynamicLinqExpressions.False <MassPre>();
            var epsName = LinqEntityHelper.GetExpressionForSingle <MassPre, String>
                              (keyWord, m => m.称.Contains(keyWord));
            var epsUid = LinqEntityHelper.GetExpressionForSingle <MassPre, String>
                             (keyWord, m => m.统一编号.Contains(keyWord));

            eps = eps.Or(epsName).Or(epsUid);
            return(this.ExecuteConditions(eps));
        }
        public IQueryable <PhyGeoDisaster> GetByKeyWord(string keyWord)
        {
            var eps = DynamicLinqExpressions.False <PhyGeoDisaster>();

            eps = eps
                  .Or(this.GetExpressionByName(keyWord))
                  .Or(this.GetExpressionByLocation(keyWord));
            IQueryable <PhyGeoDisaster> phys = this.ExecuteConditions(eps);

            return(phys);
        }
        /// <summary>
        /// 关键字条件(关键字将查询统一编号和矿山名称)
        /// </summary>
        /// <param name="keyWord"></param>
        /// <returns></returns>
        public Expression <Func <MineArchive, Boolean> > GetExpressionByKeyWord(string keyWord)
        {
            var eps = DynamicLinqExpressions.False <MineArchive>();

            if (!String.IsNullOrEmpty(keyWord))
            {
                eps = eps.Or(this.GetExpressionByUnifiedId(keyWord))
                      .Or(this.GetExpressionByName(keyWord));
            }
            else
            {
                eps = DynamicLinqExpressions.True <MineArchive>();
            }
            return(eps);
        }
        public Expression <Func <Comprehensive, Boolean> > GetExpressionBySituationLev(List <string>
                                                                                       situationLevs)
        {
            var eps = DynamicLinqExpressions.True <Comprehensive>();

            if (situationLevs != null && situationLevs.Count != 0)
            {
                //如果不为null,则初始条件为False,多个situationLevs间为“OR”关系,有一个满足则,此条件成立
                eps = DynamicLinqExpressions.False <Comprehensive>();
                foreach (var lev in situationLevs)
                {
                    eps = eps.Or(p => p.灾情等级 == lev);
                }
            }
            return(eps);
        }
        public Expression <Func <Comprehensive, Boolean> > GetExpressionByDangerousLev(
            List <String> dangerLevs)
        {
            var eps = DynamicLinqExpressions.True <Comprehensive>();

            if (dangerLevs != null && dangerLevs.Count != 0)
            {
                //如果不为null,则初始条件为False,多个dangerLevs间为“OR”关系,有一个满足则,此条件成立
                eps = DynamicLinqExpressions.False <Comprehensive>();
                foreach (var lev in dangerLevs)
                {
                    eps = eps.Or(p => p.险情等级 == lev);
                }
            }
            return(eps);
        }
        public Expression <Func <PhyGeoDisaster, Boolean> > GetExpressionByDisasterType(
            List <EnumGeoDisasterType?> types)
        {
            var eps = DynamicLinqExpressions.True <PhyGeoDisaster>();

            if (types != null && types.Count != 0)
            {
                //如果不为null,则初始条件为False,多个gbcodes间为“OR”关系,有一个满足则,此条件成立
                eps = DynamicLinqExpressions.False <PhyGeoDisaster>();
                foreach (var type in types)
                {
                    eps = eps.Or(p => p.DisasterType == type);
                }
            }
            return(eps);
        }
        public Expression <Func <PhyGeoDisaster, Boolean> > GetExpressionByGBCode(List <string> gbcodes)
        {
            //如果为null,表示忽略此条件
            var eps = DynamicLinqExpressions.True <PhyGeoDisaster>();

            if (gbcodes != null && gbcodes.Count != 0)
            {
                //如果不为null,则初始条件为False,多个gbcodes间为“OR”关系,有一个满足则,此条件成立
                eps = DynamicLinqExpressions.False <PhyGeoDisaster>();
                foreach (var regionCode in gbcodes)
                {
                    if (!String.IsNullOrEmpty(regionCode))
                    {
                        eps = eps.Or(p => p.GBCodeId == regionCode);
                    }
                }
            }
            return(eps);
        }
        public Expression <Func <Comprehensive, Boolean> > GetExpressionByGBCode(List <string> gbcodes)
        {
            //如果为null,表示忽略此条件
            var eps = DynamicLinqExpressions.True <Comprehensive>();

            if (gbcodes != null && gbcodes.Count != 0)
            {
                //如果不为null,则初始条件为False,多个gbcodes间为“OR”关系,有一个满足则,此条件成立
                eps = DynamicLinqExpressions.False <Comprehensive>();
                foreach (var regionCode in gbcodes)
                {
                    if (!String.IsNullOrEmpty(regionCode))
                    {
                        string tempGbCode = regionCode;
                        eps = eps.Or(p => p.GBCodeId.StartsWith(tempGbCode));
                    }
                }
            }
            return(eps);
        }