[code] //添加子单据体
//1 获得父单据体对象
EntryEntity entity=this.View.BusinessInfo.GetEntryEntity("FEntity");
//2 获得父单据体行对象
DynamicObject currentParentEntityRow = this.Model.GetEntityDataObject(entity, i);
//3 获取子单据体对象
SubEntryEntity subentity = this.View.BusinessInfo.GetEntryEntity("FSubEntity") as SubEntryEntity;
var querySub = dt.AsEnumerable().Where(t => t["F_QXY_WULIAOID"].ToString() == strWLId);
DataTable dtSub = querySub.CopyToDataTable
for (int j = 0; j < dtSub.Rows.Count; j++)
{
DataRow drsub = dtSub.Rows[j];
this.View.Model.CreateNewEntryRow(currentParentEntityRow, subentity, j);
//供应商
this.View.Model.SetValue("FSubGYS", drsub["F_QXY_GONGYINGSHANGID"], j);
//税率
this.View.Model.SetValue("FSubSL", drsub["F_QXY_SHUILV"], j);
//含税单价
this.View.Model.SetValue("FSubHSDJ", drsub["F_QXY_HANSHUIPRICE"], j);
//报价数量
this.View.Model.SetValue("FSubBJSL", 22, j);[/code]在循环添加子单据体分录的时候,子单据体的分录可以加上,但是数据都没写上去,比如this.View.Model.SetValue("FSubBJSL", 22, j);,我直接赋值上去都不行。。。求解啊
推荐阅读