Files
GateDge2023_ljy/03.珠海市汇威精密制造有限公司/HUIWEI.Lexmark.sftp.SDK/ASN/BillEventPlugInEx.cs
PastSaid fa480006a8 1
2024-07-16 10:33:50 +08:00

52 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}
}