using System; using System.Data; using BP.DA; using BP.En; using BP.WF; using BP.Port; namespace BP.WF.Template { /// /// 流程数据同步 属性 /// public class SyncDataFieldAttr : EntityMyPKAttr { ///流程编号 public const string FlowNo = "FlowNo"; //同步类型. public const string RefPKVal = "RefPKVal"; //数据源 public const string AttrKey = "AttrKey"; public const string AttrName = "AttrName"; public const string AttrType = "AttrType"; //备注. public const string ToFieldKey = "ToFieldKey"; public const string ToFieldName = "ToFieldName"; public const string ToFieldType = "ToFieldType"; //使用的转换函数 public const string TurnFunc = "TurnFunc"; //是否同步? public const string IsSync = "IsSync"; } /// /// 流程数据同步 /// public class SyncDataField : EntityMyPK { #region 属性 /// /// 流程编号 /// public string FlowNo { get { return this.GetValStringByKey(SyncDataFieldAttr.FlowNo); } set { this.SetValByKey(SyncDataFieldAttr.FlowNo, value); } } /// /// 字段 /// public string ToFieldKey { get { return this.GetValStringByKey(SyncDataFieldAttr.ToFieldKey); } set { this.SetValByKey(SyncDataFieldAttr.ToFieldKey, value); } } /// /// 表集合 /// public string ToFieldName { get { return this.GetValStringByKey(SyncDataFieldAttr.ToFieldName); } set { this.SetValByKey(SyncDataFieldAttr.ToFieldName, value); } } /// /// 表主键 /// public string RefPKVal { get { return this.GetValStringByKey(SyncDataFieldAttr.RefPKVal); } set { this.SetValByKey(SyncDataFieldAttr.RefPKVal, value); } } /// /// 表 /// public string AttrKey { get { return this.GetValStringByKey(SyncDataFieldAttr.AttrKey); } set { this.SetValByKey(SyncDataFieldAttr.AttrKey, value); } } /// /// 备注 /// public string AttrName { get { return this.GetValStringByKey(SyncDataFieldAttr.AttrName); } set { this.SetValByKey(SyncDataFieldAttr.AttrName, value); } } /// /// URL /// public string AttrType { get { return this.GetValStringByKey(SyncDataFieldAttr.AttrType); } set { this.SetValByKey(SyncDataFieldAttr.AttrType, value); } } /// /// 数据源 /// public string TurnFunc { get { return this.GetValStringByKey(SyncDataFieldAttr.TurnFunc); } set { this.SetValByKey(SyncDataFieldAttr.TurnFunc, value); } } /// /// 类型 /// public bool IsSync { get { return this.GetValBooleanByKey(SyncDataFieldAttr.IsSync); } set { this.SetValByKey(SyncDataFieldAttr.IsSync, value); } } #endregion #region 构造函数 /// /// SyncDataField /// public SyncDataField() { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_SyncDataField", "流程数据同步"); map.AddMyPK(); map.AddTBString(SyncDataFieldAttr.FlowNo, null, "流程编号", false, false, 0, 10, 50, true); map.AddTBString(SyncDataFieldAttr.RefPKVal, null, "关键内容", false, false, 0, 50, 50, true); map.AddTBString(SyncDataFieldAttr.AttrKey, null, "业务字段", true, true, 0, 100, 50, false); map.AddTBString(SyncDataFieldAttr.AttrName, null, "字段名", true, true, 0, 100, 50, false); map.AddTBString(SyncDataFieldAttr.AttrType, null, "类型", true, true, 0, 100, 50, false); map.AddTBString(SyncDataFieldAttr.ToFieldKey, null, "同步到字段", true, true, 0, 100, 50, false); map.AddTBString(SyncDataFieldAttr.ToFieldName, null, "字段名", true, true, 0, 100, 50, false); map.AddTBString(SyncDataFieldAttr.ToFieldType, null, "类型", true, true, 0, 100, 50, false); map.AddBoolean(SyncDataFieldAttr.IsSync, false, "同步?", true, true); map.AddTBString(SyncDataFieldAttr.TurnFunc, null, "转换函数", true, false, 0, 50, 50); this._enMap = map; return this._enMap; } } #endregion } /// /// 流程数据同步 /// public class SyncDataFields : EntitiesMyPK { #region 方法 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new SyncDataField(); } } /// /// 流程数据同步 /// public SyncDataFields() { } #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((SyncDataField)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }