代码摘要备注
var targetBillMeta = MetaDataServiceHelper.Load(this.Context, "YEA_ChinaPhone_SI") as FormMetadata;
BusinessInfo info = targetBillMeta.BusinessInfo;
//更新单据的数据列表
List
Kingdee.BOS.Core.Bill.IBillView billView = YEA.K3.MIS.APP.Core.CommonUtil.CreateBillView(this.Context,
YEA.K3.MIS.APP.Core.CommonUtil.GetFormMetadata(this.Context, "YEA_ChinaPhone_SI"));
//新增单据的数据列表
List
//TODO 后台未存在,需要新增单据
((IBillViewService)billView).LoadData();
this.FillBillPropertys(billView, dataRow);
saveObj.Add(billView.Model.DataObject);
//TODO 后台单据已存在,需要更新
object[] obs = { fid };
DynamicObject dynamicObject = BusinessDataServiceHelper.Load(this.Context, obs,
targetBillMeta.BusinessInfo.GetDynamicObjectType())[0];
UpdateData(dynamicObject, dataRow, info);
updateObj.Add(dynamicObject);
if (updateObj.Count > 0)
{
//批量保存
IOperationResult result = BusinessDataServiceHelper.Save(this.Context, targetBillMeta.BusinessInfo, updateObj.ToArray());
if (result != null)
{
foreach (OperateResult operateResult in result.OperateResult)
{
if (!operateResult.SuccessStatus)
{
string msg1 = operateResult.Message;
judgeStr.AppendLine(msg1);
}
}
}
}
推荐阅读