Files
GateDge2023_ljy/03.珠海市汇威精密制造有限公司/HUIWEI.Lexmark.sftp.SDK/ASN/BillEventPlugInEx.cs

52 lines
1.5 KiB
C#
Raw Normal View History

2024-07-16 10:33:50 +08:00
using Kingdee.BOS.App;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.ServiceHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HUIWEI.Lexmark.sftp.SDK.ASN
{
public class BillEventPlugInEx : AbstractOperationServicePlugIn
{
private void TestLoad()
{
//例如保存id为10001的物料
//获取元数据服务
//MetaDataServiceHelper
IMetaDataService metadataService = ServiceHelper.GetService<IMetaDataService>();
//获取保存服务
ISaveService saveService = ServiceHelper.GetService<ISaveService>();
//获取加载数据服务
IViewService viewService = ServiceHelper.GetService<IViewService>();
//获取物料元数据
FormMetadata materialMetadata = metadataService.Load(this.Context, "ora_SftpOperationRecord") as FormMetadata;
var dynaicObjType = materialMetadata.BusinessInfo.GetDynamicObjectType();
var newObj = new DynamicObject(dynaicObjType);
//获取id为10001的物料数据
DynamicObject[] objs = viewService.Load(this.Context, new object[] { 10001 }, dynaicObjType);
//保存id为10001的物料
saveService.Save(this.Context, materialMetadata.BusinessInfo, objs);
}
}
}