如何在this.View.Close();后不触发BeforeClosed事件啊
金蝶云社区-Meliodas
Meliodas
0人赞赏了该文章 1,239次浏览 未经作者许可,禁止转载编辑于2017年11月16日 14:51:03

如题 !
现在在做一个开发,在主界面点击按钮后弹出界面 返回界面数据;
然后有两种情况第一种是点击确认或者退出按钮返回界面
第二种是直接关闭界面,但是关闭界面的时候希望可以返回空值;
就在BeforeClosed事件中写了代码 但是这样只要调用 this.View.Close(); 就会触发BeforeClosed事件;
请问有什么办法可以在this.View.Close();后跳过BeforeClosed事件么

代码如下:

[Description("动态单界面插件")]
public class TCDJM : AbstractDynamicFormPlugIn
{
///


/// 主菜单单击时权限判断
///

///
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
if (e.BarItemKey.Equals("tbButton"))
{
bool FSFExistTOP = (bool)this.View.Model.GetValue("FSFExistTOP");
DynamicObject FSCYGBM = (DynamicObject)this.View.Model.GetValue("FSCYGBM");
if (FSCYGBM != null && FSFExistTOP==true)
{
String FSCYGBMID = FSCYGBM["ID"].ToString();
long FBJCS = (long)this.View.Model.GetValue("FBJCS");
S150804ReturnInfo returnInfo = new S150804ReturnInfo(); //调用返回数据的方法
returnInfo.FOpenBankName = FSFExistTOP; // 返回获取到的单据体上的数据
returnInfo.FSCYGBM = FSCYGBMID; // 返回获取到的单据体上的数据
returnInfo.FBJCS = FBJCS; // 返回获取到的单据体上的数据
this.View.ReturnToParentWindow(new FormResult(returnInfo)); // 把数据对象,返回给父界面
this.View.Close();
}
else
{
this.View.ShowErrMessage("存在必录字段为空!操作取消!");
e.Cancel = true;
}
}else
if (e.BarItemKey.Equals("tbClose"))
{
S150804ReturnInfo returnInfo = new S150804ReturnInfo(); //调用返回数据的方法
returnInfo.FOpenBankName = false; // 返回获取到的单据体上的数据
returnInfo.FSCYGBM = null; // 返回获取到的单据体上的数据
returnInfo.FBJCS = 1; // 返回获取到的单据体上的数据
this.View.ReturnToParentWindow(new FormResult(returnInfo)); // 把数据对象,返回给父界面
this.View.Close();
}
}
///
/// 页面关闭之前触发
///

///
public override void BeforeClosed(BeforeClosedEventArgs e)
{
S150804ReturnInfo returnInfo = new S150804ReturnInfo(); //调用返回数据的方法
returnInfo.FOpenBankName = false; // 返回获取到的单据体上的数据
returnInfo.FSCYGBM = null; // 返回获取到的单据体上的数据
returnInfo.FBJCS = 1; // 返回获取到的单据体上的数据
this.View.ReturnToParentWindow(new FormResult(returnInfo)); // 把数据对象,返回给父界面
//this.View.Close();
}
}

您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0