在需要返回數據的地方調用表單返回方法完成數據返回 this.View.ReturnToParentWindow(retData); 在調用界面的回調函數中取出返回結果的ReturnData即可使用。 例如: 在動態表單的按鈕事件中調用此方法
//確定按鈕事件 private void SaveClaimerAndDate() { string errMsg = Check(); if (!string.IsNullOrWhiteSpace(errMsg)) { this.View.ShowErrMessage(errMsg); } else { this.View.ReturnToParentWindow(SetDateAndClaimer()); this.View.Close(); } }
在調用界面的回調函數中取數:
private void GetSale() { ListShowParameter listpara = new ListShowParameter(); listpara.FormId = Topview.FT.Common.Core.FTConst.SALECONTRACT_FORMID;//外銷合同 listpara.ParentPageId = this.View.PageId; listpara.MultiSelect = false; listpara.IsShowApproved = true; listpara.OpenStyle.CacheId = listpara.PageId; listpara.IsLookUp = true; //F7 this.View.ShowForm(listpara, new Action<FormResult>((result) => { object data = result.ReturnData; if (data is ListSelectedRowCollection) { ListSelectedRowCollection listData = data as ListSelectedRowCollection; if (listData != null && listData.Count > 0) { DynamicObject dy = CommonCoreUtils.GetDateFromFID(this.Context, Topview.FT.Common.Core.FTConst.RECEIVEREGISTRATION, "FID", listData[0].PrimaryKeyValue, "FBILLNO"); this.Model.SetValue("FSaleContractId", dy["FBILLNO"]); } } } )); }