Example #1
0
        private static SOARolePropertiesQueryParamCollection CreateQueryParams(SOARolePropertyDefinitionCollection propertyDefines, IWfProcess process)
        {
            SOARolePropertiesQueryParamCollection queryParams = new SOARolePropertiesQueryParamCollection();

            WfApplicationParametersContext apContext = WfApplicationParametersContext.Current;

            //如果是审批矩阵,只取第一列作为条件
            if (propertyDefines.MatrixType == WfMatrixType.ApprovalMatrix)
            {
                if (propertyDefines.Count > 0)
                {
                    SOARolePropertyDefinition pd = propertyDefines[0];

                    object arpValue = GetQueryValueFromContext(pd, process);

                    queryParams.Add(new SOARolePropertiesQueryParam()
                    {
                        QueryName  = pd.Name,
                        QueryValue = arpValue
                    });
                }
            }
            else
            {
                //活动矩阵和角色矩阵,排除保留字
                foreach (SOARolePropertyDefinition pd in propertyDefines)
                {
                    //是否是可查询的列
                    if (IsQueryableColumn(pd, propertyDefines))
                    {
                        object arpValue = GetQueryValueFromContext(pd, process);

                        queryParams.Add(new SOARolePropertiesQueryParam()
                        {
                            QueryName  = pd.Name,
                            QueryValue = arpValue
                        });
                    }
                }
            }

            return(queryParams);
        }
        private static SOARolePropertiesQueryParamCollection CreateQueryParams(SOARolePropertyDefinitionCollection propertyDefines, IWfProcess process)
        {
            SOARolePropertiesQueryParamCollection queryParams = new SOARolePropertiesQueryParamCollection();

            WfApplicationParametersContext apContext = WfApplicationParametersContext.Current;

            //如果是审批矩阵,只取第一列作为条件
            if (propertyDefines.MatrixType == WfMatrixType.ApprovalMatrix)
            {
                if (propertyDefines.Count > 0)
                {
                    SOARolePropertyDefinition pd = propertyDefines[0];

                    object arpValue = GetQueryValueFromContext(pd, process);

                    queryParams.Add(new SOARolePropertiesQueryParam()
                    {
                        QueryName = pd.Name,
                        QueryValue = arpValue
                    });
                }
            }
            else
            {
                //活动矩阵和角色矩阵,排除保留字
                foreach (SOARolePropertyDefinition pd in propertyDefines)
                {
                    //是否是可查询的列
                    if (IsQueryableColumn(pd, propertyDefines))
                    {
                        object arpValue = GetQueryValueFromContext(pd, process);

                        queryParams.Add(new SOARolePropertiesQueryParam()
                        {
                            QueryName = pd.Name,
                            QueryValue = arpValue
                        });
                    }

                }
            }

            return queryParams;
        }