a
This commit is contained in:
56
GZ.LJY00001.HuiWei/GAT_zpjjlr/BillEventPlugInEx.cs
Normal file
56
GZ.LJY00001.HuiWei/GAT_zpjjlr/BillEventPlugInEx.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace GZ.LJY00001.HuiWei.GAT_zpjjlr
|
||||
{
|
||||
[HotUpdate, Description("装配计件录入表单插件")]
|
||||
public class BillEventPlugInEx : AbstractDynamicFormPlugIn
|
||||
{
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
base.DataChanged(e);
|
||||
if (e.Field.Key.ToUpperInvariant().Equals("F_YGNO3"))
|
||||
{
|
||||
var ygNo = e.NewValue.Long2Int();
|
||||
var isSyq = 0;
|
||||
var hw_xygzjj_id = 0;
|
||||
|
||||
if (ygNo > 0)
|
||||
{
|
||||
var date = this.View.Model.GetValue("F_DATE").ToString();
|
||||
var sql = $@"/*dialect*/
|
||||
|
||||
SELECT t0e.F_YGNM,CASE t0e.F_ISSYQ WHEN '是' THEN 1 ELSE 0 END 'ISSYQ',ISNULL(t1.FID,0) hw_xygzjj_id
|
||||
FROM GAT_YGCQ t0
|
||||
INNER JOIN GAT_YGCQs t0e on t0.FID = t0e.FID
|
||||
LEFT JOIN hw_xygzjj t1 on t1.F_YGID = t0e.F_YGNM
|
||||
WHERE t0.F_Date = '{date}'
|
||||
AND t0e.F_YGNM = {ygNo}
|
||||
|
||||
";
|
||||
|
||||
var result = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
var data = result[0];
|
||||
isSyq = data["ISSYQ"].Long2Int();
|
||||
hw_xygzjj_id = data["hw_xygzjj_id"].Long2Int();
|
||||
}
|
||||
}
|
||||
|
||||
this.View.Model.SetValue("FIsSYQ", isSyq, e.Row);
|
||||
this.View.Model.SetItemValueByID("FxygjjdjbId", hw_xygzjj_id, e.Row);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user