本文整理汇总了C#中SearchCondition类的典型用法代码示例。如果您正苦于以下问题:C# SearchCondition类的具体用法?C# SearchCondition怎么用?C# SearchCondition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchCondition类属于命名空间,在下文中一共展示了SearchCondition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例7: GetParsingTree
public override SearchCondition GetParsingTree()
{
// *** TODO Value.AddLeadingWhitespace();
var sc = new SearchCondition();
sc.Stack.AddLast(Value);
return sc;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}