获取单据返回的数据时报错
金蝶云社区-Meliodas
Meliodas
1人赞赏了该文章 1,736次浏览 未经作者许可,禁止转载编辑于2017年01月06日 14:07:42


错误信息如图;

代码如下

父界面代码:
int RR = row + 1;
BillShowParameter showParam = new BillShowParameter();
showParam.FormId = "KD_WLCFJS"; //关联表单
showParam.CustomParams.Add("FMa", FMaterial); //物料编码
showParam.CustomParams.Add("FSu", FSupplier); //把选中供应商的值传递给动态表单
showParam.CustomParams.Add("FPriceUnitId", FPriceUnitId); //计量单位
showParam.CustomParams.Add("FTaxRate", FTaxRate.ToString()); //计量单位
showParam.CustomParams.Add("FvaluationUnitID", FvaluationUnit); //结算币别
showParam.CustomParams.Add("F_PAEZ_PO", FBillNo); //PO单号
showParam.CustomParams.Add("RO", RR.ToString()); //PO行号
showParam.CustomParams.Add("JGF", JGF.ToString()); //PO行号

//this.View.ShowForm(showParam);
this.View.ShowForm(showParam, //调用ShowForm
new Action((formResult) =>
{

if (formResult != null && formResult.ReturnData != null)
{

this.View.Model.SetValue("FTaxPrice", ((S150804ReturnInfo)formResult.ReturnData).FOpenBankName, row);
this.View.InvokeFieldUpdateService("FTaxPrice", 0);
// this.View.Model.SetValue("F_PAEZ_Price", ((S150804ReturnInfo)formResult.ReturnData).FOpenBankName, row);
}//获取从动态表单传递过来的值
}));

子界面代码 :

S150804ReturnInfo returnInfo = new S150804ReturnInfo(); //调用返回数据的方法
returnInfo.FOpenBankName = FPRI; // 返回获取到的单据体上的数据
this.View.ReturnToParentWindow(new FormResult(returnInfo)); // 把数据对象,返回给父界面
this.View.InvokeFormOperation(FormOperationEnum.Save);
this.View.Close();

S150804ReturnInfo 方法 :

///


/// 定义由子窗体返回给父窗体的数据对象
///

class S150804ReturnInfo
{
public Decimal FOpenBankName { get; set; }
//public string FBankCode { get; set; }
//public string FSupplier { get; set; }
//public string FBankHolder { get; set; }
}