Base solution for your next web application

Activities of "BobIngham"

Answer

Thanks @ismcagdas, now I understand.

Brilliant, thanks @ismcagdas.

Hi all,

I have gone with the following: CreatedByFullName = user.Name + " " + user.Surname It would be interesting to know why user.FullName fails, however.

Cheers, Bob

Hi @ismcagdas,

Thanks for the answer, I was looking to find the date format of the current tenant but I think you have pointed me in the correct direction:

format: dt.setLocale(abp.localization.currentLanguage.name).toLocaleString(DateTime.DATETIME_SHORT);

Closing this as this is ok for my needs.

Cheers, Bob

Issue opened on github: date and time formats

Hi Musa,

Thanks for this, I had some modified entries in my database which were being loaded after I changed default values hence the confusion. There appear to be some unpredicatable consequences of using Chart.js canvas with a height setting so I will close this issue but may come back for some furthern clarification. Great work on the customizable dashboard, however, I am upgrading from 6.8.0 and this is one of the features I wanted to start working with. It's a pleasure to work with if you follow the instructions to te letter. Great Job!

Cheers, Bob

Perfect, thanks.

Hi Guys,

Try the abp.session object:

Cheers, Bob

Hi Kansoftware,

I am upgrading from 6.80 to 10.4.0 and found I had to make the following changes to my SQLRepository:

        ... code removed for brevity
        
        /// <summary>
        /// Returns a list of abpUsers with links to entities in nuagecare
        /// </summary>
        /// <param name="tenantId">long</param>
        /// <param name="UserId">long</param>
        /// <param name="isDeleted">bool?</param>
        /// <returns>Task<IQueryable<GetStaffForKendoGrid_Result>></returns>

        public async Task<IQueryable<GetStaffForKendoGrid_Result>> GetStaffForKendoGrid(int tenantId, long userId, bool isDeleted)
        {
            await **EnsureConnectionOpen();**

            var parms = new SqlParameter[3];
            parms[0] = new SqlParameter("@TenantId", tenantId);
            parms[1] = new SqlParameter("@UserId", userId);
            parms[2] = new SqlParameter("@IsDeleted", isDeleted);

            using (var command =** CreateCommand("GetStaffForKendoGrid", CommandType.StoredProcedure, parms)**)
            {
                using (var dataReader = await command.ExecuteReaderAsync())
                {
                    var result = new List<GetStaffForKendoGrid_Result>();

                    while (dataReader.Read())
                    {
                        var model = new GetStaffForKendoGrid_Result();
                        
                        ... model population here

                        result.Add(model);
                    }
                    dataReader.Close();
                    return result.AsQueryable();
                }
            }
        }

....

        #region helper methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name = "commandText" ></param >
        /// < param name="commandType"></param>
        /// <param name = "parameters" ></param >
        /// < returns ></returns >
        DbCommand CreateCommand(string commandText, CommandType commandType, params SqlParameter[] parameters)
        {
            var command = **GetConnection().CreateCommand();**

            command.CommandText = commandText;
            command.CommandType = commandType;
            command.Transaction = GetActiveTransaction();

            foreach (var parameter in parameters)
            {
                command.Parameters.Add(parameter);
            }
            return command;
        }

        /// <summary>
        /// Opens an SQL connection if one does not already exist.
        /// 20191020 - changed to OpenAsync()
        /// </summary>
        async Task EnsureConnectionOpen()
        {
            var connection = GetConnection();

            if (connection.State != ConnectionState.Open)
            {
                await connection.OpenAsync();
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        DbTransaction GetActiveTransaction()
        {
            return (DbTransaction)_transactionProvider.GetActiveTransaction(new ActiveTransactionProviderArgs
            {
                {"ContextType", typeof(NuagecareDbContext) },
                {"MultiTenancySide", MultiTenancySide }
            });
        }
        #endregion helper methods

I also had to change my using statement from; using System.Data.SqlClient; to using Microsoft.Data.SqlClient; But I think that's more down to the fact that I was previously on aspnet framework 4.6.0 with donetcore 2.1.

Hope that helps.

Basically all SQL commands executed by EF Core seems to be logged which makes the log files huge.

I have a fresh install of 10.4.0 and this is happenning. How can I switch it off?

Showing 11 to 20 of 477 entries