Пример #1
0
        public PartialViewResult AppLogo(string appPath, int width = 168, int height = 33)
        {
            ViewBag.TenantCustomLogoWidth  = width;
            ViewBag.TenantCustomLogoHeight = height;

            var tenancyName = _tenancyNameFinder.GetCurrentTenancyNameOrNull();

            if (string.IsNullOrEmpty(tenancyName))
            {
                if (AbpSession.TenantId.HasValue)
                {
                    using (_unitOfWorkManager.Begin())
                    {
                        using (_unitOfWorkManager.Current.SetTenantId(null))
                        {
                            var tenant = _tenantManager.FindById(AbpSession.GetTenantId());
                            SetLogoUrlForTenant(appPath, tenant);
                        }
                    }
                }
                else
                {
                    ViewBag.TenantCustomLogoUrl = appPath + "Common/Images/app-logo-on-light.png";
                }
            }
            else
            {
                using (_unitOfWorkManager.Begin())
                {
                    using (_unitOfWorkManager.Current.SetTenantId(null))
                    {
                        var tenant = _tenantManager.FindByTenancyName(tenancyName);
                        SetLogoUrlForTenant(appPath, tenant);
                    }
                }
            }

            return(PartialView("~/Views/Account/_AppLogo.cshtml"));
        }