事件
SetTypeListData:相同於QuerySetTypeListData
SetTypeTreeData:相同於QuerySetTypeTreeData
現在來看一個例子:
public frmMemberQuery()
{
InitializeComponent();
//要顯示查詢結果列表
DisplayResultList = true;
}
/// <summary>
/// 創建一個實體集合
/// </summary>
/// <param name="type"></param>
protected override void CreateListInstance(Type type)
{
base.CreateListInstance(typeof(TMembers));
}
/// <summary>
/// 獲取選定節點對應的實體信息
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
protected override BaseModel GetSelectedInfo(Node node)
{
try
{
ATMember objDAL = (ATMember)DAFactory.CreateDA(typeof(ATMember));
TMember info = objDAL.Get(node.Tag);
objDAL.Dispose();
return info;
}
catch (System.Exception e)
{
Utility.ShowErrorMessage(e.Message);
}
return null;
}
/// <summary>
/// 構造信息集合
/// </summary>
/// <param name="queryArgs"></param>
/// <param name="isFull"></param>
/// <returns></returns>
protected override IList BuildLists(QueryBuilder qb)
{
try
{
ATMember da = (ATMember)DAFactory.CreateDA(typeof(ATMember));
qb.Append(QueryRelation.And, QueryCompare.Equal, TMember._MemerState, MemberState.Normal.ToString("D"));
return da.Select(qb, GetInfoFIElds());
}
catch (System.Exception e)
{
Utility.ShowErrorMessage(e.Message);
}
return null;
}