using System; using System.Collections; using BP.DA; using BP.En; namespace BP.Port { /// /// 用户组类型 /// public class TeamTypeAttr : EntityNoNameAttr { /// /// 排序字段 /// public const string Idx = "Idx"; } /// /// 用户组类型 /// public class TeamType : EntityNoName { #region 属性 #endregion #region 实现基本的方方法 public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenForSysAdmin(); return uac; } } #endregion #region 构造方法 /// /// 用户组类型 /// public TeamType() { } /// /// 用户组类型 /// /// public TeamType(string _No) : base(_No) { } #endregion /// /// 用户组类型Map /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Port_TeamType", "标签类型"); map.CodeStruct = "2"; map.AddTBStringPK(TeamTypeAttr.No, null, "编号", true, true, 1, 5, 5); map.AddTBString(TeamTypeAttr.Name, null, "名称", true, false, 1, 50, 20); map.AddTBInt(TeamTypeAttr.Idx, 0, "顺序", true, false); this._enMap = map; return this._enMap; } } protected override bool beforeUpdateInsertAction() { if (DataType.IsNullOrEmpty(this.Name) == true) throw new Exception("请输入名称"); return base.beforeUpdateInsertAction(); } } /// /// 用户组类型 /// public class TeamTypes : EntitiesNoName { /// /// 用户组类型s /// public TeamTypes() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new TeamType(); } } #region 为了适应自动翻译成java的需要,把实体转换成List. /// /// 转化成 java list,C#不能调用. /// /// List public System.Collections.Generic.IList ToJavaList() { return (System.Collections.Generic.IList)this; } /// /// 转化成list /// /// List public System.Collections.Generic.List Tolist() { System.Collections.Generic.List list = new System.Collections.Generic.List(); for (int i = 0; i < this.Count; i++) { list.Add((TeamType)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }