private CommandStateBase Controller_PrepareCommandState(IWfProcess process)
        {
            DynamicFormCommandState state = null;

            //从流程上下文中获取数据。在这里通过流程上下文保存表单数据,省去了单独建表存储的工作
            //var data = DynamicFormDataAdapter.Instance.Load(process.ResourceID, false); //(string)process.RootProcess.Context["appData"];;

            string strData = (string)process.RootProcess.Context["appData"];

            if (strData.IsNullOrEmpty())
            {
                DynamicFormData data = new DynamicFormData();

                //data.Properties = null;

                state = new DynamicFormCommandState()
                {
                    Data = data
                };

                process.GenerateCandidatesFromResources();
            }
            else
            {
                var data = SerializationHelper.DeserializeStringToObject(strData, SerializationFormatterType.Binary) as DynamicFormData;
                return(new DynamicFormCommandState()
                {
                    Data = data
                });
            }

            return(state);
        }
        private CommandStateBase Controller_PrepareCommandState(IWfProcess process)
        {
            DynamicFormCommandState state = null;

            //从流程上下文中获取数据。在这里通过流程上下文保存表单数据,省去了单独建表存储的工作
            //var data = DynamicFormDataAdapter.Instance.Load(process.ResourceID, false); //(string)process.RootProcess.Context["appData"];;

            string strData = (string)process.RootProcess.Context["appData"];
            
            if (strData.IsNullOrEmpty())
            {
                DynamicFormData data = new DynamicFormData();
            
                //data.Properties = null;

                state = new DynamicFormCommandState() { Data = data };

                process.GenerateCandidatesFromResources();
            }
            else
            {
                var data = SerializationHelper.DeserializeStringToObject(strData, SerializationFormatterType.Binary) as DynamicFormData;
                return new DynamicFormCommandState() { Data = data };
            }

            return state;
        }