using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.IO;
using System.Net;
using System.Xml;
using BP.DA;
using BP.En;
using Microsoft.CSharp;
using BP.Sys;
namespace BP.Sys
{
///
/// 属性
///
public class SFTableDtlAttr : BP.En.EntityMyPKAttr
{
///
/// 关联的外键
///
public const string FK_SFTable = "FK_SFTable";
public const string BH = "BH";
public const string Name = "Name";
public const string ParentNo = "ParentNo";
///
/// 属性Key
///
public const string TableID = "TableID";
///
/// 列选择
///
public const string OrgNo = "OrgNo";
///
/// 顺序号
///
public const string Idx = "Idx";
}
///
/// 系统字典表
///
public class SFTableDtl : EntityMyPK
{
#region 属性.
///
/// 组织编号
///
//public string OrgNo
//{
// get
// {
// return this.GetValStrByKey(SFTableDtlAttr.OrgNo);
// }
// set
// {
// this.SetValByKey(SFTableDtlAttr.OrgNo, value);
// }
//}
public string FK_SFTable
{
get
{
return this.GetValStrByKey(SFTableDtlAttr.FK_SFTable);
}
set
{
this.SetValByKey(SFTableDtlAttr.FK_SFTable, value);
}
}
public string BH
{
get
{
return this.GetValStrByKey(SFTableDtlAttr.BH);
}
set
{
this.SetValByKey(SFTableDtlAttr.BH, value);
}
}
public string Name
{
get
{
return this.GetValStrByKey(SFTableDtlAttr.Name);
}
set
{
this.SetValByKey(SFTableDtlAttr.Name, value);
}
}
public string ParentNo
{
get
{
return this.GetValStrByKey(SFTableDtlAttr.ParentNo);
}
set
{
this.SetValByKey(SFTableDtlAttr.ParentNo, value);
}
}
public int Idx
{
get
{
return this.GetValIntByKey(SFTableDtlAttr.Idx);
}
set
{
this.SetValByKey(SFTableDtlAttr.Idx, value);
}
}
#endregion 属性.
#region 构造方法
///
/// 访问权限
///
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
uac.IsInsert = false;
uac.IsUpdate = true;
uac.IsDelete = true;
return uac;
}
}
///
/// 系统字典表
///
public SFTableDtl()
{
}
///
/// EnMap
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("Sys_SFTableDtl", "系统字典表");
//FK_SFTable+"_"+BH
map.AddMyPK();
map.AddTBString(SFTableDtlAttr.FK_SFTable, null, "外键表ID", true, false, 0, 200, 20);
//map.AddTBString(SFTableDtlAttr.TableID, null, "TableID", true, false, 0, 200, 20);
map.AddTBString(SFTableDtlAttr.BH, null, "BH", true, false, 0, 200, 20);
map.AddTBString(SFTableDtlAttr.Name, null, "名称", true, false, 0, 200, 20);
map.AddTBString(SFTableDtlAttr.ParentNo, null, "父节点ID", true, false, 0, 200, 20);
//用户注销组织的时候,方便删除数据.
map.AddTBString(SFTableDtlAttr.OrgNo, null, "OrgNo", true, false, 0, 50, 20);
map.AddTBInt(SFTableDtlAttr.Idx, 0, "顺序号", false, false);
this._enMap = map;
return this._enMap;
}
}
#endregion
protected override bool beforeInsert()
{
//@hongyan 加标记的翻译.
if (DataType.IsNullOrEmpty(this.GetValStringByKey("OrgNo")) == true)
this.SetValByKey("OrgNo", BP.Web.WebUser.OrgNo);
if (DataType.IsNullOrEmpty(this.GetValStringByKey("BH")) == true)
this.SetValByKey("BH", DBAccess.GenerGUID());
this.setMyPK(this.GetValStringByKey("FK_SFTable") + "_" + this.GetValStringByKey("BH"));
return base.beforeInsert();
}
}
///
/// 系统字典表s
///
public class SFTableDtls : EntitiesMyPK
{
#region 构造
///
/// 系统字典表s
///
public SFTableDtls()
{
}
public SFTableDtls(string fk_sftable)
{
this.Retrieve(SFTableDtlAttr.FK_SFTable, fk_sftable);
}
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new SFTableDtl();
}
}
#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((SFTableDtl)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}