如在设置中动态设置了以前条件(金额 >= 5000 and
人员类型 = '普通') or
金额 >= 10000以上为三条数据存放在数据库中,其实的字段名与值还有运算符都是可编辑的。现在存在一单据,有没有方式在.net中判断该单据是否满足以上条件。而不是在数据库中。
人员类型 = '普通') or
金额 >= 10000以上为三条数据存放在数据库中,其实的字段名与值还有运算符都是可编辑的。现在存在一单据,有没有方式在.net中判断该单据是否满足以上条件。而不是在数据库中。
{
DataTable table = DataSet1.Tables["Orders"];
// Presuming the DataTable has a column named Date.
string expression;
expression = "Date > '1/1/00'";
DataRow[] foundRows; // Use the Select method to find all rows matching the filter.
foundRows = table.Select(expression); // Print column 0 of each returned row.
for(int i = 0; i < foundRows.Length; i ++)
{
Console.WriteLine(foundRows[i][0]);
}
}
filter =filter.And(p=>p.price>500 && xxx="普通").Or(p=>p.price>1000)
bool isTrue=false;
for(int i=0;i<count;i++)
{
if((金额>=5000 && 人员类型==“普通”)|| 金额>=10000 )
{
isTure=true;
}
}
如果 条件是动态的。
在后台拼接出sql 语句 查询出 个数。个数大于零 就满足条件。
1.LINQ
2.自己的逻辑算法。