WinForm应⽤程序框架设计之WinAction(⼀:显⽰列表窗
体)
我们来先看看WinAction的显⽰列表窗体的流程:
具体代码参考:
public void InitListForm(Form listForm, object entity)
{
if (listForm is IDataListView)
{
IDataListView mForm = listForm as IDataListView;
IList<T> dataList;
if (null==entity)
dataList = useBll.SelectAll<T>();
else
dataList = useBll.QueryForList<T>(entity);
mForm.setDataList(TransformToDataListObject(dataList));
if (null == mForm.RefreshEntityList)
mForm.RefreshEntityList = RefreshEntity;
//初始化搜索对象
if (entity != null)
mForm.SearchEntity = entity;
}
//
if (listForm is IDataListGridView && !(listForm as IDataListGridView).InitColumn)
{
(listForm as IDataListGridView).InitColumns(useBll.GetModelPropertys(), useBll.GetTableColumns(), pdm.FindTableByTableName(useBll.GetTableNam                if (listForm is IDataControlActionView)
{
IDataControlActionView dForm = listForm as IDataControlActionView;
dForm.DeleteEntity = DeleteEntity;
dForm.EditEntity = EditEntityHandler;
gridview不显示dForm.NewEntity = NewEntityHandler;
dForm.AfterUpdateEntity= UpdateEditCallerData;
dForm.AfterUpdateEntityCancel = CancelEditCallerData;
dForm.AfterUpdateEntityError = ErrorEditCallerData;
dForm.ClosingListForm = ClosingListFormHandler;
}
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。