Exemple #1
0
        /// <summary>
        /// DatamodelMenu implementation for usage with MS SQL.
        /// </summary>
        /// <param name="connectionString">The connection string for the database</param>
        /// <param name="language">Language code for retrived data</param>
        /// <param name="initializationFunction">Lambda for initialization of the menu instance</param>
        public MsSqlDatamodelMenu(string connectionString, string language, DatamodelMenuInitialization initializationFunction)
            : base(
                '@',
                language,
                m =>
        {
            ((MsSqlDatamodelMenu)m).connectionString = connectionString;

            m.AddSqlHints(SqlHint.UseRecursiveCTE);

            if (initializationFunction != null)
            {
                initializationFunction(m);
            }
        }
                )
        {}
Exemple #2
0
        /// <summary>
        /// DatamodelMenu implementation for usage with Oracle.
        /// </summary>
        /// <param name="connectionString">The connection string for the database</param>
        /// <param name="language">Language code for retrived data</param>
        /// <param name="initializationFunction">Lambda for initialization of the menu instance</param>
        public OracleDatamodelMenu(string connectionString, string language, DatamodelMenuInitialization initializationFunction)
            : base(
                ':',
                language,
                m =>
        {
            ((OracleDatamodelMenu)m).connectionString = connectionString;

            m.AddSqlHints(SqlHint.UseConnectByPrior);

            if (initializationFunction != null)
            {
                initializationFunction(m);
            }
        }
                )
        {}
Exemple #3
0
        /// <summary>
        /// DatamodelMenu implementation for usage with Sybase.
        /// </summary>
        /// <param name="connectionString">The connection string for the database</param>
        /// <param name="language">Language code for retrived data</param>
        /// <param name="initializationFunction">Lambda for initialization of the menu instance</param>
        public SybaseDatamodelMenu(string connectionString, string language, DatamodelMenuInitialization initializationFunction)
            : base(
                ' ',                  //TODO: char for parameter binding
                language,
                m =>
        {
            //TODO: initializatin of DatamodelMenu for Sybase-usage
            //do we need any changes to the sql for Sybase usage?

            ((SybaseDatamodelMenu)m).connectionString = connectionString;

            if (initializationFunction != null)
            {
                initializationFunction(m);
            }
        }
                )
        {}
        /// <summary>
        /// Constructor to be called from sub classses.
        /// </summary>
        /// <param name="parameterChar">Char used to indicate binding variables in database. This value should in NO WAY originate from the GUI!</param>
        /// <param name="language">Language code for this context</param>
        /// <param name="initializationFunction">Function for initializing this instance</param>
        protected DatamodelMenu(char parameterChar, string language, DatamodelMenuInitialization initializationFunction)
        {
            log.DebugFormat("Creating instance with parameterchar, language: {0}, {1}", parameterChar, language);

            Language           = language;
            this.ParameterChar = parameterChar;

            if (initializationFunction != null)
            {
                log.Debug("Initialization supplied.");
                initializationFunction(this);
            }

            if (AlterSQL != null)
            {
                log.Debug("AlterSQL supplied.");
                OverrideSQL = AlterSQL(SQL);
            }

            RootItem = new PxMenuItem(this, "", "", "", RootSelection.Menu, RootSelection.Selection, "");
            SetCurrentItemBySelection(RootSelection.Menu, RootSelection.Selection);
        }
Exemple #5
0
        /// <summary>
        /// DatamodelMenu implementation for usage with Sybase.
        /// </summary>
        /// <param name="parameterChar">Char used to indicate binding variables in database. This value should in NO WAY originate from the GUI!</param>
        /// <param name="useRecursiveCTE">Gets or sets whether to use recursive CTE for extracting hierarchical data.</param>
        /// <param name="connectionString">The connection string for the database</param>
        /// <param name="language">Language code for retrived data</param>
        /// <param name="initializationFunction">Lambda for initialization of the menu instance</param>
        public OleDbDatamodelMenu(char parameterChar, bool useRecursiveCTE, string connectionString, string language, DatamodelMenuInitialization initializationFunction)
            : base(
                parameterChar,
                language,
                m =>
        {
            ((OleDbDatamodelMenu)m).connectionString = connectionString;

            if (useRecursiveCTE)
            {
                m.AddSqlHints(SqlHint.UseRecursiveCTE);
            }
            else
            {
                m.AddSqlHints(SqlHint.UseConnectByPrior);
                m.AddSqlHints(SqlHint.UseNedstedSelect);
            }

            if (initializationFunction != null)
            {
                initializationFunction(m);
            }
        }
                )
        { }