using System;
using System.Data;
using BP.DA;
using BP.En;
using BP.Port;
namespace BP.WF.Template
{
///
/// 抄送属性
///
public class CCRoleAttr
{
#region 基本属性
///
/// 标题
///
public const string NodeID = "NodeID";
///
/// 抄送内容
///
public const string FlowNo = "FlowNo";
public const string CCRoleExcType = "CCRoleExcType";
public const string EnIDs = "EnIDs";
public const string Tag2 = "Tag2";
public const string CCStaWay = "CCStaWay";
public const string Idx = "Idx";
#endregion
}
///
/// 抄送
///
public class CCRole : EntityMyPK
{
#region 属性
///
/// 获得抄送人
///
///
///
///
///节点ID
///
public int NodeID
{
get
{
return this.GetValIntByKey(NodeAttr.NodeID);
}
set
{
this.SetValByKey(NodeAttr.NodeID, value);
}
}
///
/// 执行类型
///
public CCRoleExcType CCRoleExcType
{
get
{
return (CCRoleExcType)this.GetValIntByKey(CCRoleAttr.CCRoleExcType);
}
set
{
this.SetValByKey(CCRoleAttr.CCRoleExcType, value);
}
}
public CCStaWay CCStaWay
{
get
{
return (CCStaWay)this.GetValIntByKey(CCRoleAttr.CCStaWay);
}
}
///
/// 多个元素的分割.
///
public string EnIDs
{
get
{
string str= this.GetValStringByKey(CCRoleAttr.EnIDs);
str = str.Replace(",","','");
str = "'" + str+"'";
str = str.Replace("''","'");
str = str.Replace("''", "'");
return str;
}
}
///
/// UI界面上的访问控制
///
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
if (BP.Web.WebUser.IsAdmin == false)
{
uac.IsView = false;
return uac;
}
uac.IsDelete = false;
uac.IsInsert = false;
uac.IsUpdate = true;
return uac;
}
}
#endregion
#region 构造函数
///
/// 抄送设置
///
public CCRole()
{
}
///
/// 抄送设置
///
///
public CCRole(int nodeid)
{
this.NodeID = nodeid;
this.Retrieve();
}
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("WF_CCRole", "抄送规则");
map.AddMyPK();
map.AddTBInt(CCRoleAttr.NodeID, 0, "节点", false, true);
map.AddTBString(CCRoleAttr.FlowNo, null, "流程编号", false, false, 0, 10, 50, true);
// 执行类型.
string val = "@0=按表单字段计算@1=按人员计算@2=按角色计算@3=按部门计算@4=按SQL计算@5=按接受人规则计算";
map.AddDDLSysEnum(CCRoleAttr.CCRoleExcType, 0, "执行类型", true, true, CCRoleAttr.CCRoleExcType, val);
map.AddTBInt(CCRoleAttr.CCStaWay, 0, "CCStaWay", false, true);
map.AddTBStringDoc(CCRoleAttr.EnIDs, null, "执行内容1", true, false, true);
map.AddTBStringDoc(CCRoleAttr.Tag2, null, "执行内容2", true, false, true);
map.AddTBInt(CCRoleAttr.Idx, 0, "Idx", false, true);
map.AddTBAtParas(300);
this._enMap = map;
return this._enMap;
}
}
#endregion
}
///
/// 执行类型
///
public enum CCRoleExcType
{
///
/// 按表单字段计算
///
ByFrmField=0,
///
/// 按人员
///
ByEmps = 1,
///
/// 按照岗位
///
ByStations = 2,
///
/// 按部门
///
ByDepts = 3,
///
/// 按SQL
///
BySQLs = 4,
///
/// 按照节点绑定的接受人计算.
///
ByDeliveryWay = 5
}
///
/// 抄送s
///
public class CCRoles : EntitiesMyPK
{
#region 方法
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new CCRole();
}
}
///
/// 抄送
///
public CCRoles() { }
public CCRoles(int nodeID)
{
this.Retrieve(NodeAttr.NodeID, nodeID, NodeAttr.Step);
}
#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((CCRole)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}