目前做了一个开发~在动态表单中点击按钮弹出单据,数据取动态表单数据。弹出之后想锁定一些字段,但是无论怎么试都是不生效的代码如下:
///
/// 动态表单加载数据完成之后,需要处理的功能
///
///
public override void AfterCreateNewData(EventArgs e)
{
String[] YG = YGList.Split('-');
String[] Type = TypeList.Split('-');
String[] TC = TCList.Split('-');
String[] ZZ = ZZList.Split('-');
String[] TCJE = TCJEList.Split('-');
String[] JT = JTList.Split('-');
String[] JTED = JTEDList.Split('-');
var row = YG.Count();
this.View.Model.SetValue("FTCLX", DJTYPE);
this.View.Model.SetValue("FSETTLEORGID", FOrgId);
this.View.Model.SetValue("FPAYORGID", FOrgId);
var rowdate = this.View.Model.GetEntryRowCount("FEntity");
if (row-1 >= rowdate)
{
this.Model.BatchCreateNewEntryRow("FEntity", row - 1 - rowdate);
this.View.UpdateView("FEntity");
}
Decimal FSKHJAmount = 0;
Decimal FTCHJAmount = 0;
for (int i = 1; i < row; i++)
{
this.View.Model.SetValue("FRECTUNIT", YG[i],i-1);
this.View.Model.SetValue("FTCType", Type[i], i - 1);
this.View.Model.SetValue("FSKAmount", ZZ[i], i - 1);
this.View.Model.SetValue("FTCBL", TC[i], i - 1);
this.View.Model.SetValue("FTCAmount", TCJE[i], i - 1);
this.View.Model.SetValue("FJD", JT[i], i - 1);
this.View.Model.SetValue("FJDTE", JTED[i], i - 1);
Decimal FSKAmount = Convert.ToDecimal(ZZ[i]);
Decimal FTCAmount = Convert.ToDecimal(TCJE[i]);
FSKHJAmount = FSKHJAmount + FSKAmount;
FTCHJAmount = FTCHJAmount + FTCAmount;
this.View.GetFieldEditor("FJD", i - 1).Enabled = false;
this.View.GetFieldEditor("FTCType", i - 1).Enabled = false;
this.View.GetFieldEditor("FSKAmount", i - 1).Enabled = false;
this.View.GetFieldEditor("FJDTE", i - 1).Enabled = false;
this.View.LockField("FJD", false);
this.View.UpdateView();
}
this.Model.BeginIniti();
this.View.Model.SetValue("FaggregateAmount", FSKHJAmount);
this.View.Model.SetValue("FTCHJAmount", FTCHJAmount);
this.Model.EndIniti();
this.View.UpdateView();
this.View.LockField("FTCLX", false);
}
推荐阅读