A单据事件:
//继承AbstractBillPlugIn
public void Addnewcustomer()
{
DynamicFormShowParameter showParameter = new DynamicFormShowParameter();
showParameter.FormId = "UAYT_HWKHSQ";
showParameter.PageId = Guid.NewGuid().ToString();
showParameter.ParentPageId = this.View.PageId;
showParameter.PermissionItemId = PermissionConst.View;
// showParameter.NoBusy = true;
//传递自定义参数
// showParameter.CustomParams.Add("FromId", "1");
//this.View.ShowForm(showParameter);
//获取返回来的数据
this.View.ShowForm(showParameter, new Action<FormResult>((formResult) =>
{
if (this.View.Model.DataObject["DocumentStatus"].ToString() != "C")
{
string customerId = null;
if (formResult != null && formResult.ReturnData != null)
{
customerId = formResult.ReturnData.ToString();
}
this.View.Model.SetValue("FCustomerId", customerId);
this.View.UpdateView("FCustomerId");
}
}));
}
-----------------------------------------------------------------------------------------------------------------------------------
B单据事件:
//继承AbstractBillPlugIn
public override void BeforeClosed(BeforeClosedEventArgs e)
{
this.ReturnData(e);
}
private void ReturnData(BeforeClosedEventArgs e)
{
//获取当前客户编码主键
string customerId = this.View.Model.DataObject["F_UAYT_KHBM_Id"].ToString();
this.View.ReturnToParentWindow(customerId); //返回数据给A单据
}
推荐阅读