移动列表绑定数据后多行数据只显示一行数据
金蝶云社区-lilyxusi
lilyxusi
0人赞赏了该文章 678次浏览 未经作者许可,禁止转载编辑于2016年08月29日 10:00:15

移动表单添加了移动列表绑定数据后,数据库有多行数据列表界面只显示一行,代码如下,求大神指点迷津!

private void UpdateViewEntity()
{
OQLFilter ofilter = OQLFilter.CreateHeadEntityFilter(string.Format("FID = {0} AND FPRODUCTID={1}", _fid,_productId));
DynamicObject[] rows = BusinessDataServiceHelper.Load(base.Context, "KDY_PIS_T_PHY_COUNT", null, ofilter);
DynamicObjectCollection allRows = base.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
List formatCondition = new List();
Entity entity = base.View.BusinessInfo.GetEntity("FLISTENTITY");
base.View.Model.DeleteEntryData(entity.Key);
this.rowDic.Clear();
if (!rows.IsEmpty())
{
DynamicObjectCollection objs = rows.First()["FEntity"] as DynamicObjectCollection;
this.Model.BeginIniti();
int iRow = 0;
foreach (var obj in objs)
{
if (obj["ProductId_Id"].ToString() == _productId)
{
base.View.Model.CreateNewEntryRow(entity.Key);
allRows[iRow]["MedicineRackId"] = obj["MedicineRackId"];
allRows[iRow]["MedicineRackId_Id"] = obj["MedicineRackId_Id"];//货架
allRows[iRow]["CountNum"] = obj["CountNum"];//实盘数
allRows[iRow]["DrugStorage"] = (obj["DrugStorage"] as DynamicObject)["Name"].ToString().Split('\\')[0];
iRow++;
}
}
}
this.Model.EndIniti();
base.View.GetControl(entity.Key).setFormat(formatCondition);
IEntryState state = this.View.GetEntryState("FLISTENTITY");
state.CurrentPageIndex = 0;
this.View.UpdateView("FLISTENTITY");
}