using System;
using System.Collections;
using BP.DA;
namespace BP.En
{
///
/// 从表的编辑模式
///
public enum DtlEditerModel
{
///
/// 批量编辑
///
DtlBatch = 0,
///
/// 查询编辑模式
///
DtlSearch = 1,
///
/// 自定义URL
///
DtlURL = 2,
///
/// 在EnOnly显示查询
///
DtlBatchEnonly = 3,
///
/// 在EnOnly
///
DtlSearchEnonly = 4,
DtlURLEnonly = 5,
}
///
/// EnDtl 的摘要说明。
///
public class EnDtl
{
///
/// 明细
///
public EnDtl()
{
}
///
/// 编辑器模式 0=默认的DtlBatch.htm, 1=DtlSearch.htm
///
public DtlEditerModel DtlEditerModel = DtlEditerModel.DtlBatch;
///
/// 类名称
///
public string EnsName
{
get
{
return this.Ens.ToString();
}
}
///
/// 明细
///
public Entities Ens = null;
public string UrlExt = null;
///
/// 他关连的 key
///
public string RefKey = null;
private string _desc = "";
///
/// 描述
///
public string Desc
{
get
{
if(DataType.IsNullOrEmpty(_desc))
return this.Ens.GetNewEntity.EnDesc;
return this._desc;
}
set
{
this._desc = value;
}
}
///
/// 显示到分组
///
public string GroupName = null;
public string Icon = null;
}
///
/// 从表
///
[Serializable]
public class EnDtls : CollectionBase
{
///
/// 加入
///
/// attr
public void Add(EnDtl en)
{
if (this.ItIsExits(en))
return;
this.InnerList.Add(en);
}
///
/// 是不是存在集合里面
///
/// 要检查的EnDtl
/// true/false
public bool ItIsExits(EnDtl en)
{
foreach (EnDtl dtl in this)
{
if (dtl.Ens == en.Ens)
{
return true;
}
}
return false;
}
///
/// 根据索引访问集合内的元素Attr。
///
public EnDtl this[int index]
{
get
{
return (EnDtl)this.InnerList[index];
}
}
}
}