移动代理字段值更新
金蝶云社区-Zw814
Zw814
0人赞赏了该文章 850次浏览 未经作者许可,禁止转载编辑于2016年11月22日 15:36:41

新建的移动单据,字段都是从源单直接拖过来的移动代理字段,没有值更新这些,写插件实现,断点跳不进DataChanged

using Kingdee.BOS.Mobile.PlugIn;
using Kingdee.BOS.Mobile.PlugIn.ControlModel;
using System;
using Kingdee.BOS.App.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Mobile.Const;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Orm.DataEntity;
using System.Data;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Mobile;
using Kingdee.BOS.Core.Metadata.FieldElement;

namespace SHJ.K3.AMB.AMB.Bussiness.PlugIn
{
public class TotalAddValueMobile : AbstractMobileBillPlugin
{
#region 值更新
///


///
///

///
public override void DataChanged(DataChangedEventArgs e)
{
#region 变量定义
decimal dNormalWorkTime = 0, dWorkOverTime = 0;
object objValue = null;
#endregion
try
{
base.DataChanged(e);
this.Model.BeginIniti();
if (e.Field.Key.ToUpper().Equals("FNORMALWORKTIME".ToUpper()) || e.Field.Key.ToUpper().Equals("FWORKOVERTIME".ToUpper()))
{
objValue = this.Model.GetValue("FNORMALWORKTIME");
dNormalWorkTime = (objValue == null ? 0 : Convert.ToDecimal(objValue)); //正常工作时间
objValue = this.Model.GetValue("FWORKOVERTIME");
dWorkOverTime = (objValue == null ? 0 : Convert.ToDecimal(objValue)); //加班时间
this.Model.SetValue("FSUMMARYTIME",dNormalWorkTime+dNormalWorkTime);
}
this.Model.EndIniti();
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}