Пример #1
0
        public static object ExecuteStatement(string[] domainIDAccessTree, string statementBlockID, string statement, object[] parameters, bool cache)
        {
            StatementExecutable executableInfo =
                StatementFactory.CreateExecutable(domainIDAccessTree, statementBlockID, statement, (parameters != null && parameters.Length > 0), cache);

            if (executableInfo.Exception != null)
            {
                return(executableInfo.Exception);
            }

            try
            {
                object invokedObject =
                    Application.Prepare(executableInfo.ExecutableName).Invoke(
                        Basics.Context.HttpMethod.GET,
                        new string[] { executableInfo.ClassName },
                        "Execute",
                        parameters,
                        false,
                        ExecuterTypes.Undefined
                        );

                if (invokedObject is System.Exception)
                {
                    throw (System.Exception)invokedObject;
                }

                return(invokedObject);
            }
            catch (System.Exception ex)
            {
                Helper.EventLogger.Log(ex);

                return(ex);
            }
        }