📄 conditionlist.cs
字号:
using System;
using System.Collections;
#region 版权声明
///
/// 版权所有(C)2005,2006 作者:漆巧林。保留所有权利, davidqql@gmail.com, davidqql@hotmail.com
///
/// 作者不对本代码提供任何保证,因此,对于使用该代码带来的损害或者潜在的损害,作者不承担责任。
/// 在满足如下的条件下,你可以自由使用该代码:
/// 1. 非商业应用
/// 2. 保留本版权声明
/// 要进行商业应用,必须得到作者的书面许可。
/// 你可以修改和自由发布本代码,条件是保留前述的版权声明。
///
#endregion
namespace DataAccess
{
/// <summary>
/// ConditionList: 进行数据库查询时的条件列表
/// </summary>
public class ConditionList
{
private IList conditionList;
/// <summary>
/// 条件项类
/// </summary>
public struct ConditionItem
{
String fieldName;
String paramName;
char relation;
object fieldValue;
public ConditionItem(string fieldName, string paramName, char relation, object fieldValue)
{
this.fieldName = fieldName;
this.paramName = paramName;
this.relation = relation;
this.fieldValue = fieldValue;
}
public string FieldName
{
get { return this.fieldName; }
}
public string ParamName
{
get { return this.paramName; }
}
public char Relation
{
get { return this.relation; }
}
public object FieldValue
{
get { return this.fieldValue; }
}
};
public ConditionList()
{
this.conditionList = new ArrayList();
}
public void Add(string fieldName, string paramName, char relation, object fieldValue)
{
this.conditionList.Add(new ConditionItem(fieldName, paramName, relation, fieldValue));
}
public void Add(string fieldName, char relation, object fieldValue)
{
this.conditionList.Add(new ConditionItem(fieldName, fieldName, relation, fieldValue));
}
public ICollection Items
{
get { return this.conditionList; }
}
public ConditionItem this[int idx]
{
get
{
return (ConditionItem)this.conditionList[idx];
}
}
public void Clear()
{
this.conditionList.Clear();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -