using System;
using System.Data;
using System.Collections;
using BP.DA;
using BP.En;
using BP.Sys;
namespace BP.FrmTemplate
{
///
/// 表单
///
public class FrmExt : EntityNoName
{
#region 实现基本的方法
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
uac.OpenForSysAdmin();
uac.IsDelete = false;
uac.IsInsert = false;
return uac;
}
}
///
/// 表单类型
///
public string FK_FormTree
{
get
{
return this.GetValStrByKey(FrmAttr.FK_FormTree);
}
set
{
this.SetValByKey(FrmAttr.FK_FormTree, value);
}
}
///
/// 工作模式
///
public int WorkModel
{
get
{
return this.GetValIntByKey(FrmAttr.WorkModel);
}
set
{
this.SetValByKey(FrmAttr.WorkModel, value);
}
}
///
/// 指定的流程编号
///
public string SpecFlowNo
{
get
{
return this.GetValStrByKey(FrmAttr.SpecFlowNo);
}
set
{
this.SetValByKey(FrmAttr.SpecFlowNo, value);
}
}
#endregion
#region 构造方法
///
/// 表单
///
public FrmExt()
{
}
///
/// 表单
///
/// 表单编号
public FrmExt(string no)
{
this.No = no.Trim();
if (this.No.Length == 0)
throw new Exception("@要查询的表单编号为空。");
this.Retrieve();
}
///
/// EnMap
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("Frm_Template", "表单");
#region 表单基本信息.
map.AddTBStringPK(FrmAttr.No, null, "编号", true, false, 0, 50, 4);
map.AddTBString(FrmAttr.Name, null, "名称", true, false, 0, 100, 100);
map.AddDDLEntities(FrmAttr.FK_FormTree, null, "类别", new Sort1s(), true);
map.AddDDLEntities(FrmAttr.FK_SortFunc, null, "功能用途", new SortFuncs(), true);
map.AddDDLSysEnum(FrmAttr.WorkModel, 0, "工作模式", true, true,
FrmAttr.WorkModel, "@0=内部流程@1=外部流程@2=实体台账@3=业务表单,单据", false);
map.AddBoolean(FrmAttr.IsTuiJian, false, "是否是推荐", true, true);
map.AddTBString(FrmAttr.Icon, null, "图标", true, false, 0, 200, 4);
#endregion 表单基本信息.
map.AddTBStringDoc(FrmAttr.Note, null, "备注", true, false);
//类别不是空.
// map.AddHidden(FrmAttr.FK_FormTree, "!=", "");
//查询条件.
map.AddSearchAttr(FrmAttr.FK_FormTree);
map.AddSearchAttr(FrmAttr.FK_SortFunc);
map.AddSearchAttr(FrmAttr.WorkModel);
RefMethod rm = new RefMethod();
rm.Title = "查看";
rm.RefMethodType = RefMethodType.LinkeWinOpen;
rm.ClassMethodName = this.ToString() + ".DoView";
rm.IsForEns = true;
map.AddRefMethod(rm);
rm = new RefMethod();
rm.Title = "安装";
rm.RefMethodType = RefMethodType.RightFrameOpen;
rm.ClassMethodName = this.ToString() + ".DoInstall";
rm.IsForEns = true;
map.AddRefMethod(rm);
this._enMap = map;
return this._enMap;
}
}
#endregion
///
/// 执行查看
///
///
public string DoView()
{
return "http://template."+BP.Cloud.Glo.SaasHost+"/WF/CCForm/FrmGener.htm?1=2&FrmID="+this.No;
}
///
/// 执行安装
///
///
public string DoInstall()
{
return "/App/FlowDesigner/NewFlowByTemplateFromCloud.htm?FrmID="+this.No;
}
}
///
/// 表单s
///
public class FrmExts : EntitiesNoName
{
///
/// 表单
///
public FrmExts() { }
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new FrmExt();
}
}
#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((FrmExt)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}