求解:移动表单保存出错。
1,357次浏览
编辑于2014年10月15日 10:36:47
//先构造单据体数据包集合,有多条单据体数据
DynamicObjectCollection dyEntitys = new DynamicObjectCollection(info.GetEntryEntity("FT_BD_CUSTLOCATION").DynamicObjectType);//标识
//DynamicObjectCollection dyEntitys = dt["BD_CUSTLOCATION"] as DynamicObjectCollection;//标识
//获取移动表单上的移动列表数据
DynamicObjectCollection mobileEntitys = this.Model.GetValue("FT_BD_CUSTLOCATION") as DynamicObjectCollection;//ORM实体名
//循环移动表单的移动列表,给单据体赋值
foreach (DynamicObject mobileEntity in mobileEntitys)
{
DynamicObject dyEntity = new DynamicObject(info.GetEntryEntity("BD_CUSTLOCATION").DynamicObjectType);
dyEntity["CONTACT"] = this.View.Model.GetValue("FCONTACT");//联系人
dyEntity["Job"] = this.View.Model.GetValue("FJob");//职务
dyEntity["OFFICEPHONE"] = this.View.Model.GetValue("FOFFICEPHONE");//办公电话
dyEntity["MOBILEPHONE"] = this.View.Model.GetValue("FMOBILEPHONE");//移动电话
dyEntitys.Add(dyEntity);
}
//明细信息单据体数据包构造好,加到单据数据包上
dt["BD_CUSTLOCATION"] = dyEntitys;
DynamicObjectCollection dyEntitys = new DynamicObjectCollection(info.GetEntryEntity("FT_BD_CUSTLOCATION").DynamicObjectType);//标识
//DynamicObjectCollection dyEntitys = dt["BD_CUSTLOCATION"] as DynamicObjectCollection;//标识
//获取移动表单上的移动列表数据
DynamicObjectCollection mobileEntitys = this.Model.GetValue("FT_BD_CUSTLOCATION") as DynamicObjectCollection;//ORM实体名
//循环移动表单的移动列表,给单据体赋值
foreach (DynamicObject mobileEntity in mobileEntitys)
{
DynamicObject dyEntity = new DynamicObject(info.GetEntryEntity("BD_CUSTLOCATION").DynamicObjectType);
dyEntity["CONTACT"] = this.View.Model.GetValue("FCONTACT");//联系人
dyEntity["Job"] = this.View.Model.GetValue("FJob");//职务
dyEntity["OFFICEPHONE"] = this.View.Model.GetValue("FOFFICEPHONE");//办公电话
dyEntity["MOBILEPHONE"] = this.View.Model.GetValue("FMOBILEPHONE");//移动电话
dyEntitys.Add(dyEntity);
}
//明细信息单据体数据包构造好,加到单据数据包上
dt["BD_CUSTLOCATION"] = dyEntitys;
推荐阅读