1
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="PRD_MO\BillEventPlugInEx.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -117,5 +118,11 @@
|
||||
<Compile Include="SAL_SaleOrder\AdvanceShipmentNotification.cs" />
|
||||
<Compile Include="STK_InvAgeAnalyzeRpt\InvAgeAnalyzeOverrideEx.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\01.扩展\Extensions\ExtensionMethods.csproj">
|
||||
<Project>{beae0bf6-7ab9-4af5-83ce-d08e3c6880ef}</Project>
|
||||
<Name>ExtensionMethods</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
55
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/BillEventPlugInEx.cs
Normal file
55
03.珠海市汇威精密制造有限公司/HUIWEI/PRD_MO/BillEventPlugInEx.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using ExtensionMethods;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace HUIWEI.PRD_MO
|
||||
{
|
||||
[Description("测试"), HotUpdate]
|
||||
public class BillEventPlugInEx : AbstractDynamicFormPlugIn
|
||||
{
|
||||
private bool isNewData = false;
|
||||
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
base.BarItemClick(e);
|
||||
if (e.BarItemKey.Equals("tbSNew") || e.BarItemKey.Equals("tbNew"))
|
||||
{
|
||||
var openParameter = this.View.OpenParameter;
|
||||
var customerParams = openParameter.GetCustomParameters();
|
||||
var parameterData = this.View.Model.ParameterData;
|
||||
var billTypeField = this.View.BillBusinessInfo.GetBillTypeField();
|
||||
|
||||
var infos = billTypeField.BillTypeInfo;
|
||||
var info = (parameterData["BillTypeEntity"] as DynamicObjectCollection).FirstOrDefault(x => Convert.ToBoolean(x[4]));
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
SetBillTypeDefValue(billTypeField, info[5].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置单据类型默认值
|
||||
/// </summary>
|
||||
/// <param name="billTypeField"></param>
|
||||
/// <param name="defBillTypeId"></param>
|
||||
private void SetBillTypeDefValue(BillTypeField billTypeField, string defBillTypeId)
|
||||
{
|
||||
if (billTypeField != null && !string.IsNullOrWhiteSpace(defBillTypeId))
|
||||
{
|
||||
var billTypeObj = this.Model.LoadReferenceData(billTypeField.RefFormDynamicObjectType, defBillTypeId);
|
||||
billTypeField.RefIDDynamicProperty.SetValue(this.Model.DataObject, defBillTypeId);
|
||||
billTypeField.DynamicProperty.SetValue(this.Model.DataObject, billTypeObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user