Base solution for your next web application

Activities of "carelearning"

THank you for your response. I could create a sample project, but the same behavior exists here: http://qasample.aspnetboilerplate.com/Account/Login?ReturnUrl=/ If you go there, press F12 to bring up a console and run this code:

$.blockUI({ message: '<h1> Just a moment...</h1>' });

The result is a blocked GUI, but no message. To be more accurate, the <div> with the message is there, but due to CSS it is not visible.

If you go to http://malsup.com/jquery/block/ and run the same code, then you will get a blocked GUI with a message because the resulting CSS is slightly different.

I can find a way to code around this, but I thought I might be using it incorrectly. Maybe there is a way to accomplish this using abp (https://aspnetboilerplate.com/Pages/Documents/Javascript-API/UI-Block-Busy

Answers to your quesitons:

  1. No error
  2. Yes, it does block
  3. I do not see it listed in packages.config in my web project

Thank you again for your help.

According to http://malsup.com/jquery/block/ , the plugin is designed to have functionality like:

$.blockUI({ message: '<h1> Just a moment...</h1>' });

That code does not display the message. Is there a way to do this with abp.ui.block(); or $.blockUI() in an apb project?

Thanks

@aaron Thanks! This worked. Our code for those interested:

public class CustomOrganizationUnitManager : OrganizationUnitManager
    {
        public CustomOrganizationUnitManager(IRepository<OrganizationUnit, long> organizationUnitRepository) : base(organizationUnitRepository)
        {
        }

        protected override Task ValidateOrganizationUnitAsync(OrganizationUnit organizationUnit)
        {
            return Task.CompletedTask;
        }
    }

usage

public OuManager(IRepository<OrganizationUnit, long> organizationUnitRepository,
                         IRepository<UserOrganizationUnit, long> userOrganizationUnitRepository)
        {
          _organizationUnitManager = new CustomOrganizationUnitManager(organizationUnitRepository);    
         _organizationUnitRepository = organizationUnitRepository;
         _userOrganizationUnitRepository = userOrganizationUnitRepository;
        }

Hello,

We have a business need to have duplicate Display Names in OrganizationUnits under the same parent. We have association metadata tables to differentiate between them. Is there a way to disable the check on save when using the IRepository<OrganizationUnit>? Currently we get the following error: "There is already an organization unit with name [name]. Two units with same name can not be created in same level." The documentation here does not mention this as a requirement.

Thank you for your time and effort.

Dear @ismcagdas ,

Sorry for the confusion. We tested it again and those changes are working as you stated they would.

Thanks for the solution.

@ismcagdas We wanted to check with you to see if you received the email. Were you able to download the solution and run it?

Thanks again.

Hello,

We have created a sample project and sent an email to your Volosoft's "info" email account. This email contains instructions for how to download the solution that will illustrate the problem. Please let us know if you have any trouble or concerns.

Thank you.

@ismcagdas Thank you for looking into this

@aaron Thanks for your response. When we add:

[MultiTenancySide(MultiTenancySides.Host)]

to our host file and

[MultiTenancySide(MultiTenancySides.Tenant)]

to our tenant file we get this error now instead of the error above: The specified cast from a materialized 'System.Data.Entity.Core.Objects.MaterializedDataRecord' type to the '<>f__AnonymousType16`2[MyCompanyName.AbpZeroTemplate.Departments.Department,Abp.Authorization.Users.UserOrganizationUnit]' type is not valid.

We also noticed that this is not just on groupJoin statements, but regular join statements. Any thoughts or suggestions would be greatly appreciated.

Thanks again.

@ismcagda It looks like we gave you the version according to ABP Packages and not the product version. Sorry. We went from 5.3.0.0 to 5.4.0.0. Which means we were using the ABP 3.5.0.0 packages from this commit 9f6723952946c5f3faedfdbb079d318d34e7b6a3; but after merging commit 8cf59103b5d0c014f6604042b4ce5ed7246c1f03 it now includes the ABP 3.6.1.0 packages.

@alper When we roll back to our previous commit everything works as expected.

We are using the Single Deployment - Multiple Database Strategy ( <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy">https://aspnetboilerplate.com/Pages/Doc ... ti-Tenancy</a> ).

We have added two custom properties to an organization unit (locked and customKey) to our Department entity:

namespace MyCompanyName.AbpZeroTemplate.Departments
{
    using OrganizationUnits;

    public class Department : OrganizationUnitMap
    {
        public const int MaximumIdLength = 50;
        public const int MaximumTitleLength = 50;

        public string CustomKey { get; set; }
        public bool Locked { get; set; }

        public Department()
        {
        }

        public Department(long organizationUnitId, string cutomKey, bool locked = false)
        {
            CustomKey = cutomKey;
            Locked = locked;
            OrganizationUnitId = organizationUnitId;            
        }
    }
}

The query we wrote joins this entity via the OrganizationUnit navigation property to the assignments table (AbpUserOrganizationUnits) so we can determine which users have which departments. All of these entities should belong to the same TenantDB context.

Tenant Context:

public class AbpZeroTemplateTenantDbContext : AbpZeroTenantDbContext<Role, User>
    {
    		// removed other dbsets
    
        public virtual IDbSet<Department> Departments { get; set; }
        

        #region Constructors
        public AbpZeroTemplateTenantDbContext()
            : base("Tenant")
        {
        }

        public AbpZeroTemplateTenantDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
        }

        public AbpZeroTemplateTenantDbContext(DbConnection existingConnection)
            : base(existingConnection, false)
        {
        }

        public AbpZeroTemplateTenantDbContext(DbConnection existingConnection, bool contextOwnsConnection)
            : base(existingConnection, contextOwnsConnection)
        {
        }
        #endregion

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

						// removed other configurations
           
            modelBuilder.Configurations.Add(new DepartmentConfiguration());
            
        }
    }

Host Context

[DefaultDbContext]
    public class AbpZeroTemplateHostDbContext : AbpZeroHostDbContext<Tenant, Role, User>
    {
        /* Define an IDbSet for each entity of the application */

        public virtual IDbSet<BinaryObject> BinaryObjects { get; set; }

        public virtual IDbSet<Friendship> Friendships { get; set; }

        public virtual IDbSet<ChatMessage> ChatMessages { get; set; }

        public virtual IDbSet<EmailAddressDomain> EmailAddressDomains { get; set; }
        public virtual IDbSet<FileType> FileTypes { get; set; }
        public virtual IDbSet<TenantUsername> TenantUsernames { get; set; }

        public AbpZeroTemplateHostDbContext()
            : base("Host")
        {
        }

        public AbpZeroTemplateHostDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
        }

        public AbpZeroTemplateHostDbContext(DbConnection existingConnection)
            : base(existingConnection, false)
        {
        }

        public AbpZeroTemplateHostDbContext(DbConnection existingConnection, bool contextOwnsConnection)
            : base(existingConnection, contextOwnsConnection)
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Configurations.Add(new EmailAddressDomainConfiguration());
            modelBuilder.Configurations.Add(new FileTypeConfiguration());
            modelBuilder.Configurations.Add(new TenantUsernameConfiguration());
            modelBuilder.Configurations.Add(new UserConfiguration());
        }
    }

We are running ABP MVC 5/ JQuery and upgraded today to 3.6.1. This code:

var tags = await _departmentRepository
                    .GetAllIncluding(x => x.OrganizationUnit)
                    .GroupJoin(_userOrganizationUnitRepository.GetAll(),
                        t => t.OrganizationUnitId,
                        a => a.OrganizationUnitId,
                        (t, a) => new { Assignments = a, Tag = t }
                    )
                    .Where(x => x.Tag.OrganizationUnit.ParentId == parentId)
                    .ToListAsync();

now throws: "The specified LINQ expression contains references to queries that are associated with different contexts." This error is occurring at run-time for multiple LINQ expressions similar to the one above. Do we need to change our code? Do you know what could be causing this?

Thank you for your time.

Showing 21 to 30 of 108 entries