[K/3Cloud] 调用其他界面时通过Session传递对象参数

DynamicFormShowParameter参数的CustomParams参数列表只支持string类型的参数,对于复杂参数的传递需要通过单据View对象的共享Session来完成,如:

在调用界面调用目标界面之前将参数值加入共享Session

this.View.Session[key] = value;
this.View.ShowForm(param, CallbackFunc);

在目标界面中取用并及时清除

this.View.ParentFormView.Session.TryGetValue(sessionKey, out sessionObject)

// 取值完毕后及时清除,避免占用内存(根据需要处理)

this.View.ParentFormView.Session[sessionKey] = null;
this.View.ParentFormView.Session.Remove(sessionKey);

原文地址:https://www.cnblogs.com/fyq891014/p/4188826.html