Exemple #1
0
        /// <summary>
        /// Creates a MySQL command selecting a collection of <see cref="FoodItemGroupProxy"/>.
        /// </summary>
        /// <param name="whereClause">The WHERE clause which the MySQL command should use.</param>
        /// <param name="parameterAdder">The callback to add MySQL parameters to the MySQL command.</param>
        /// <returns>MySQL command selecting a collection of <see cref="FoodItemGroupProxy"/>.</returns>
        private static MySqlCommand BuildSystemDataCommandForSelecting(string whereClause = null, Action <SystemDataCommandBuilder> parameterAdder = null)
        {
            StringBuilder selectStatementBuilder = new StringBuilder("SELECT fig.FoodItemGroupIdentifier,fig.FoodItemIdentifier,fig.FoodGroupIdentifier,fig.IsPrimary,fi.IsActive AS FoodItemIsActive,fg.ParentIdentifier AS FoodGroupParentIdentifier,fg.IsActive AS FoodGroupIsActive,pfg.ParentIdentifier AS FoodGroupParentsParentIdentifier,pfg.IsActive AS FoodGroupParentsParentIsActive FROM FoodItemGroups AS fig INNER JOIN FoodItems AS fi ON fi.FoodItemIdentifier=fig.FoodItemIdentifier INNER JOIN FoodGroups AS fg ON fg.FoodGroupIdentifier=fig.FoodGroupIdentifier LEFT JOIN FoodGroups AS pfg ON pfg.FoodGroupIdentifier=fg.ParentIdentifier");

            if (string.IsNullOrWhiteSpace(whereClause) == false)
            {
                selectStatementBuilder.Append($" {whereClause}");
            }

            SystemDataCommandBuilder systemDataCommandBuilder = new SystemDataCommandBuilder(selectStatementBuilder.ToString());

            if (parameterAdder == null)
            {
                return(systemDataCommandBuilder.Build());
            }

            parameterAdder(systemDataCommandBuilder);
            return(systemDataCommandBuilder.Build());
        }
Exemple #2
0
        /// <summary>
        /// Creates a MySQL command selecting a collection of <see cref="FoodItemProxy"/>.
        /// </summary>
        /// <param name="whereClause">The WHERE clause which the MySQL command should use.</param>
        /// <param name="parameterAdder">The callback to add MySQL parameters to the MySQL command.</param>
        /// <returns>MySQL command selecting a collection of <see cref="FoodItemProxy"/>.</returns>
        internal static MySqlCommand BuildSystemDataCommandForSelecting(string whereClause = null, Action <SystemDataCommandBuilder> parameterAdder = null)
        {
            StringBuilder selectStatementBuilder = new StringBuilder("SELECT fi.FoodItemIdentifier,fi.IsActive FROM FoodItems AS fi");

            if (string.IsNullOrWhiteSpace(whereClause) == false)
            {
                selectStatementBuilder.Append($" {whereClause}");
            }

            SystemDataCommandBuilder systemDataCommandBuilder = new SystemDataCommandBuilder(selectStatementBuilder.ToString());

            if (parameterAdder == null)
            {
                return(systemDataCommandBuilder.Build());
            }

            parameterAdder(systemDataCommandBuilder);
            return(systemDataCommandBuilder.Build());
        }
Exemple #3
0
        /// <summary>
        /// Creates a MySQL command selecting a collection of <see cref="ForeignKeyProxy"/>.
        /// </summary>
        /// <param name="whereClause">The WHERE clause which the MySQL command should use.</param>
        /// <param name="parameterAdder">The callback to add MySQL parameters to the MySQL command.</param>
        /// <returns>MySQL command selecting a collection of <see cref="ForeignKeyProxy"/>.</returns>
        internal static MySqlCommand BuildSystemDataCommandForSelecting(string whereClause = null, Action <SystemDataCommandBuilder> parameterAdder = null)
        {
            StringBuilder selectStatementBuilder = new StringBuilder("SELECT fk.ForeignKeyIdentifier,fk.DataProviderIdentifier,dp.Name AS DataProviderName,dp.HandlesPayments,dp.DataSourceStatementIdentifier,fk.ForeignKeyForIdentifier,fk.ForeignKeyForTypes,fk.ForeignKeyValue FROM ForeignKeys AS fk INNER JOIN DataProviders AS dp ON dp.DataProviderIdentifier=fk.DataProviderIdentifier");

            if (string.IsNullOrWhiteSpace(whereClause) == false)
            {
                selectStatementBuilder.Append($" {whereClause}");
            }

            SystemDataCommandBuilder systemDataCommandBuilder = new SystemDataCommandBuilder(selectStatementBuilder.ToString());

            if (parameterAdder == null)
            {
                return(systemDataCommandBuilder.Build());
            }

            parameterAdder(systemDataCommandBuilder);
            return(systemDataCommandBuilder.Build());
        }
Exemple #4
0
        /// <summary>
        /// Creates a MySQL command selecting a collection of <see cref="TranslationProxy"/>.
        /// </summary>
        /// <param name="whereClause">The WHERE clause which the MySQL command should use.</param>
        /// <param name="parameterAdder">The callback to add MySQL parameters to the MySQL command.</param>
        /// <returns>MySQL command selecting a collection of <see cref="TranslationProxy"/>.</returns>
        internal static MySqlCommand BuildSystemDataCommandForSelecting(string whereClause = null, Action <SystemDataCommandBuilder> parameterAdder = null)
        {
            StringBuilder selectStatementBuilder = new StringBuilder("SELECT t.TranslationIdentifier AS TranslationIdentifier,t.OfIdentifier AS OfIdentifier,ti.TranslationInfoIdentifier AS InfoIdentifier,ti.CultureName AS CultureName,t.Value AS Value FROM Translations AS t INNER JOIN TranslationInfos AS ti ON ti.TranslationInfoIdentifier=t.InfoIdentifier");

            if (string.IsNullOrWhiteSpace(whereClause) == false)
            {
                selectStatementBuilder.Append($" {whereClause}");
            }

            SystemDataCommandBuilder systemDataCommandBuilder = new SystemDataCommandBuilder(selectStatementBuilder.ToString());

            if (parameterAdder == null)
            {
                return(systemDataCommandBuilder.Build());
            }

            parameterAdder(systemDataCommandBuilder);
            return(systemDataCommandBuilder.Build());
        }