动态表单关闭后不能刷新父窗体数据
金蝶云社区-云社区用户z1U39066
云社区用户z1U39066
0人赞赏了该文章 2,089次浏览 未经作者许可,禁止转载编辑于2016年05月13日 11:35:50

各位老师,我做了一个BOS单据,然后通过按钮打开一个动态表单界面。然后通过双击将动态表单表体的行将数据返回到父窗体。所有功能基本都已经实现,但是就是在动态窗体关闭后,父窗体控件的数据不会跟着刷新,需要在父窗体点保存或者在分录上双击一下数据才会出现。BOS界面


动态表单界面

双击选择动态表单的行后数据返回给主窗体并且动态表单关闭。关闭后父窗体的数据不会变化。


需要点击保存或者在分录双击一下,数据才会出现



//----------------------代码如下
父窗体返回的代码

public override void AfterButtonClick(AfterButtonClickEventArgs e)
{
base.AfterButtonClick(e);
if (e.Key.ToUpper() == "FBTNCHECK")
{
DynamicFormShowParameter showParameter = new DynamicFormShowParameter();
showParameter.FormId = "HZ_TransferSelection";
showParameter.ParentPageId = this.View.ParentFormView.PageId;
string FSendPlace = (View.Model.GetValue("FSendPlace") as DynamicObject)["Id"].ToString();
string FArrivePlace = (View.Model.GetValue("FArrivePlace") as DynamicObject )["Id"].ToString();
showParameter.CustomParams.Add("FSendPlace", FSendPlace);
showParameter.CustomParams.Add("FArrivePlace", FArrivePlace);
string Unit2Qty = "";
for (int i = 0; i <= this.View.Model.GetEntryRowCount("FEntity") - 1; i++)
{
Unit2Qty = Unit2Qty + (this.View.Model.GetValue("FSUMUNITID", i) as DynamicObject)["ID"].ToString() + '/';
Unit2Qty = Unit2Qty + this.View.Model.GetValue("FSUMQTY", i) + ';';
}
showParameter.CustomParams.Add("FUnit2Qty", Unit2Qty);
this.View.ShowForm(showParameter,
new Action((formResult) =>
{
if (formResult.ReturnData != null)
{

string strSql = "EXEC STKD_P_TranferSelection '" + FSendPlace + "','" + FArrivePlace + "','" + Unit2Qty + "'," + ((STKD.HZ.TransferSelectionPlunIn.S150804ReturnInfo)(formResult.ReturnData)).JD_Text;
DataSet dsCheck = DBServiceHelper.ExecuteDataSet(this.Context, strSql);

for (int i = 0; i <= this.View.Model.GetEntryRowCount("FEntity") - 1; i++)
{
string unit = (this.View.Model.GetValue("FSumUnitID", i) as DynamicObject)["Id"].ToString();
foreach (DataRow mDr in dsCheck.Tables[0].Rows)
{
if (mDr["FUNITID"].ToString() == unit)
{
this.View.Model.SetValue("FPrice", mDr["FPRICE"].ToString(), i);
this.View.Model.SetValue("FAmount", mDr["FAmount"].ToString(), i);

}
}
}
this.View.Model.SetValue("FSupplierID",
((STKD.HZ.TransferSelectionPlunIn.S150804ReturnInfo)(formResult.ReturnData)).JD_Text, 0);
this.View.UpdateView("FEntity");
this.View.UpdateView("FSupplierID");
}
}));
}
}