using System; using System.Data; using BP.DA; using BP.En; using BP.WF; namespace BP.WF.Template { /// /// 属性 /// public class DocTemplateAttr : BP.En.EntityNoNameAttr { /// /// 路径 /// public const string FilePath = "FilePath"; /// /// NodeID /// public const string FK_Node = "FK_Node"; /// /// 流程编号 /// public const string FK_Flow = "FK_Flow"; /// /// NodeID /// public const string FillTempFields = "FillTempFields"; } /// /// 公文模板 /// public class DocTemplate : EntityNoName { #region 属性 /// /// 文件 /// public byte[] FileBytes { get { //转化为字节. byte[] bytes = null; bytes = DataType.ConvertFileToByte(this.FilePath); return bytes; } } /// /// UI界面上的访问控制 /// public override UAC HisUAC { get { UAC uac = new UAC(); uac.OpenForSysAdmin(); return uac; } } /// /// 编号 /// public new string No { get { return this.GetValStrByKey(DocTemplateAttr.No); } set { this.SetValByKey(DocTemplateAttr.No, value); } } /// /// 路径 /// public string FilePath { get { return this.GetValStrByKey(DocTemplateAttr.FilePath); } set { this.SetValByKey(DocTemplateAttr.FilePath, value); } } /// /// 节点ID /// public int FK_Node { get { return this.GetValIntByKey(DocTemplateAttr.FK_Node); } set { this.SetValByKey(DocTemplateAttr.FK_Node, value); } } /// /// 流程编号 /// public string FK_Flow { get { return this.GetValStrByKey(DocTemplateAttr.FK_Flow); } set { this.SetValByKey(DocTemplateAttr.FK_Flow, value); } } #endregion #region 构造函数 /// /// 公文模板 /// public DocTemplate() { } /// /// 公文模板 /// /// public DocTemplate(string no) : base(no) { } /// /// 重写基类方法 /// public override Map EnMap { get { if (this._enMap != null) return this._enMap; Map map = new Map("WF_DocTemplate", "公文模板"); //map.setCodeStruct("6"); map.AddTBStringPK(DocTemplateAttr.No, null, "No", true, true, 1, 50, 20); map.AddTBString(DocTemplateAttr.Name, null, "名称", true, false, 0, 200, 20); map.AddTBString(DocTemplateAttr.FilePath, null, "模板路径", true, false, 0, 200, 20); map.AddTBInt(DocTemplateAttr.FK_Node, 0, "节点ID", true, false); map.AddTBString(DocTemplateAttr.FK_Flow, null, "流程编号", true, false, 0, 4, 20); this._enMap = map; return this._enMap; } } #endregion } /// /// 公文模板s /// public class DocTemplates : EntitiesNoName { #region 构造 /// /// 得到它的 Entity /// public override Entity GetNewEntity { get { return new DocTemplate(); } } /// /// 公文模板 /// public DocTemplates() { } #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((DocTemplate)this[i]); } return list; } #endregion 为了适应自动翻译成java的需要,把实体转换成List. } }