using System;
using System.Collections;
using BP.DA;
using BP.En;
using BP.Port;
using BP.Sys;
namespace BP.WF.Template
{
///
/// 累加表单方案
///
public class FoolTruckNodeFrm : EntityMyPK
{
#region 基本属性
///
/// UI界面上的访问控制
///
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
uac.OpenForSysAdmin();
uac.IsDelete = false;
uac.IsInsert = false;
return uac;
}
}
///
///节点
///
public int NodeID
{
get
{
return this.GetValIntByKey(FrmNodeAttr.FK_Node);
}
set
{
this.SetValByKey(FrmNodeAttr.FK_Node, value);
}
}
///
/// 表单ID
///
public string FK_Frm
{
get
{
return this.GetValStringByKey(FrmNodeAttr.FK_Frm);
}
set
{
this.SetValByKey(FrmNodeAttr.FK_Frm, value);
}
}
///
/// 对应的解决方案
/// 0=默认方案.节点编号= 自定义方案, 1=不可编辑.
///
public int FrmSln
{
get
{
return this.GetValIntByKey(FrmNodeAttr.FrmSln);
}
set
{
this.SetValByKey(FrmNodeAttr.FrmSln, value);
}
}
///
/// 流程编号
///
public string FlowNo
{
get
{
return this.GetValStringByKey(FrmNodeAttr.FK_Flow);
}
set
{
this.SetValByKey(FrmNodeAttr.FK_Flow, value);
}
}
#endregion
#region 构造方法
///
/// 累加表单方案
///
public FoolTruckNodeFrm() { }
///
/// 累加表单方案
///
///
public FoolTruckNodeFrm(string mypk)
: base(mypk)
{
}
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("WF_FrmNode", "累加表单方案");
map.AddMyPK();
map.AddTBInt(FrmNodeAttr.FK_Node, 0, "要作用的节点ID", false, true);
map.AddTBString(FrmNodeAttr.FK_Frm, null, "表单ID", false, true, 1, 100, 200);
map.AddDDLSysEnum(FrmNodeAttr.FrmSln, 0, "表单控制方案", true, true, FrmNodeAttr.FrmSln,
"@0=默认方案@1=只读方案@2=自定义方案");
map.AddTBString(FrmNodeAttr.FK_Flow, null, "流程编号", true, true, 1, 4, 20);
this._enMap = map;
return this._enMap;
}
}
#endregion
///
/// 修改前的操作
///
///
protected override bool beforeUpdate()
{
//表单方案如果是只读或者默认方案时,删除对应的设置的权限
if (this.FrmSln == 0 || this.FrmSln == 1)
{
string sql = "";
sql += "@DELETE FROM Sys_FrmSln WHERE FK_MapData='" + this.FK_Frm + "' AND FK_Node='" + this.NodeID + "'";
sql += "@DELETE FROM Sys_FrmAttachment WHERE FK_MapData='" + this.FK_Frm + "' AND FK_Node='" + this.NodeID + "'";
sql += "@DELETE FROM Sys_MapDtl WHERE FK_MapData='" + this.FK_Frm + "' AND FK_Node='" + this.NodeID + "'";
DBAccess.RunSQLs(sql);
}
return base.beforeUpdate();
}
}
///
/// 累加表单方案s
///
public class FoolTruckNodeFrms : EntitiesMyPK
{
#region 构造方法..
///
/// 累加表单方案
///
public FoolTruckNodeFrms() { }
#endregion 构造方法..
#region 公共方法.
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new FoolTruckNodeFrm();
}
}
#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((FoolTruckNodeFrm)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}