using BP.En;
using BP.Sys;
namespace BP.CCBill
{
///
/// 数据源实体
///
public class DBListDBSrc : EntityNoName
{
#region 权限控制.
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
uac.OpenForAppAdmin();
uac.IsDelete = false;
uac.IsInsert = false;
return uac;
}
}
#endregion 权限控制.
#region 属性
#endregion
#region 构造方法
///
/// 数据源实体
///
public DBListDBSrc()
{
}
///
/// 数据源实体
///
/// 映射编号
public DBListDBSrc(string no)
: base(no)
{
}
public int DBType
{
get
{
return this.GetValIntByKey(MapDataAttr.DBType);
}
}
///
/// EnMap
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("Sys_MapData", "数据源实体");
map.CodeStruct = "4";
#region 基本属性.
map.AddTBStringPK(MapDataAttr.No, null, "表单编号", true, true, 1, 190, 20);
map.AddTBString(MapDataAttr.Name, null, "名称", true, true, 1, 190, 20);
#endregion 基本属性.
#region 数据源.
map.AddDDLSysEnum(MapDataAttr.DBType, 0, "数据源类型", true, true, "DBListDBType",
"@0=数据库查询SQL@1=执行Url返回Json@2=执行存储过程");
map.AddDDLEntities(MapDataAttr.DBSrc, null, "数据源", new BP.Sys.SFDBSrcs(), true);
map.SetHelperAlert(MapDataAttr.DBSrc, "您可以在系统管理中新建SQL数据源.");
#endregion 数据源.
this._enMap = map;
return this._enMap;
}
}
#endregion
protected override bool beforeUpdate()
{
DBList db = new DBList(this.No);
if (db.DBType != this.DBType)
{
db.ExpEn = "";
db.ExpList = "";
db.ExpCount = "";
db.Update();
}
return base.beforeUpdate();
}
}
///
/// 数据源实体s
///
public class DBListDBSrcs : EntitiesNoName
{
#region 构造
///
/// 数据源实体s
///
public DBListDBSrcs()
{
}
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new DBListDBSrc();
}
}
#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((DBListDBSrc)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}