using BP.DA;
using BP.En;
using BP.Sys;
namespace BP.WF.DTS
{
///
/// 生成模版的垃圾数据
///
public class AddIdxColForMapDtl : Method
{
///
/// 生成模版的垃圾数据
///
public AddIdxColForMapDtl()
{
this.Title = "为所有的从表增加一个隐藏的Id列.";
this.Help = "用户VSTO表单.";
this.GroupName = "系统维护";
}
///
/// 设置执行变量
///
///
public override void Init()
{
//this.Warning = "您确定要执行吗?";
//HisAttrs.AddTBString("P1", null, "原密码", true, false, 0, 10, 10);
//HisAttrs.AddTBString("P2", null, "新密码", true, false, 0, 10, 10);
//HisAttrs.AddTBString("P3", null, "确认", true, false, 0, 10, 10);
}
///
/// 当前的操纵员是否可以执行这个方法
///
public override bool IsCanDo
{
get
{
if (BP.Web.WebUser.IsAdmin == true)
return true;
return false;
}
}
///
/// 执行
///
/// 返回执行结果
public override object Do()
{
MapDtls dtls = new MapDtls();
dtls.RetrieveAll();
foreach (MapDtl item in dtls)
{
MapAttr ma = new MapAttr();
ma.setMyPK(item.No + "_Idx");
if (ma.IsExits == true)
continue;
ma.FrmID =item.No;
ma.setKeyOfEn("Idx");
ma.Name = "Idx";
ma.setLGType(FieldTypeS.Normal);
ma.setUIVisible(false);
ma.DefVal = "0";
ma.setMyDataType(DataType.AppInt);
ma.Insert();
GEDtl dtl = new GEDtl(item.No);
dtl.CheckPhysicsTable();
}
return "执行成功.";
}
}
}