using System;
using System.Collections;
using BP.DA;
using BP.En;
namespace BP.Sys
{
///
/// 表单元素扩展DB
///
public class FrmEleDBAttr : EntityMyPKAttr
{
///
/// RefPKVal
///
public const string RefPKVal = "RefPKVal";
///
/// EleID
///
public const string EleID = "EleID";
///
/// 主表
///
public const string FK_MapData = "FK_MapData";
///
/// FID
///
public const string FID = "FID";
///
/// Tag1
///
public const string Tag1 = "Tag1";
///
/// Tag2
///
public const string Tag2 = "Tag2";
///
/// Tag3
///
public const string Tag3 = "Tag3";
///
/// Tag4
///
public const string Tag4 = "Tag4";
///
/// Tag5
///
public const string Tag5 = "Tag5";
}
///
/// 表单元素扩展DB
///
public class FrmEleDB : EntityMyPK
{
#region 属性
///
/// EleID
///
public string EleID
{
get
{
return this.GetValStrByKey(FrmEleDBAttr.EleID);
}
set
{
this.SetValByKey(FrmEleDBAttr.EleID, value);
}
}
///
/// Tag1
///
public string Tag1
{
get
{
return this.GetValStringByKey(FrmEleDBAttr.Tag1);
}
set
{
this.SetValByKey(FrmEleDBAttr.Tag1, value);
}
}
///
/// Tag2
///
public string Tag2
{
get
{
return this.GetValStringByKey(FrmEleDBAttr.Tag2);
}
set
{
this.SetValByKey(FrmEleDBAttr.Tag2, value);
}
}
///
/// Tag3
///
public string Tag3
{
get
{
return this.GetValStringByKey(FrmEleDBAttr.Tag3);
}
set
{
this.SetValByKey(FrmEleDBAttr.Tag3, value);
}
}
///
/// Tag4
///
public string Tag4
{
get
{
return this.GetValStringByKey(FrmEleDBAttr.Tag4);
}
set
{
this.SetValByKey(FrmEleDBAttr.Tag4, value);
}
}
///
/// Tag5
///
public string Tag5
{
get
{
return this.GetValStringByKey(FrmEleDBAttr.Tag5);
}
set
{
this.SetValByKey(FrmEleDBAttr.Tag5, value);
}
}
///
/// FK_MapData
///
public string FK_MapData
{
get
{
return this.GetValStrByKey(FrmEleDBAttr.FK_MapData);
}
set
{
this.SetValByKey(FrmEleDBAttr.FK_MapData, value);
}
}
public void setFK_MapData(string val)
{
this.SetValByKey(FrmEleDBAttr.FK_MapData, val);
}
///
/// RefPKVal
///
public string RefPKVal
{
get
{
return this.GetValStrByKey(FrmEleDBAttr.RefPKVal);
}
set
{
this.SetValByKey(FrmEleDBAttr.RefPKVal, value);
}
}
///
/// 流程ID
///
public Int64 FID
{
get
{
return this.GetValInt64ByKey(FrmEleDBAttr.FID);
}
set
{
this.SetValByKey(FrmEleDBAttr.FID, value);
}
}
#endregion
#region 构造方法
///
/// 表单元素扩展DB
///
public FrmEleDB()
{
}
///
/// 表单元素扩展DB
///
///
public FrmEleDB(string mypk)
{
this.setMyPK(mypk);
this.Retrieve();
}
///
/// EnMap
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("Sys_FrmEleDB","表单元素扩展DB");
map.IndexField = FrmEleDBAttr.RefPKVal;
map.AddMyPK();
map.AddTBString(FrmEleDBAttr.FK_MapData, null, "FK_MapData", true, false, 1, 100, 20);
map.AddTBString(FrmEleDBAttr.EleID, null, "EleID", true, false, 0, 50, 20);
map.AddTBString(FrmEleDBAttr.RefPKVal, null, "RefPKVal", true, false, 0, 50, 20);
map.AddTBInt(FrmEleDBAttr.FID, 0, "FID", false, true);
map.AddTBString(FrmEleDBAttr.Tag1, null, "Tag1", true, false, 0, 1000, 20);
map.AddTBString(FrmEleDBAttr.Tag2, null, "Tag2", true, false, 0, 1000, 20);
map.AddTBString(FrmEleDBAttr.Tag3, null, "Tag3", true, false, 0, 1000, 20);
map.AddTBString(FrmEleDBAttr.Tag4, null, "Tag4", true, false, 0, 1000, 20);
map.AddTBString(FrmEleDBAttr.Tag5, null, "Tag5", true, false, 0, 1000, 20);
this._enMap = map;
return this._enMap;
}
}
#endregion
protected override bool beforeUpdateInsertAction()
{
//this.setMyPK(this.FK_MapData + "_" + this.EleID + "_" + this.RefPKVal;
// this.GenerPKVal();
return base.beforeUpdateInsertAction();
}
public void GenerPKVal()
{
this.setMyPK(this.FK_MapData + "_" + this.EleID + "_" + this.RefPKVal);
}
}
///
/// 表单元素扩展DBs
///
public class FrmEleDBs : EntitiesMyPK
{
#region 构造
///
/// 表单元素扩展DBs
///
public FrmEleDBs()
{
}
///
/// 表单元素扩展DBs
///
///
///
public FrmEleDBs(string fk_mapdata, string pkval)
{
this.Retrieve(FrmEleDBAttr.FK_MapData, fk_mapdata, FrmEleDBAttr.EleID, pkval);
}
///
/// 表单元素扩展DBs
///
/// s
public FrmEleDBs(string fk_mapdata)
{
if (BP.Difference.SystemConfig.IsDebug)
this.Retrieve(MapAttrAttr.FK_MapData, fk_mapdata);
else
this.RetrieveFromCash(MapAttrAttr.FK_MapData, (object)fk_mapdata);
}
public void SaveFrmEleDBs(string fk_mapdata,string eleID,string refPKVal,string paras)
{
if (DataType.IsNullOrEmpty(paras) == true)
return;
string[] strs = paras.Split(';');
FrmEleDB frmEleDB = null;
foreach(string str in strs)
{
string[] vals = str.Split(',');
frmEleDB =new FrmEleDB();
frmEleDB.setMyPK(eleID + "_" + refPKVal + "_" + vals[0]);
frmEleDB.setFK_MapData(fk_mapdata);
frmEleDB.EleID = eleID;
frmEleDB.RefPKVal = refPKVal;
frmEleDB.Tag1 = vals[0];
if (vals.Length >=2 && DataType.IsNullOrEmpty(vals[1])==false)
frmEleDB.Tag2 = vals[1];
else
frmEleDB.Tag2 = "";
if (vals.Length==3)
frmEleDB.Tag3 = vals[2];
frmEleDB.Save();
}
}
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new FrmEleDB();
}
}
#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((FrmEleDB)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}