using System;
using System.Data;
using BP.DA;
using BP.En;
using BP.Port;
namespace BP.JianYu
{
///
/// 犯人 属性
///
public class FanrenAttr : EntityNoNameAttr
{
///
/// 班主任
///
public const string BZR = "BZR";
public const string Tel = "Tel";
public const string WorkIDOfBatch = "WorkIDOfBatch";
public const string WorkIDOfSubthread = "WorkIDOfSubthread";
///
/// 分监区编号
///
public const string FenJianQuNo = "FenJianQuNo";
///
/// 监区编号
///
public const string JianQuNo = "JianQuNo";
///
/// 监狱编号
///
public const string PrisonNo = "PrisonNo";
}
///
/// 犯人
///
public class Fanren : BP.En.EntityNoName
{
#region 基本属性
///
/// 班主任
///
public string FenJianQuNo
{
get
{
return this.GetValStrByKey(FanrenAttr.FenJianQuNo);
}
set
{
this.SetValByKey(FanrenAttr.FenJianQuNo, value);
}
}
public string JianQuNo
{
get
{
return this.GetValStrByKey(FanrenAttr.JianQuNo);
}
set
{
this.SetValByKey(FanrenAttr.JianQuNo, value);
}
}
public string PrisonNo
{
get
{
return this.GetValStrByKey(FanrenAttr.PrisonNo);
}
set
{
this.SetValByKey(FanrenAttr.PrisonNo, value);
}
}
///
/// 子线程ID.
///
public int WorkIDOfSubthread
{
get
{
return this.GetValIntByKey(FanrenAttr.WorkIDOfSubthread);
}
set
{
this.SetValByKey(FanrenAttr.WorkIDOfSubthread, value);
}
}
///
/// 批次ID
///
public int WorkIDOfBatch
{
get
{
return this.GetValIntByKey(FanrenAttr.WorkIDOfBatch);
}
set
{
this.SetValByKey(FanrenAttr.WorkIDOfBatch, value);
}
}
#endregion
#region 构造函数
///
/// 实体的权限控制
///
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
if (BP.Web.WebUser.No == "zhoupeng" || BP.Web.WebUser.No.Equals("admin") == true)
{
uac.IsDelete = true;
uac.IsUpdate = true;
uac.IsInsert = true;
}
else
{
uac.IsDelete = false;
uac.IsUpdate = false;
uac.IsInsert = false;
}
return uac;
}
}
///
/// 犯人
///
public Fanren() { }
public Fanren(string no) : base(no)
{
}
///
/// Map
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("JY_Fanren", "犯人");
#region 字段
map.AddTBStringPK(FanrenAttr.No, null, "编号", true, true, 3, 3, 50);
map.AddTBString(FanrenAttr.Name, null, "名称", true, false, 0, 50, 200);
map.AddDDLEntities(FanrenAttr.PrisonNo, null, "监狱", new Prisons(), false);
map.AddTBInt(FanrenAttr.WorkIDOfBatch, 0, "批次的WorkID", true, false);
map.AddDDLEntities(FanrenAttr.JianQuNo, null, "监区", new JianQus(), false);
map.AddTBInt(FanrenAttr.WorkIDOfSubthread, 0, "子线程WorkID", true, false);
map.AddDDLEntities(FanrenAttr.FenJianQuNo, null, "分监区", new FenJianQus(), false);
#endregion
//按照监狱来查询.
map.AddSearchAttr(JianQuAttr.PrisonNo);
//不带有参数的方法.
RefMethod rm = new RefMethod();
rm.Title = "审批过程";
rm.ClassMethodName = this.ToString() + ".DoFlow";
rm.RefMethodType = RefMethodType.LinkeWinOpen;
rm.IsCanBatch = false; //是否可以批处理?
map.AddRefMethod(rm);
this._enMap = map;
return this._enMap;
}
}
public string DoFlow()
{
return "/WF/MyView.htm?WorkID=" + this.WorkIDOfSubthread+"&FID="+this.WorkIDOfBatch+"&FK_Flow=001";
}
protected override bool beforeInsert()
{
FenJianQu en = new FenJianQu(this.FenJianQuNo);
this.PrisonNo = en.PrisonNo;
this.JianQuNo = en.JianQuNo;
return base.beforeInsert();
}
public override Entities GetNewEntities
{
get { return new Fanrens(); }
}
#endregion
}
///
/// 犯人s
///
public class Fanrens : BP.En.EntitiesNoName
{
#region 重写
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new Fanren();
}
}
#endregion
#region 构造方法
///
/// 犯人s
///
public Fanrens() { }
#endregion
}
}