using BP.En; using BP.WF.Template; namespace BP.WF.Port.Admin2Group { /// /// 组织管理员 /// public class OAFlowSortAttr : BP.En.EntityMyPKAttr { /// /// 关联的二级管理员 /// public const string RefOrgAdminer = "RefOrgAdminer"; /// /// 管理员 /// public const string FK_Emp = "FK_Emp"; /// /// 组织 /// public const string OrgNo = "OrgNo"; /// /// FlowSortNo /// public const string FlowSortNo = "FlowSortNo"; } /// /// 组织管理员 /// public class OAFlowSort : EntityMyPK { #region 属性 public string EmpNo { get { return this.GetValStringByKey(OAFlowSortAttr.FK_Emp); } set { this.SetValByKey(OAFlowSortAttr.FK_Emp, value); } } public string OrgNo { get { return this.GetValStringByKey(OAFlowSortAttr.OrgNo); } set { this.SetValByKey(OAFlowSortAttr.OrgNo, value); } } #endregion #region 构造方法 /// /// 组织管理员 /// public OAFlowSort() { } /// /// 组织管理员 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("Port_OrgAdminerFlowSort", "组织管理员流程目录权限"); map.AddMyPK(); map.AddTBString(OAFlowSortAttr.OrgNo, null, "组织", true, false, 0, 100, 20); map.AddTBString(OAFlowSortAttr.FK_Emp, null, "管理员", true, false, 0, 100, 20); map.AddTBString(OAFlowSortAttr.RefOrgAdminer, null, "组织管理员", true, false, 0, 100, 20); //map.AddDDLEntities(OAFlowSortAttr.FK_Emp, null, "管理员", new Emps(), false); //map.AddDDLEntities(OAFlowSortAttr.RefOrgAdminer, null, "管理员", new Emps(), false); map.AddDDLEntities(OAFlowSortAttr.FlowSortNo, null, "流程目录", new BP.WF.Template.FlowSorts(), false); this._enMap = map; return this._enMap; } } #endregion protected override bool beforeInsert() { string str = this.GetValStringByKey("RefOrgAdminer"); this.MyPK = str + "_" + this.GetValStringByKey("FlowSortNo"); OrgAdminer oa = new OrgAdminer(str); this.OrgNo = oa.OrgNo; this.EmpNo = oa.EmpNo; return base.beforeInsert(); } protected override void afterInsert() { //插入入后更改OrgAdminer中 string str = ""; FlowSorts ens = new FlowSorts(); ens.RetrieveInSQL("SELECT FlowSortNo FROM Port_OrgAdminerFlowSort WHERE FK_Emp='" + this.EmpNo + "' AND OrgNo='" + this.OrgNo + "'"); foreach (FlowSort item in ens) { str += "(" + item.No + ")" + item.Name + ";"; } OrgAdminer adminer = new OrgAdminer(this.GetValStringByKey("RefOrgAdminer")); adminer.SetValByKey("FlowSorts", str); adminer.Update(); base.afterInsert(); } } /// /// 组织管理员s /// public class OAFlowSorts : EntitiesMM { #region 构造 /// /// 组织s /// public OAFlowSorts() { } /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new OAFlowSort(); } } #endregion #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((OAFlowSort)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }