lpawuu 发表于 2014-11-30 11:18:28

.Net UAP表单开发 重写ReceiptPluginBase中的方法不生效

本帖最后由 lpawuu 于 2014-11-30 11:22 编辑

按照开发文档的说法
表单开发访问模型对象的接口UFIDA.U8.UAP.UI.Runtime.Model.ReceiptPluginBase,该接口被定义在UFIDA.U8.UAP.UI.Runtime.Model.dll中,所以在做表单开发前,你需要为新建的表单开发项目添加UFIDA.U8.UAP.UI.Runtime.Model.dll的引用。表单开发又可细分为表单功能开发和表单实体功能开发,每个不同部分的开发又都分为UAP已有按钮的功能修改开发和新增按钮的功能开发。目前为止,只要是表单开发,只需要实现上述类即可。在继承ReceiptPluginBase后,在子类中会重写(override)以下这些方法:using System;
using System.Collections.Generic;
using System.Text;
using UFIDA.U8.UAP.UI.Runtime.Model;
using UFIDA.U8.UAP.UI.Runtime.Common;
using System.Windows.Forms;

namespace RuiGe
{
    public class SalesContract : ReceiptPluginBase
    {
      /// <summary>
      /// 按钮事件入口
      /// </summary>
      /// <param name="ButtonArgs"></param>
      /// <param name="voucherObject"></param>
      /// <returns></returns>
      public override IButtonEventHandler GetButtonEventHandler(UFIDA.U8.UAP.UI.Runtime.Common.VoucherButtonArgs ButtonArgs, VoucherProxy voucherObject)
      {
            MessageBox.Show("IButtonEventHandler ");

            return null;
      }

      /// <summary>
      /// 值更新之前的接口,对值的合法性检查在这里进行
      /// <param name="para">Cell的值变动参数</param>
      /// <param name="businessObject">所属业务对象</param>
      /// <param name="voucherObject">所属表单对象</param>
      /// <return>是否允许更新单元格的值,false--不允许更新,将保持原值</return>
      /// </summary>
      public override bool CellChanging(UFIDA.U8.UAP.UI.Runtime.Common.CellChangeEventArgs para, BusinessProxy businessObject, VoucherProxy voucherObject)
      {
            MessageBox.Show("CellChanging");
            return false;
      }
      /// <summary>
      /// 值更新之后的接口,对值的后续处理(如对其他Cell值的变更)在这里进行
      /// <param name="para">Cell的值变动参数</param>
      /// <param name="businessObject">所属业务对象</param>
      /// <param name="voucherObject">所属表单对象</param>
      /// </summary>
      public override void CellChanged(UFIDA.U8.UAP.UI.Runtime.Common.CellChangeEventArgs para, BusinessProxy businessObject, VoucherProxy voucherObject)
      {

            MessageBox.Show("CellChanged");
      }
    }
}

以上 GetButtonEventHandler 按钮的方法能正常调用 但是在操作表单的时候 CellChanging 和 CellChanged 没调用到
求高手求解啊

调皮的小五郎 发表于 2014-11-30 15:23:49


http://www.jinjidejuren.tv/doupocangqiong/

姐姐又在这里水经验了。。。不说了。。。睡觉去了

lpawuu 发表于 2014-12-1 09:13:28

不能沉~没人知道吗?

jojo_bj 发表于 2015-5-19 13:08:04

本帖最后由 jojo_bj 于 2015-5-19 13:16 编辑

方法前加

jayjd1234 发表于 2015-6-15 11:26:32

学习学习, 呵呵.

ccwh 发表于 2015-11-9 14:09:55

你需要在GetButtonEventHandler中判断ButtonKey值,不同的Key值执行不同的操作,最好把你自己那个按钮要做到是单独放在一个IButtonEventHandler类中,然后GetButtonEventHandler中在new一个新的IButtonEventHandler,这样就自然关联了。
页: [1]
查看完整版本: .Net UAP表单开发 重写ReceiptPluginBase中的方法不生效