using System;
using System.Data;
using BP.DA;
using BP.En;
using BP.Sys;
using BP.WF;
namespace BP.WF.Template
{
///
/// SQL模板属性
///
public class SQLTemplateAttr:BP.En.EntityNoNameAttr
{
///
/// SQL
///
public const string Docs = "Docs";
///
/// NodeID
///
public const string SQLType = "SQLType";
}
///
/// SQL模板
///
public class SQLTemplate : EntityNoName
{
#region 属性
///
/// UI界面上的访问控制
///
public override UAC HisUAC
{
get
{
UAC uac = new UAC();
uac.OpenForSysAdmin();
return uac;
}
}
///
/// 打开的连接
///
public string Docs
{
get
{
string s= this.GetValStrByKey(SQLTemplateAttr.Docs);
if (DataType.IsNullOrEmpty(s) == true)
return this.No;
return s;
}
set
{
this.SetValByKey(SQLTemplateAttr.Docs, value);
}
}
#endregion
#region 构造函数
///
/// SQL模板
///
public SQLTemplate(){}
public SQLTemplate(string no):base(no.Replace( "\n","" ).Trim() )
{
}
///
/// 重写基类方法
///
public override Map EnMap
{
get
{
if (this._enMap != null)
return this._enMap;
Map map = new Map("WF_SQLTemplate", "SQL模板");
map.CodeStruct = "3";
map.AddTBStringPK(SQLTemplateAttr.No, null, "编号", true, true, 3, 3, 3);
map.AddDDLSysEnum(SQLTemplateAttr.SQLType, 0, "模版SQL类型", true, true, SQLTemplateAttr.SQLType,
"@0=方向条件@1=接受人规则@2=下拉框数据过滤@3=级联下拉框@4=PopVal开窗返回值@5=人员选择器人员选择范围");
map.AddDDLEntities("DBSrc", "local", "数据源", new SFDBSrcs(), true);
map.AddTBString(SQLTemplateAttr.Name, null, "SQL说明", true, false, 0, 200, 20,true);
map.AddTBStringDoc(SQLTemplateAttr.Docs, null, "SQL模版", true, false,true);
//查询条件.
map.AddSearchAttr(SQLTemplateAttr.SQLType);
this._enMap = map;
return this._enMap;
}
}
#endregion
}
///
/// SQL模板s
///
public class SQLTemplates: EntitiesNoName
{
#region 构造
///
/// 得到它的 Entity
///
public override Entity GetNewEntity
{
get
{
return new SQLTemplate();
}
}
///
/// SQL模板
///
public SQLTemplates()
{
}
#endregion
#region 查询与构造
#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((SQLTemplate)this[i]);
}
return list;
}
#endregion 为了适应自动翻译成java的需要,把实体转换成List.
}
}