Esempio n. 1
0
        private ParamObject[] GetParamArray(ArrayList arrParams)
        {
            ParamObject[] result = null;

            if (arrParams != null)
            {
                result = new ParamObject[arrParams.Count];

                for (int i = 0; i < arrParams.Count; i++)
                {
                    EXP_TreeNode node = (EXP_TreeNode)arrParams[i];

                    result[i] = new ParamObject(VExp(node), node._Position);
                }
            }

            return(result);
        }
Esempio n. 2
0
		private ParamObject[] GetParamArray(ArrayList arrParams)
		{
			ParamObject[] result = null;

			if (arrParams != null)
			{
				result = new ParamObject[arrParams.Count];

				for (int i = 0; i < arrParams.Count; i++)
				{
					EXP_TreeNode node = (EXP_TreeNode)arrParams[i];

					result[i] = new ParamObject(VExp(node), node._Position);
				}
			}

			return result;
		}
Esempio n. 3
0
		private static object DoUserFunction(string strFuncName, ParamObject[] arrParams, ParseExpression parseObj)
		{
			object oValue = null;

			switch (strFuncName.ToLower())
			{
				case "organizations":
				case "users":
				case "groups":
					oValue = strFuncName.ToUpper();
					break;
				//人员级别判定
				case "userrank":
					ExceptionHelper.TrueThrow<ApplicationException>(arrParams.Length != 2, "函数" + strFuncName + "参数个数有误!");
					if (arrParams.Length == 2)
					{
						//string 
						oValue = UserRank(AddDoubleQuotationMark(arrParams[0].Value.ToString()), arrParams[1].Value.ToString());
					}
					break;
				//当前人员Guid
				case "curuserid":
					oValue = "001416f3-f108-454e-9033-62b5a300e347";
					break;

				//当前人员级别
				case "curuserrank":
					oValue = "NAVVY_U";
					break;
				//本关区
				case "curcustomsscope":
					//oValue = ObjectID(arrParams[0].Value.ToString());
					break;
				//本部门
				case "curdepartscope":
					//oValue = CurObjetBelongTo(arrParams[0].Value.ToString());
					break;
				//自定机构服务范围
				case "userdefinescope":
					//oValue = CurRankLevel();
					break;

				//人员级别名称
				case "userrankname":
					oValue = UserRankName(arrParams[0].Value.ToString());
					break;
				//得到表达式中对人员级别的限定信息
				case "getuserrank":
					oValue = GetUserRank(arrParams[0].Value.ToString());
					break;

				//属于某对象
				case "belongto":
					oValue = true;
					break;
				//得到表达式中对人员所属的限定信息
				case "getbelongto":
					oValue = GetBelongTo(arrParams[0].Value.ToString());
					break;
				default:
					ExceptionHelper.TrueThrow<ApplicationException>(true, "不存在函数:" + strFuncName);
					break;
			}

			return oValue;
		}
Esempio n. 4
0
		/// <summary>
		/// 校验用户自定义表达式
		/// </summary>
		/// <param name="strFuncName">函数名称</param>
		/// <param name="arrParams">函数中使用的参数组</param>
		/// <param name="parseObj">表达解析式</param>
		/// <returns>用户自定义表达式的解析结果</returns>
		public object CheckUserFunction(string strFuncName, ParamObject[] arrParams, ParseExpression parseObj)
		{
			return DoUserFunction(strFuncName, arrParams, parseObj);
		}