• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SearchCondition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SearchCondition的典型用法代码示例。如果您正苦于以下问题:C# SearchCondition类的具体用法?C# SearchCondition怎么用?C# SearchCondition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SearchCondition类属于命名空间,在下文中一共展示了SearchCondition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Get

 public HttpResponseMessage Get(SearchCondition sc)
 {
     string json = "[]";
     switch (sc.pattern)
     {
         case "0":
             TXLDal.SearchCondition tsc = new TXLDal.SearchCondition();
             tsc.keyword = sc.keyword;
             tsc.size = sc.size;
             tsc.start = sc.start;
             tsc.status = sc.status;
             tsc.d = sc.d;
             tsc.e = sc.e;
             tsc.dm = sc.dm;
             tsc.i = sc.i;
             tsc.p = sc.p;
             tsc.r = sc.r;
             tsc.eid = sc.eid;
             tsc.pn = sc.pn;
             tsc.depid = sc.depid;
             json = _dal.Get(tsc).Replace("\r", string.Empty).Replace("\n", string.Empty);
             break;
         //case "1":
         //    json = _dal.Get(sc.id).Replace("\r", string.Empty).Replace("\n", string.Empty);
         //    break;
         default:
             json = _dal.Get(sc.keyword, sc.field, sc.start, sc.size).Replace("\r", string.Empty).Replace("\n", string.Empty);
             break;
     }
     HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(json, Encoding.GetEncoding("UTF-8"), "application/json") };
     return result;
 }
开发者ID:atomyliu,项目名称:ForSearch,代码行数:32,代码来源:TXLController.cs


示例2: GetCount

 public int GetCount(SearchCondition sc)
 {
     if (!string.IsNullOrEmpty(sc.flag))
     {
         switch (sc.flag)
         {
             case "member":
                 return GetCountByM(sc);
             case "member_track":
                 return GetCountByTrack(sc);
             case "member_contact":
                 return GetCountByContact(sc);
             case "member_introducer":
                 return GetCountByIntroducer(sc);
             case "es_fina_pay":
                 return GetCountByEFP(sc);
             default:
                 return -1;
         }
     }
     else
     {
         return -1;
     }
 }
开发者ID:atomyliu,项目名称:ForSearch,代码行数:25,代码来源:MemberDal.cs


示例3: CreateSelectFromLevelQuery

        private static SelectStatement CreateSelectFromLevelQuery(IEntity rootEntity, DbRelation recursiveRelation, SearchCondition leafFilter, int level, LevelQuerySelectList itemsToSelect)
        {
            if (level > Settings.GenericHierarchicalQueryExecutorMaxLevel)
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, Messages.GenericHierarchicalQueryExecutor_MaxLevelReachedFormat, Settings.GenericHierarchicalQueryExecutorMaxLevel));

            // Target level table must be child table because that is the table which is used in leafFilter.
            // If leaf filter is used then the we must ensure that proper table name is used for target table.
            IDbTable targetLevelTable;
            if (leafFilter != null && !leafFilter.IsEmpty)
                targetLevelTable = recursiveRelation.Child;
            else
                targetLevelTable = rootEntity.Table.Clone("L" + level);

            SelectStatement selectFromTargetLevel = new SelectStatement(targetLevelTable);
            CreateSelectListItems(itemsToSelect, targetLevelTable, selectFromTargetLevel);

            if (leafFilter != null && !leafFilter.IsEmpty)
                selectFromTargetLevel.Where.Add(leafFilter);

            IDbTable prevLevel = targetLevelTable;
            for (int parentLevel = level - 1; parentLevel >= 0; parentLevel--)
            {
                IDbTable nextLevel = rootEntity.Table.Clone("L" + parentLevel);
                DbRelation joinLevels = JoinLevelsInSubTree(prevLevel, nextLevel, recursiveRelation);
                selectFromTargetLevel.Relations.Add(joinLevels, false, false);
                prevLevel = nextLevel;
            }

            IDbTable subTreeRoot = prevLevel;
            foreach (IDbColumn rootPkPart in subTreeRoot.PrimaryKey)
                selectFromTargetLevel.Where.Add(rootPkPart, rootEntity.GetField(rootPkPart));

            return selectFromTargetLevel;
        }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:34,代码来源:GenericHierarchicalQueryExecutor.cs


示例4: Test_Empty

		public void Test_Empty()
		{
			var sc = new SearchCondition<object>();
			Assert.AreEqual(0, sc.Values.Length);
			Assert.AreEqual(SearchConditionTest.None, sc.Test);
			Assert.IsTrue(sc.IsEmpty);
		}
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:SearchConditionTests.cs


示例5: GetCount

 public HttpResponseMessage GetCount(SearchCondition sc)
 {
     int count = 0;
     switch (sc.pattern)
     {
         case "0":
             TXLDal.SearchCondition tsc = new TXLDal.SearchCondition();
             tsc.keyword = sc.keyword;
             tsc.size = sc.size;
             tsc.start = sc.start;
             tsc.status = sc.status;
             tsc.d = sc.d;
             tsc.dm = sc.dm;
             tsc.e = sc.e;
             tsc.i = sc.i;
             tsc.p = sc.p;
             tsc.r = sc.r;
             tsc.eid = sc.eid;
             tsc.pn = sc.pn;
             tsc.depid = sc.depid;
             count = _dal.GetCount(tsc);
             break;
         //case "1":
         //    count = _dal.GetCount(sc.id);
         //    break;
         default:
             count = _dal.GetCount(sc.keyword, sc.field, sc.start, sc.size) ;
             break;
     }
     HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(count.ToString(), Encoding.GetEncoding("UTF-8"), "application/json") };
     return result;
 }
开发者ID:atomyliu,项目名称:ForSearch,代码行数:32,代码来源:TXLController.cs


示例6: getme

 public HttpResponseMessage getme(SearchCondition model)
 {
     int em = 0;
     DAL.Implement.MemberDal.SearchCondition sc = new MemberDal.SearchCondition();
     sc.address = model.address;
     sc.aftersales = model.aftersales;
     sc.city = model.city;
     sc.classx = model.classx;
     sc.country = model.country;
     sc.field = model.field;
     sc.flag = model.flag;
     sc.keyword = model.keyword;
     sc.memo = model.memo;
     sc.province = model.province;
     sc.size = model.size < 30 ? model.size : 30;
     sc.start = model.start;
     sc.tracktype = model.tracktype;
     string[] kstr = model.keyword.ToString().Split(',');
     sc.keywords = kstr;
     string str = "[]";
     if (ValidateSign(Regex.Replace(model.keyword, ",", string.Empty), model.flag, model.field, Convert.ToDateTime(model.timestamp), model.sign))
     {
         str = _dal.GetList(sc, out em).Replace("\r", string.Empty).Replace("\n", string.Empty);
     }
     //str = _dal.GetList(sc, out em).Replace("\r", string.Empty).Replace("\n", string.Empty);
     //string str = _dal.GetList(sc, out em);
     HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json") };
     return result;
 }
开发者ID:atomyliu,项目名称:ForSearch,代码行数:29,代码来源:MemberController.cs


示例7: GetParsingTree

        public override SearchCondition GetParsingTree()
        {
            // *** TODO Value.AddLeadingWhitespace();

            var sc = new SearchCondition();
            sc.Stack.AddLast(Value);
            return sc;
        }
开发者ID:skyquery,项目名称:graywulf,代码行数:8,代码来源:Predicate.cs


示例8: AppendWhere

 private static void AppendWhere(SearchCondition where, DbmsType dbms, StringBuilder output, DbParameterCollection parameters)
 {
     bool hasFilter = (where != null) && !where.IsEmpty;
     if (hasFilter)
     {
         output.Append(" WHERE ");
         where.Render(dbms, output, parameters);
     }
 }
开发者ID:lordfist,项目名称:FistCore.Lib,代码行数:9,代码来源:GenericUpdater.cs


示例9: Create

        public static WhereClause Create(SearchCondition sc)
        {
            var wh = new WhereClause();

            wh.Stack.AddLast(Keyword.Create("WHERE"));
            wh.Stack.AddLast(Whitespace.Create());
            wh.Stack.AddLast(sc);

            return wh;
        }
开发者ID:skyquery,项目名称:graywulf,代码行数:10,代码来源:WhereClause.cs


示例10: Create

        public static SearchConditionBrackets Create(SearchCondition sc)
        {
            var scb = new SearchConditionBrackets();

            scb.Stack.AddLast(new BracketOpen());
            scb.Stack.AddLast(sc);
            scb.Stack.AddLast(new BracketClose());

            return scb;
        }
开发者ID:skyquery,项目名称:graywulf,代码行数:10,代码来源:SearchConditionBrackets.cs


示例11: AddCriteria

        public static SearchCriteria AddCriteria(this SearchCriteria searchCriteria, string field, SearchCondition condition, string comparisonValue, bool? isNumeric = null)
        {
            if (searchCriteria.Criteria == null)
            {
                searchCriteria.Criteria = new List<Criteria>();
            }

            searchCriteria.Criteria.Add(new Criteria { ComparisonValue = comparisonValue, Condition = condition, Field = field, IsNumeric = isNumeric});

            return searchCriteria;
        }
开发者ID:RustyF,项目名称:EnergyTrading-Core,代码行数:11,代码来源:SearchBuilder.cs


示例12: getDataTable

    public DataTable getDataTable(PaginationObj paginationObj, int schoolId, SearchCondition condition)
    {
        string sql = "select pr.id,pr.student_id,old_table.name,old_table.grade,old_table.sex, "
                + @" pr.red,pr.blue,pr.green,pr.yellow,rc.cn_name,pr.update_at,pr.print_count "
                + @" from pts_result pr "
                + @" inner join inside_student old_table on pr.student_id = old_table.id "
                + @" inner join result_const rc on pr.color = rc.color "
                + @" where old_table.school = " + schoolId
                + SearchCondictionStr.getString(condition);

        return BaseDao.getTableInfo(sql);
    }
开发者ID:jnuYT,项目名称:niudun-PTS,代码行数:12,代码来源:testedStudentIndex.aspx.cs


示例13: getString

    public static string getString(SearchCondition condition)
    {
        string temp = " ";
        string upadateAt = "";

        if (!String.IsNullOrWhiteSpace(condition.State)) {

            string state = " and old_table.state=" + condition.State;
            temp += state;
        }

        if (!String.IsNullOrWhiteSpace(condition.Name)) {

            string name = " and old_table.name like '%" + condition.Name + "%' ";
            temp += name;
        }

        if (!String.IsNullOrWhiteSpace(condition.Grade))
        {

            string grade = " and old_table.grade= " + condition.Grade;
            temp += grade;
        }

        if (!String.IsNullOrWhiteSpace(condition.Sex))
        {

            string sex = " and old_table.sex=" + condition.Sex;
            temp += sex;
        }

        if (!String.IsNullOrWhiteSpace(condition.TimeBegin) && !String.IsNullOrWhiteSpace(condition.TimeEnd))
        {
            upadateAt = " and CONVERT(VARCHAR(10),old_table.update_at,120) between '" + condition.TimeBegin + "' and '" + condition.TimeEnd + "' ";
        }
        else if (!String.IsNullOrWhiteSpace(condition.TimeBegin))
        {
            upadateAt = " and CONVERT(VARCHAR(10),old_table.update_at,120)='" + condition.TimeBegin + "' ";
        }
        else if (!String.IsNullOrWhiteSpace(condition.TimeEnd))
        {
            upadateAt = " and CONVERT(VARCHAR(10),old_table.update_at,120)='" + condition.TimeEnd + "' ";
        }
        else
        {

        }

        temp += upadateAt;

        return temp;
    }
开发者ID:jnuYT,项目名称:niudun-PTS,代码行数:52,代码来源:SearchCondictionStr.cs


示例14: AppendCondition

        public void AppendCondition(SearchCondition sc, string opstring)
        {
            var cond = this.FindDescendant<SearchCondition>();
            this.Stack.Remove(cond);

            SearchConditionBrackets br1 = SearchConditionBrackets.Create(sc);
            SearchConditionBrackets br2 = SearchConditionBrackets.Create(cond);

            var op = LogicalOperator.Create(opstring);
            cond = SearchCondition.Create(br1, op, SearchCondition.Create(false, br2));

            this.Stack.AddLast(cond);
        }
开发者ID:skyquery,项目名称:graywulf,代码行数:13,代码来源:WhereClause.cs


示例15: FindObjectsByObjectType

        public ObjectSearchResults FindObjectsByObjectType(string objectType)
        {
            var vault = this.VaultService.Vault.Value;

              int objectTypeId = GetObjectTypeId(objectType);

              /* find all files with the specified object type */
              var searchCondition = new SearchCondition();
              searchCondition.ConditionType = MFConditionType.MFConditionTypeEqual;
              searchCondition.Expression.DataStatusValueType = MFStatusType.MFStatusTypeObjectTypeID;
              searchCondition.TypedValue.SetValue(MFDataType.MFDatatypeLookup, objectTypeId);

              return Find(searchCondition);
        }
开发者ID:8,项目名称:MFilesDeleter,代码行数:14,代码来源:FindObjectsService.cs


示例16: FindObjectsByClass

        public ObjectSearchResults FindObjectsByClass(string className)
        {
            var vault = this.VaultService.Vault.Value;

              int classId = GetClassId(className);

              /* find all files with the specified class */
              var searchCondition = new SearchCondition();
              searchCondition.ConditionType = MFConditionType.MFConditionTypeEqual;
              searchCondition.Expression.DataPropertyValuePropertyDef = (int)MFBuiltInPropertyDef.MFBuiltInPropertyDefClass;
              searchCondition.TypedValue.SetValue(MFDataType.MFDatatypeLookup, classId);

              return Find(searchCondition);
        }
开发者ID:8,项目名称:MFilesDeleter,代码行数:14,代码来源:FindObjectsService.cs


示例17: buildPaginationString

 public static string buildPaginationString(string tableName, PaginationObj paginationObj, int schoolId, SearchCondition condition)
 {
     return "select * from "
         + " (select old_table.*, ROW_NUMBER() over(order by update_at) as row_num from "
         + tableName
         + " old_table "
         + " where old_table.school="
         + schoolId
         + SearchCondictionStr.getString(condition)
         + " ) new_table "
         + " where new_table.row_num between "
         + ((paginationObj.PageNum - 1) * paginationObj.NumPerPage + 1)
         + " and "
         + paginationObj.PageNum * paginationObj.NumPerPage;
 }
开发者ID:jnuYT,项目名称:niudun-PTS,代码行数:15,代码来源:Pagination.cs


示例18: DoContinue

		protected void DoContinue(object sender, EventArgs e)
		{
			this.TimeCondition = new SearchCondition() { TimeFrom = this.timeFrom.Value, TimeTo = this.timeTo.Value };
			this.views.ActiveViewIndex = 1;
			WhereSqlClauseBuilder where = ConditionMapping.GetWhereSqlClauseBuilder(this.TimeCondition);

			string[] ids = TimeRangeDataSource.QueryGuidsByCondition(where);

			this.postVal.Value = MCS.Web.Library.Script.JSONSerializerExecute.Serialize(ids);

			this.lblCount.InnerText = ids.Length.ToString("#,##0");

			this.btnRecalc.Visible = ids.Length > 0;

			//this.grid.InitialData = new TimeRangeDataSource().Query(0, 0, builder, "CREATE_TIME", ref total);
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:16,代码来源:TimeRange.aspx.cs


示例19: GetString

 public static string GetString(SearchCondition aSearchCondition)
 {
     string lRet = "";
     switch (aSearchCondition)
     {
         case SearchCondition.KNULL:
             lRet = "";
             break;
         case SearchCondition.AND:
             lRet = "与";
             break;
         case SearchCondition.OR:
             lRet = "或";
             break;
     }
     return lRet;
 }
开发者ID:YHTechnology,项目名称:DocumentManager,代码行数:17,代码来源:SearchCondition.cs


示例20: Test_Clone

		public void Test_Clone()
		{
			var sc = new SearchCondition<object>();
			var x = new object();
			var y = new object();

			sc.Between(x, y);
			sc.SortDesc(3);

			var copy = (SearchCondition<object>)sc.Clone();

			Assert.AreEqual(sc.Test, copy.Test);
			Assert.AreEqual(sc.Values.Length, copy.Values.Length);
			Assert.AreEqual(sc.Values[0], copy.Values[0]);
			Assert.AreEqual(sc.Values[1], copy.Values[1]);
			Assert.AreEqual(sc.SortDirection, copy.SortDirection);
			Assert.AreEqual(sc.SortPosition, copy.SortPosition);
			Assert.IsFalse(ReferenceEquals(sc.Values, copy.Values));
		}
开发者ID:nhannd,项目名称:Xian,代码行数:19,代码来源:SearchConditionTests.cs



注:本文中的SearchCondition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SearchCriteria类代码示例发布时间:2022-05-24
下一篇:
C# SearchCodeRequest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap